-
Security25/25No findings
-
Activity20/25Last human commit 12 months ago
-
Required by20/252 modules depend on it
-
Maturity18/25In 3 Odoo series since 15.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
CommissionLineMixin— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourcecommission_tree— Migrating to 18.0: the `tree` view type was renamed to `list` (`<list>` roots, `view_mode`). migration-view-tree-tag · sourceview_settlement_tree— Migrating to 18.0: the `tree` view type was renamed to `list` (`<list>` roots, `view_mode`). (2 occurrences in this file) migration-view-tree-tag · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
This module provides the base functions for commission operations to enable the following:
- Define agents with their commissions
- Assign agents to partners
- Create settlements to summarize commissions for certain periods
You can define which base amount is going to be taken into account: net amount (based on margin) or gross amount (line subtotal amount).
Additional feature provided by this module:
- Adds a grouped settlement report by date.
Dependencies
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- account_commission, commission_formula
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 17
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
commission_form |
commissions form | commission | form | New |
commission_tree |
commissions tree | commission | tree | New |
grouped_report_settlement |
grouped_report_settlement | ir.ui.view | qweb | New |
grouped_report_settlement_document |
grouped_report_settlement_document | ir.ui.view | qweb | New |
product_template_form_view_commission |
product.template.common.form.commission | product.template | form | Inherits product.product_template_form_view |
report_settlement |
report_settlement | ir.ui.view | qweb | New |
report_settlement_document |
report_settlement_document | ir.ui.view | qweb | New |
res_partner_view_search |
res.partner.select | res.partner | search | Inherits base.view_res_partner_filter |
view_commission_mixin_agent_only |
commission.mixin | form | New | |
view_partner_form_agent |
res.partner.form.agent | res.partner | form | Inherits base.view_partner_form |
view_settled_wizard |
Select period to settle | commission.make.settle | form | New |
view_settlement_form |
Settlements | commission.settlement | form | New |
view_settlement_line_graph |
commission.settlement.line.graph | commission.settlement.line | graph | New |
view_settlement_line_search |
commission.settlement.line.search | commission.settlement.line | search | New |
view_settlement_line_tree |
Settlement lines | commission.settlement.line | tree | New |
view_settlement_search |
commission.settlement.search | commission.settlement | search | New |
view_settlement_tree |
Settlements tree | commission.settlement | tree | New |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 9
-
activeBooleandefault=True -
amount_base_typeSelectiondefault='gross_amount'help="Select the base amount for computing the percentage:\n* 'Sale/Invoice Amount': percentage is computed from the amount put on sales order/invoice.\n* 'Margin (Amount - Cost)': percentage is computed from the profit only, taken the cost from the product."required=Trueselection=[('gross_amount', 'Sale/Invoice Amount'), ('net_amount', 'Margin (Amount - Cost)')]string='Base' -
commission_typeSelectiondefault='fixed'help='Select the percentage type of the commission:\n* \'Fixed percentage\': all commissions are computed with a fixed percentage. You can fill the percentage in the field "Fixed percentage".\n* \'By sections\': percentage varies depending amount intervals. You can fill intervals and percentages in the section "Rate definition".'required=Trueselection=[('fixed', 'Fixed percentage'), ('section', 'By sections')]string='Type' -
fix_qtyFloatstring='Fixed percentage' -
nameCharrequired=True -
section_idsOne2many → commission.sectioncomodel_name='commission.section'inverse_name='commission_id'string='Sections' -
settlement_typeSelectionselection='_selection_settlement_type'
-
calculate_section(self, base)
-
agent_idMany2one → res.partnercomodel_name='res.partner'domain="[('agent', '=', True)]"ondelete='restrict'required=True -
amountMonetarycompute='_compute_amount'store=Truestring='Commission Amount' -
commission_idMany2one → commissioncomodel_name='commission'compute='_compute_commission_id'copy=Trueondelete='restrict'readonly=Falserequired=Truestore=True -
currency_idMany2one → res.currencycomodel_name='res.currency' -
object_idMany2one → commission.mixincomodel_name='commission.mixin'copy=Falseondelete='cascade'required=Truestring='Parent'
No public methods.
-
agent_idsMany2many → res.partnercomodel_name='res.partner'domain="[('agent', '=', True)]" -
can_settleBooleancompute='_compute_can_settle'help='Technical field for improving UX when no extra *commission is installed.' -
date_toDatedefault=fields.Date.todayrequired=True args: 'Up to' -
settlement_typeSelectionrequired=Trueselection=[]
-
action_settle(self)
-
agent_idsOne2many → commission.line.mixincomodel_name='commission.line.mixin'compute='_compute_agent_ids'copy=Truehelp='Agents/Commissions related to the invoice line.'inverse_name='object_id'readonly=Falsestore=Truestring='Agents & commissions' -
commission_freeBooleancompute='_compute_commission_free'readonly=Truestore=Truestring='Comm. free' -
commission_statusCharcompute='_compute_commission_status'string='Commission' -
product_idMany2one → product.productcomodel_name='product.product'string='Product'
-
button_edit_agents(self) -
recompute_agents(self)
-
amount_fromFloatstring='From' -
amount_toFloatstring='To' -
commission_idMany2one → commissionstring='Commission' args: 'commission' -
percentFloatrequired=True
No public methods.
-
agent_idMany2one → res.partnercomodel_name='res.partner'domain="[('agent', '=', True)]"required=True -
agent_typeSelectionrelated='agent_id.agent_type' -
can_editBooleancompute='_compute_can_edit'help='Technical field for determining if user can edit settlements'store=True -
company_idMany2one → res.companycomodel_name='res.company'default=<expr>required=True -
currency_idMany2one → res.currencycomodel_name='res.currency'default=<expr>readonly=Truerequired=True -
date_fromDaterequired=Truestring='From' -
date_toDaterequired=Truestring='To' -
line_idsOne2many → commission.settlement.linecomodel_name='commission.settlement.line'inverse_name='settlement_id'string='Settlement lines' -
nameChar -
settlement_typeSelectiondefault='manual'help="The source of the settlement, e.g. 'Sales invoice', 'Sales order', 'Purchase order'..."readonly=Truerequired=Trueselection=[('manual', 'Manual')] -
stateSelectiondefault='settled'readonly=Truerequired=Trueselection=[('settled', 'Settled'), ('cancel', 'Canceled')] -
totalFloatcompute='_compute_total'readonly=Truestore=True
-
action_cancel(self) -
grouped_report_lines(self)
-
agent_idMany2one → res.partnercomodel_name='res.partner'related='settlement_id.agent_id'store=True -
commission_idMany2one → commissioncomodel_name='commission'compute='_compute_commission_id'readonly=Falserequired=Truestore=True -
company_idMany2one → res.companycomodel_name='res.company'related='settlement_id.company_id'store=True -
currency_idMany2one → res.currencycomodel_name='res.currency'readonly=Truerelated='settlement_id.currency_id'store=True -
dateDatecompute='_compute_date'readonly=Falserequired=Truestore=True -
settled_amountMonetarycompute='_compute_settled_amount'readonly=Falsestore=True -
settlement_idMany2one → commission.settlementondelete='cascade'readonly=Truerequired=True args: 'commission.settlement'
No public methods.
-
commission_freeBooleandefault=Falsestring='Free of commission'
No public methods.
-
agentBooleanhelp='Check this field if the partner is a creditor or an agent.'string='Creditor/Agent' -
agent_idsMany2many → res.partnercolumn1='partner_id'column2='agent_id'comodel_name='res.partner'domain=[('agent', '=', True)]readonly=Falserelation='partner_agent_rel'string='Agents' -
agent_typeSelectiondefault='agent'selection=[('agent', 'External agent')]string='Type' -
commission_idMany2one → commissioncomodel_name='commission'help='This is the default commission used in the sales where this agent is assigned. It can be changed on each operation if needed.'string='Commission' -
settlementSelectiondefault='monthly'selection=[('biweekly', 'Bi-weekly'), ('monthly', 'Monthly'), ('quaterly', 'Quarterly'), ('semi', 'Semi-annual'), ('annual', 'Annual')]string='Settlement period' -
settlement_idsOne2many → commission.settlementcomodel_name='commission.settlement'inverse_name='agent_id'readonly=True
No public methods.
Loading…
Loading…