Skip to content

Commit fb39a75

Browse files
committed
[IMP] sale_invoice_policy: Don't reuse fields in depends
As ORM appends new depends() parameters to existing ones, simplify the writing
1 parent a6b9111 commit fb39a75

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

sale_invoice_policy/models/sale_order_line.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@
77
class SaleOrderLine(models.Model):
88
_inherit = "sale.order.line"
99

10-
@api.depends(
11-
"qty_invoiced",
12-
"qty_delivered",
13-
"product_uom_qty",
14-
"state",
15-
"order_id.invoice_policy",
16-
)
10+
@api.depends("order_id.invoice_policy")
1711
def _compute_qty_to_invoice(self):
1812
"""
1913
Exclude lines that have their order invoice policy filled in
@@ -30,15 +24,7 @@ def _compute_qty_to_invoice(self):
3024
line.qty_to_invoice = line.qty_delivered - line.qty_invoiced
3125
return True
3226

33-
@api.depends(
34-
"state",
35-
"price_reduce",
36-
"product_id",
37-
"untaxed_amount_invoiced",
38-
"qty_delivered",
39-
"product_uom_qty",
40-
"order_id.invoice_policy",
41-
)
27+
@api.depends("order_id.invoice_policy")
4228
def _compute_untaxed_amount_to_invoice(self):
4329
other_lines = self.filtered(
4430
lambda line: line.product_id.type == "service"

0 commit comments

Comments
 (0)