purchase_stock_usability: add supplier in tree view
stock_usability: allow to hide preferred route
This commit is contained in:
@@ -24,6 +24,7 @@ Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for
|
||||
],
|
||||
'data': [
|
||||
'views/stock_picking.xml',
|
||||
'views/stock_warehouse_orderpoint.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
from . import purchase
|
||||
from . import stock_warehouse_orderpoint
|
||||
|
||||
@@ -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',
|
||||
)
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-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).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="view_warehouse_orderpoint_tree_editable" model="ir.ui.view">
|
||||
<field name="model">stock.warehouse.orderpoint</field>
|
||||
<field name="inherit_id" ref="stock.view_warehouse_orderpoint_tree_editable" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_id" position="after">
|
||||
<field name="seller_id" optional="hide"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_warehouse_orderpoint_tree_editable_config" model="ir.ui.view">
|
||||
<field name="model">stock.warehouse.orderpoint</field>
|
||||
<field name="inherit_id" ref="stock.view_warehouse_orderpoint_tree_editable_config" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_id" position="after">
|
||||
<field name="seller_id" optional="hide"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_reorder_report_search" model="ir.ui.view">
|
||||
<field name="model">stock.warehouse.orderpoint</field>
|
||||
<field name="inherit_id" ref="stock.stock_reorder_report_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_id" position="after">
|
||||
<field name="seller_id" domain="[('parent_id', '=', False)]"/>
|
||||
</field>
|
||||
<filter name="groupby_category" position="after">
|
||||
<filter string="Supplier" name="seller_id_groupby" context="{'group_by': 'seller_id'}"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
@@ -25,6 +25,9 @@
|
||||
<field name="trigger" position="attributes">
|
||||
<attribute name="optional">show</attribute>
|
||||
</field>
|
||||
<field name="route_id" position="attributes">
|
||||
<attribute name="optional">show</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -39,5 +42,4 @@
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user