Skip to content

Commit cd26f5f

Browse files
committed
[IMP] sale_commission: Make fields precomputed
1 parent c1a971c commit cd26f5f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

commission/models/commission_mixin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ class CommissionMixin(models.AbstractModel):
1919
readonly=False,
2020
store=True,
2121
copy=True,
22+
precompute=True,
2223
)
2324
product_id = fields.Many2one(comodel_name="product.product", string="Product")
2425
commission_free = fields.Boolean(
2526
string="Comm. free",
2627
compute="_compute_commission_free",
2728
store=True,
2829
readonly=True,
30+
precompute=True,
2931
)
3032
commission_status = fields.Char(
3133
compute="_compute_commission_status",
@@ -126,11 +128,13 @@ class CommissionLineMixin(models.AbstractModel):
126128
store=True,
127129
readonly=False,
128130
copy=True,
131+
precompute=True,
129132
)
130133
amount = fields.Monetary(
131134
string="Commission Amount",
132135
compute="_compute_amount",
133136
store=True,
137+
precompute=True,
134138
)
135139
# Fields to be overriden with proper source (via related or computed field)
136140
currency_id = fields.Many2one(comodel_name="res.currency")

0 commit comments

Comments
 (0)