diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2026-01-02 10:53:32 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2026-01-02 10:53:32 +0700 |
| commit | b821d978d026c1e1f28438eae5af059924e49270 (patch) | |
| tree | 66f305930e126bf0fe3d1b50898cd343f6941b7d | |
| parent | d2ec851d598466fa37c5cd8acad942a98913b9e9 (diff) | |
| parent | 20a17a725aa9f3ff3d94c9405042f924101a3d13 (diff) | |
Merge branch 'main' of bitbucket.org:altafixco/fixco-addons
pull
| -rw-r--r-- | fixco_custom/models/purchase_order.py | 5 | ||||
| -rw-r--r-- | fixco_custom/views/purchase_order.xml | 10 |
2 files changed, 10 insertions, 5 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') diff --git a/fixco_custom/views/purchase_order.xml b/fixco_custom/views/purchase_order.xml index d81982e..d5e612c 100644 --- a/fixco_custom/views/purchase_order.xml +++ b/fixco_custom/views/purchase_order.xml @@ -23,12 +23,15 @@ type="object" string="Create Order Altama" class="oe_highlight" - icon="fa-cloud-upload"/> + icon="fa-cloud-upload" + attrs="{'invisible': [('partner_id', '!=', 270)]}" + /> <button name="action_get_order_altama" type="object" string="Get Order Altama" class="oe_highlight" - icon="fa-cloud-download"/> + attrs="{'invisible': [('partner_id', '!=', 270)]}" + icon="fa-cloud-download"/> </button> <field name="fiscal_position_id" position="after"> <field name="soo_number" readonly="1"/> @@ -37,6 +40,7 @@ <field name="soo_tax" readonly="1"/> <field name="sale_order_id" readonly="1"/> <field name="biaya_lain_lain"/> + <field name="discount_total"/> <field name="shipping_cost"/> <field name="source" readonly="1"/> <field name="move_entry_id" readonly="1"/> @@ -58,4 +62,4 @@ </field> </record> </data> -</odoo>
\ No newline at end of file +</odoo> |
