Skip to content

Commit

Permalink
[IMP] sale_commission_product_criteria_discount: correct commission t…
Browse files Browse the repository at this point in the history
…ype check
  • Loading branch information
ilyasProgrammer committed Aug 22, 2023
1 parent 2fe4eec commit e4a6d48
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion sale_commission_product_criteria_discount/models/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def _get_single_commission_amount(self, commission, subtotal, product, quantity)
self.ensure_one()
if product.commission_free or not commission:
return 0.0
if commission.commission_type != "product":
if commission.commission_type in ["percentage", "fixed"]:
return self._get_commission_amount(commission, subtotal, product, quantity)
item_ids = self._get_commission_items(commission, product)
if not item_ids:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
This module allows to manage the following commission structure use case:

Agent A receives commission 50 when selling product 1 to customer X

Agent A receives commission 20 when selling product 1 to customer Y

This behavior is integrated with both pricelist-like Commission Type structure (sale_commission_product_criteria) and commission by discount (sale_commission_product_criteria_discount)
This module allows to limit applied commission items for specific groups.
6 changes: 6 additions & 0 deletions setup/sale_commission_product_criteria_domain/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit e4a6d48

Please sign in to comment.