[REM] sale_stock: Remove duplicated incoterms_id field
-incoterm_id in account/models/account_invoice.py -incoterms_id in sale_stock/models/account_invoice.py closes odoo/odoo#31463
This commit is contained in:
@@ -26,7 +26,6 @@ Preferences
|
|||||||
'views/sale_order_views.xml',
|
'views/sale_order_views.xml',
|
||||||
'views/stock_views.xml',
|
'views/stock_views.xml',
|
||||||
'views/res_config_settings_views.xml',
|
'views/res_config_settings_views.xml',
|
||||||
'views/account_invoice_views.xml',
|
|
||||||
'views/sale_stock_portal_template.xml',
|
'views/sale_stock_portal_template.xml',
|
||||||
'views/stock_production_lot_views.xml',
|
'views/stock_production_lot_views.xml',
|
||||||
'report/sale_order_report_templates.xml',
|
'report/sale_order_report_templates.xml',
|
||||||
|
|||||||
@@ -7,10 +7,6 @@ from odoo import fields, models
|
|||||||
class AccountInvoice(models.Model):
|
class AccountInvoice(models.Model):
|
||||||
_inherit = 'account.invoice'
|
_inherit = 'account.invoice'
|
||||||
|
|
||||||
incoterms_id = fields.Many2one('account.incoterms', string="Incoterms",
|
|
||||||
help="Incoterms are series of sales terms. They are used to divide transaction costs and responsibilities between buyer and seller and reflect state-of-the-art transportation practices.",
|
|
||||||
readonly=True, states={'draft': [('readonly', False)]})
|
|
||||||
|
|
||||||
def _get_last_step_stock_moves(self):
|
def _get_last_step_stock_moves(self):
|
||||||
""" Overridden from stock_account.
|
""" Overridden from stock_account.
|
||||||
Returns the stock moves associated to this invoice."""
|
Returns the stock moves associated to this invoice."""
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class SaleOrder(models.Model):
|
|||||||
@api.multi
|
@api.multi
|
||||||
def _prepare_invoice(self):
|
def _prepare_invoice(self):
|
||||||
invoice_vals = super(SaleOrder, self)._prepare_invoice()
|
invoice_vals = super(SaleOrder, self)._prepare_invoice()
|
||||||
invoice_vals['incoterms_id'] = self.incoterm.id or False
|
invoice_vals['incoterm_id'] = self.incoterm.id or False
|
||||||
return invoice_vals
|
return invoice_vals
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<odoo>
|
|
||||||
<record id="invoice_form_inherit_sale_stock" model="ir.ui.view">
|
|
||||||
<field name="name">account.invoice.form.sale.stock</field>
|
|
||||||
<field name="model">account.invoice</field>
|
|
||||||
<field name="inherit_id" ref="account.invoice_form"/>
|
|
||||||
<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"/>
|
|
||||||
</xpath>
|
|
||||||
</data>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<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">
|
|
||||||
<strong>Incoterms:</strong>
|
|
||||||
<p t-field="o.incoterms_id.code"/>
|
|
||||||
</div>
|
|
||||||
</xpath>
|
|
||||||
</template>
|
|
||||||
</odoo>
|
|
||||||
Reference in New Issue
Block a user