diff options
| author | Laurent Smet <las@odoo.com> | 2019-02-28 10:59:56 +0000 |
|---|---|---|
| committer | Laurent Smet <las@odoo.com> | 2019-02-28 12:32:50 +0000 |
| commit | 569a498d360b99b2a1d8e64a6e6bcc259d0910e4 (patch) | |
| tree | b1034f4cebbd3b5af52a18cb006387b3ac75056a | |
| parent | 5ee5e876a3098ec1f5abd76616c071e6ccdf4b91 (diff) | |
[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
| -rw-r--r-- | addons/sale_stock/__manifest__.py | 1 | ||||
| -rw-r--r-- | addons/sale_stock/models/account_invoice.py | 4 | ||||
| -rw-r--r-- | addons/sale_stock/models/sale_order.py | 2 | ||||
| -rw-r--r-- | addons/sale_stock/views/account_invoice_views.xml | 25 |
4 files changed, 1 insertions, 31 deletions
diff --git a/addons/sale_stock/__manifest__.py b/addons/sale_stock/__manifest__.py index b78b72d927c..5183db42a2e 100644 --- a/addons/sale_stock/__manifest__.py +++ b/addons/sale_stock/__manifest__.py @@ -26,7 +26,6 @@ Preferences 'views/sale_order_views.xml', 'views/stock_views.xml', 'views/res_config_settings_views.xml', - 'views/account_invoice_views.xml', 'views/sale_stock_portal_template.xml', 'views/stock_production_lot_views.xml', 'report/sale_order_report_templates.xml', diff --git a/addons/sale_stock/models/account_invoice.py b/addons/sale_stock/models/account_invoice.py index 2348430f39c..79f8039156d 100644 --- a/addons/sale_stock/models/account_invoice.py +++ b/addons/sale_stock/models/account_invoice.py @@ -7,10 +7,6 @@ from odoo import fields, models class AccountInvoice(models.Model): _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): """ Overridden from stock_account. Returns the stock moves associated to this invoice.""" diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py index fc636b8177a..0b38a867a4a 100644 --- a/addons/sale_stock/models/sale_order.py +++ b/addons/sale_stock/models/sale_order.py @@ -134,7 +134,7 @@ class SaleOrder(models.Model): @api.multi def _prepare_invoice(self): 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 @api.model diff --git a/addons/sale_stock/views/account_invoice_views.xml b/addons/sale_stock/views/account_invoice_views.xml deleted file mode 100644 index ed8e07b1a54..00000000000 --- a/addons/sale_stock/views/account_invoice_views.xml +++ /dev/null @@ -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> |
