purchase_stock_usability: add supplier in tree view

stock_usability: allow to hide preferred route
This commit is contained in:
Alexis de Lattre
2023-07-14 14:41:06 +02:00
parent 1e8f00d4e1
commit 8afcd49bc3
5 changed files with 71 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
# Copyright 2015-2020 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# 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',
)