diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-01-02 10:16:15 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-01-02 10:16:15 +0700 |
| commit | 20a17a725aa9f3ff3d94c9405042f924101a3d13 (patch) | |
| tree | 98e08c846b4d529537e95693f8477e6fd986ede7 /fixco_custom/models | |
| parent | 7c18662262af2041f18e0dd7890f88e72f066032 (diff) | |
<MIqdad> fix formula amount all PO
Diffstat (limited to 'fixco_custom/models')
| -rw-r--r-- | fixco_custom/models/purchase_order.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fixco_custom/models/purchase_order.py b/fixco_custom/models/purchase_order.py index cf8945e..f2a6c3e 100644 --- a/fixco_custom/models/purchase_order.py +++ b/fixco_custom/models/purchase_order.py @@ -55,6 +55,7 @@ class PurchaseOrder(models.Model): soo_price = fields.Float('SOO Price', copy=False) soo_discount = fields.Float('SOO Discount', copy=False) soo_tax = fields.Float('SOO Tax', copy=False) + discount_total = fields.Float('Discount Total', help = 'Total Discount for Each Product') def _get_fixco_token(self, source='auto'): ICP = self.env['ir.config_parameter'].sudo() @@ -422,12 +423,12 @@ class PurchaseOrder(models.Model): 'domain': [('id', 'in', journals.ids)], } - @api.depends('order_line.price_total', 'biaya_lain_lain') + @api.depends('order_line.price_total', 'biaya_lain_lain', 'discount_total') def _amount_all(self): super(PurchaseOrder, self)._amount_all() for order in self: - amount_total = order.amount_untaxed + order.amount_tax - order.biaya_lain_lain + amount_total = order.amount_untaxed + order.amount_tax + order.biaya_lain_lain - order.discount_total order.amount_total = order.currency_id.round(amount_total) @api.depends('order_line.discount_amount') |
