[FIX] sale_stock: hide redundant incoterms_id field
The field incoterms_id is made redundant by the field incoterm_id introduced inb5bb5bd421. As such, it has been removed in master at:569a498d36We make this field invisible, and synchronize the invoice incoterm_id with the sale order incoterm. opw 1935573 closes odoo/odoo#32039 Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
This commit is contained in:
@@ -128,6 +128,8 @@ class SaleOrder(models.Model):
|
||||
def _prepare_invoice(self):
|
||||
invoice_vals = super(SaleOrder, self)._prepare_invoice()
|
||||
invoice_vals['incoterms_id'] = self.incoterm.id or False
|
||||
if self.incoterm.id:
|
||||
invoice_vals['incoterm_id'] = self.incoterm.id
|
||||
return invoice_vals
|
||||
|
||||
@api.model
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//page[@name='other_info']//field[@name='origin']" position="after">
|
||||
<field name="incoterms_id" widget="selection" groups="sale_stock.group_display_incoterm"/>
|
||||
<field name="incoterms_id" widget="selection" groups="sale_stock.group_display_incoterm" invisible="1"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
@@ -16,9 +16,9 @@
|
||||
<template id="report_invoice_document_inherit_sale_stock" inherit_id="account.report_invoice_document">
|
||||
<!-- HTML Preview for mobile responsive -->
|
||||
<xpath expr="//div[@name='reference']" position="after">
|
||||
<div t-att-class="o_grid_layout" t-if="o.incoterms_id" groups="sale_stock.group_display_incoterm">
|
||||
<div t-att-class="o_grid_layout" t-if="o.incoterm_id" groups="sale_stock.group_display_incoterm">
|
||||
<strong>Incoterms:</strong>
|
||||
<p t-field="o.incoterms_id.code"/>
|
||||
<p t-field="o.incoterm_id.code"/>
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user