diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 1865d20ee6e5586f3bce979d286553c50f8c9cce..42cbde8ab4acb11fe30e227eae7c21c17226450d 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -188,7 +188,7 @@ class PurchaseOrder(models.Model): name = po.name if po.partner_ref: name += ' ('+po.partner_ref+')' - if po.amount_total: + if self.env.context.get('show_total_amount') and po.amount_total: name += ': ' + formatLang(self.env, po.amount_total, currency_obj=po.currency_id) result.append((po.id, name)) return result diff --git a/addons/purchase/views/account_invoice_views.xml b/addons/purchase/views/account_invoice_views.xml index a85974931f4e18a57b24fca596c843aa2df345c2..c112df772f356c59776e22828f80d8dedba7160b 100644 --- a/addons/purchase/views/account_invoice_views.xml +++ b/addons/purchase/views/account_invoice_views.xml @@ -60,7 +60,7 @@ <field name="arch" type="xml"> <field name="reference" position="after" > <field name="purchase_id" attrs="{'invisible': [('state', '=', 'purchase')]}" class="oe_edit_only" - options="{'no_create': True}"/> + options="{'no_create': True}" context="{'show_total_amount': True}"/> </field> <xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='company_id']" position="after"> <field name="purchase_line_id" invisible="1" readonly="0"/>