diff --git a/purchase_stock_usability/__manifest__.py b/purchase_stock_usability/__manifest__.py index 066d0f0..d2bdf1b 100644 --- a/purchase_stock_usability/__manifest__.py +++ b/purchase_stock_usability/__manifest__.py @@ -24,6 +24,7 @@ Please contact Alexis de Lattre from Akretion for ], 'data': [ 'views/stock_picking.xml', + 'views/stock_warehouse_orderpoint.xml', ], 'installable': True, } diff --git a/purchase_stock_usability/models/__init__.py b/purchase_stock_usability/models/__init__.py index 370f577..d7751a6 100644 --- a/purchase_stock_usability/models/__init__.py +++ b/purchase_stock_usability/models/__init__.py @@ -1 +1,2 @@ from . import purchase +from . import stock_warehouse_orderpoint diff --git a/purchase_stock_usability/models/stock_warehouse_orderpoint.py b/purchase_stock_usability/models/stock_warehouse_orderpoint.py new file mode 100644 index 0000000..fe08fe6 --- /dev/null +++ b/purchase_stock_usability/models/stock_warehouse_orderpoint.py @@ -0,0 +1,21 @@ +# Copyright 2015-2020 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class StockWarehouseOrderpoint(models.Model): + _inherit = 'stock.warehouse.orderpoint' + + # Field needed to be able to search on supplier in the "Replenish" tree view + # I put it in purchase_stock_usability and not stock_usability + # because I wanted to use the field 'show_supplier' defined in purchase_stock + # (but I don't use it in the end because its computation returns False even + # on products with a Buy route) and I may also + # one day interact with supplier_id (M2O product.supplierinfo) defined in + # purchase_stock + seller_id = fields.Many2one( + related='product_id.product_tmpl_id.seller_ids.name', + store=True, string='Supplier', + ) diff --git a/purchase_stock_usability/views/stock_warehouse_orderpoint.xml b/purchase_stock_usability/views/stock_warehouse_orderpoint.xml new file mode 100644 index 0000000..f8ddd24 --- /dev/null +++ b/purchase_stock_usability/views/stock_warehouse_orderpoint.xml @@ -0,0 +1,45 @@ + + + + + + + + stock.warehouse.orderpoint + + + + + + + + + + stock.warehouse.orderpoint + + + + + + + + + + stock.warehouse.orderpoint + + + + + + + + + + + + + diff --git a/stock_usability/views/stock_warehouse_orderpoint.xml b/stock_usability/views/stock_warehouse_orderpoint.xml index 092ea1e..5cff667 100644 --- a/stock_usability/views/stock_warehouse_orderpoint.xml +++ b/stock_usability/views/stock_warehouse_orderpoint.xml @@ -25,6 +25,9 @@ show + + show + @@ -39,5 +42,4 @@ -