From 569a498d360b99b2a1d8e64a6e6bcc259d0910e4 Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Thu, 28 Feb 2019 10:59:56 +0000 Subject: [PATCH] [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 --- addons/sale_stock/__manifest__.py | 1 - addons/sale_stock/models/account_invoice.py | 4 --- addons/sale_stock/models/sale_order.py | 2 +- .../views/account_invoice_views.xml | 25 ------------------- 4 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 addons/sale_stock/views/account_invoice_views.xml 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 @@ - - - - account.invoice.form.sale.stock - account.invoice - - - - - - - - - - - -