stock_usability: Add product_barcode on orderpoint tree view (optional hide)

This commit is contained in:
Alexis de Lattre
2024-09-12 21:28:51 +02:00
parent 7b8c35a384
commit 4e68c48110
2 changed files with 6 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models
from odoo import api, fields, models
import logging
logger = logging.getLogger(__name__)
@@ -11,6 +11,8 @@ logger = logging.getLogger(__name__)
class StockWarehouseOrderpoint(models.Model):
_inherit = 'stock.warehouse.orderpoint'
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
@api.model
def _procure_orderpoint_confirm(
self, use_new_cursor=False, company_id=False, raise_user_error=True):

View File

@@ -22,6 +22,9 @@
<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="product_barcode" optional="hide"/>
</field>
<field name="trigger" position="attributes">
<attribute name="optional">show</attribute>
</field>