Skip to content

Commit

Permalink
[IMP] sale_commission: Make fields precomputed
Browse files Browse the repository at this point in the history
  • Loading branch information
luisDIXMIT committed Jan 27, 2025
1 parent c1a971c commit cd26f5f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions commission/models/commission_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ class CommissionMixin(models.AbstractModel):
readonly=False,
store=True,
copy=True,
precompute=True,
)
product_id = fields.Many2one(comodel_name="product.product", string="Product")
commission_free = fields.Boolean(
string="Comm. free",
compute="_compute_commission_free",
store=True,
readonly=True,
precompute=True,
)
commission_status = fields.Char(
compute="_compute_commission_status",
Expand Down Expand Up @@ -126,11 +128,13 @@ class CommissionLineMixin(models.AbstractModel):
store=True,
readonly=False,
copy=True,
precompute=True,
)
amount = fields.Monetary(
string="Commission Amount",
compute="_compute_amount",
store=True,
precompute=True,
)
# Fields to be overriden with proper source (via related or computed field)
currency_id = fields.Many2one(comodel_name="res.currency")
Expand Down

0 comments on commit cd26f5f

Please sign in to comment.