From 8e5d3b8a748b11b6e4b500cff15afbe41fd56434 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 30 Dec 2024 12:47:30 +0100 Subject: [PATCH] [MIG] purchase_stock_usability_akretion to v18 incoterm_id is a field of purchase module, not purchase_stock ; so move the inherit of this field from purchase_stock_usability_akretion to purchase_usability_akretion --- .../__manifest__.py | 10 +++++----- .../models/purchase.py | 20 +++++++++---------- .../models/stock_move.py | 4 ++-- .../models/stock_move_line.py | 4 ++-- .../views/purchase_order.xml | 2 +- .../views/stock_move.xml | 4 ++-- .../views/stock_move_line.xml | 4 ++-- .../views/stock_picking.xml | 8 ++++---- .../models/purchase_order.py | 3 ++- 9 files changed, 30 insertions(+), 29 deletions(-) diff --git a/purchase_stock_usability_akretion/__manifest__.py b/purchase_stock_usability_akretion/__manifest__.py index 7c49643..15a065f 100644 --- a/purchase_stock_usability_akretion/__manifest__.py +++ b/purchase_stock_usability_akretion/__manifest__.py @@ -1,10 +1,10 @@ -# Copyright 2014-2022 Akretion (http://www.akretion.com) +# Copyright 2014-2024 Akretion France (https://www.akretion.com) # @author Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Purchase Stock Usability', - 'version': '16.0.1.0.0', + 'version': '18.0.1.0.0', 'category': 'Purchases', 'license': 'AGPL-3', 'summary': 'Usability improvements on purchase_stock module', @@ -17,10 +17,10 @@ Several usability improvements on the official purchase_stock module: This module has been written by Alexis de Lattre from Akretion France. """, 'author': 'Akretion', - 'website': 'http://www.akretion.com', + 'website': 'https://github.com/akretion/odoo-usability', 'depends': [ 'purchase_stock', - 'purchase_usability', + 'purchase_usability_akretion', ], 'data': [ 'views/stock_picking.xml', @@ -28,5 +28,5 @@ This module has been written by Alexis de Lattre from Akretion France. 'views/stock_move.xml', 'views/stock_move_line.xml', ], - 'installable': False, + 'installable': True, } diff --git a/purchase_stock_usability_akretion/models/purchase.py b/purchase_stock_usability_akretion/models/purchase.py index a6ffb5f..89455bc 100644 --- a/purchase_stock_usability_akretion/models/purchase.py +++ b/purchase_stock_usability_akretion/models/purchase.py @@ -1,4 +1,4 @@ -# Copyright 2015-2022 Akretion France (http://www.akretion.com) +# Copyright 2015-2024 Akretion France (https://www.akretion.com) # @author Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -9,18 +9,18 @@ class PurchaseOrder(models.Model): _inherit = 'purchase.order' picking_type_id = fields.Many2one(tracking=True) - incoterm_id = fields.Many2one(tracking=True) + incoterm_location = fields.Char(tracking=True) # inherit compute method of the field delivery_partner_id - # defined in purchase_usability + # defined in purchase_usability_akretion @api.depends('dest_address_id', 'picking_type_id') def _compute_delivery_partner_id(self): - for o in self: + for rec in self: delivery_partner_id = False - if o.dest_address_id: - delivery_partner_id = o.dest_address_id + if rec.dest_address_id: + delivery_partner_id = rec.dest_address_id elif ( - o.picking_type_id.warehouse_id and - o.picking_type_id.warehouse_id.partner_id): - delivery_partner_id = o.picking_type_id.warehouse_id.partner_id - o.delivery_partner_id = delivery_partner_id + rec.picking_type_id.warehouse_id and + rec.picking_type_id.warehouse_id.partner_id): + delivery_partner_id = rec.picking_type_id.warehouse_id.partner_id + rec.delivery_partner_id = delivery_partner_id diff --git a/purchase_stock_usability_akretion/models/stock_move.py b/purchase_stock_usability_akretion/models/stock_move.py index 86d61bf..20fc461 100644 --- a/purchase_stock_usability_akretion/models/stock_move.py +++ b/purchase_stock_usability_akretion/models/stock_move.py @@ -1,4 +1,4 @@ -# Copyright 2023 Akretion France (http://www.akretion.com) +# Copyright 2023-2024 Akretion France (https://www.akretion.com) # @author Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -8,7 +8,7 @@ from odoo import fields, models class StockMove(models.Model): _inherit = 'stock.move' - # for optional display in tree view + # for optional display in list view product_supplier_code = fields.Char( compute='_compute_product_supplier_code', string="Vendor Product Code") diff --git a/purchase_stock_usability_akretion/models/stock_move_line.py b/purchase_stock_usability_akretion/models/stock_move_line.py index 7950b76..3d9184c 100644 --- a/purchase_stock_usability_akretion/models/stock_move_line.py +++ b/purchase_stock_usability_akretion/models/stock_move_line.py @@ -1,4 +1,4 @@ -# Copyright 2023 Akretion France (http://www.akretion.com) +# Copyright 2023-2024 Akretion France (https://www.akretion.com) # @author Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -8,7 +8,7 @@ from odoo import fields, models class StockMoveLine(models.Model): _inherit = 'stock.move.line' - # for optional display in tree view + # for optional display in list view product_supplier_code = fields.Char( compute='_compute_product_supplier_code', string="Vendor Product Code") diff --git a/purchase_stock_usability_akretion/views/purchase_order.xml b/purchase_stock_usability_akretion/views/purchase_order.xml index b89f86c..c60b03e 100644 --- a/purchase_stock_usability_akretion/views/purchase_order.xml +++ b/purchase_stock_usability_akretion/views/purchase_order.xml @@ -1,6 +1,6 @@ diff --git a/purchase_stock_usability_akretion/views/stock_move.xml b/purchase_stock_usability_akretion/views/stock_move.xml index 29219f4..888cecc 100644 --- a/purchase_stock_usability_akretion/views/stock_move.xml +++ b/purchase_stock_usability_akretion/views/stock_move.xml @@ -1,6 +1,6 @@ @@ -13,7 +13,7 @@ - + diff --git a/purchase_stock_usability_akretion/views/stock_move_line.xml b/purchase_stock_usability_akretion/views/stock_move_line.xml index 6643314..1b757e4 100644 --- a/purchase_stock_usability_akretion/views/stock_move_line.xml +++ b/purchase_stock_usability_akretion/views/stock_move_line.xml @@ -1,6 +1,6 @@ @@ -23,7 +23,7 @@ - + diff --git a/purchase_stock_usability_akretion/views/stock_picking.xml b/purchase_stock_usability_akretion/views/stock_picking.xml index 5295196..c915d25 100644 --- a/purchase_stock_usability_akretion/views/stock_picking.xml +++ b/purchase_stock_usability_akretion/views/stock_picking.xml @@ -1,6 +1,6 @@ @@ -14,10 +14,10 @@ - + - - + + diff --git a/purchase_usability_akretion/models/purchase_order.py b/purchase_usability_akretion/models/purchase_order.py index 65c03e4..2a33811 100644 --- a/purchase_usability_akretion/models/purchase_order.py +++ b/purchase_usability_akretion/models/purchase_order.py @@ -13,6 +13,7 @@ class PurchaseOrder(models.Model): currency_id = fields.Many2one(tracking=True) payment_term_id = fields.Many2one(tracking=True) fiscal_position_id = fields.Many2one(tracking=True) + incoterm_id = fields.Many2one(tracking=True) partner_ref = fields.Char(tracking=True) # the field 'delivery_partner_id' is used in report # the compute method of that field is inherited in purchase_stock_usability @@ -69,7 +70,7 @@ class PurchaseOrder(models.Model): class PurchaseOrderLine(models.Model): _inherit = 'purchase.order.line' - # for optional display in tree view + # for optional display in list view product_barcode = fields.Char( related='product_id.barcode', string="Product Barcode") product_supplier_code = fields.Char(