Skip to content

Commit

Permalink
[FIX] sale_commission_product_criteria: removed pricelist_id feild
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasProgrammer committed Jun 22, 2023
1 parent 6590514 commit 0259b2d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
2 changes: 0 additions & 2 deletions sale_commission_product_criteria/models/commission.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ class CommissionItem(models.Model):
domain=[("commission_type", "=", "product")],
required=True,
)
use_pricelist = fields.Boolean()
pricelist_id = fields.Many2one("product.pricelist")
product_tmpl_id = fields.Many2one(
"product.template",
"Product",
Expand Down
2 changes: 0 additions & 2 deletions sale_commission_product_criteria/views/views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
/>
<field name="applied_on" widget="radio" />
<field name="based_on" invisible="1" />
<field name="use_pricelist" invisible="1" />
<field
name="categ_id"
attrs="{
Expand Down Expand Up @@ -173,7 +172,6 @@
<field name="commission_id" />
<field name="name" />
<field name="applied_on" optional="hide" />
<field name="use_pricelist" invisible="1" />
<field name="commission_value" />
<field name="based_on" />
</tree>
Expand Down
9 changes: 1 addition & 8 deletions sale_commission_product_criteria_discount/models/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def _get_single_commission_amount(self, commission, subtotal, product, quantity)
item_ids = self._get_commission_items(commission, product)
if not item_ids:
return 0.0
so_id = self.object_id.order_id
# Check discount condition
commission_item = False
for item_id in item_ids:
Expand All @@ -33,13 +32,7 @@ def _get_single_commission_amount(self, commission, subtotal, product, quantity)
):
break # suitable item found
else:
if (
commission_item.pricelist_id
and so_id.pricelist_id.id != commission_item.pricelist_id.id
):
commission_item = False # unsuitable item
else:
break # suitable item found
break # suitable item found
commission_item = False
if not commission_item:
# all commission items rejected
Expand Down

0 comments on commit 0259b2d

Please sign in to comment.