Add product_barcode with optional=hide in tree view of inventory lines and quants
This commit is contained in:
@@ -3,6 +3,7 @@ from . import stock_picking
|
|||||||
from . import stock_location_route
|
from . import stock_location_route
|
||||||
from . import stock_warehouse_orderpoint
|
from . import stock_warehouse_orderpoint
|
||||||
from . import stock_quant
|
from . import stock_quant
|
||||||
|
from . import stock_inventory
|
||||||
from . import procurement_group
|
from . import procurement_group
|
||||||
from . import procurement_scheduler_log
|
from . import procurement_scheduler_log
|
||||||
from . import product
|
from . import product
|
||||||
|
|||||||
11
stock_usability/models/stock_inventory.py
Normal file
11
stock_usability/models/stock_inventory.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Copyright 2021 Akretion France (http://www.akretion.com/)
|
||||||
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class StockInventoryLine(models.Model):
|
||||||
|
_inherit = 'stock.inventory.line'
|
||||||
|
|
||||||
|
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
|
||||||
@@ -2,12 +2,14 @@
|
|||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import models
|
from odoo import fields, models
|
||||||
|
|
||||||
|
|
||||||
class StockQuant(models.Model):
|
class StockQuant(models.Model):
|
||||||
_inherit = 'stock.quant'
|
_inherit = 'stock.quant'
|
||||||
|
|
||||||
|
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
|
||||||
|
|
||||||
def action_stock_move_lines_reserved(self):
|
def action_stock_move_lines_reserved(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
action = self.action_view_stock_moves()
|
action = self.action_view_stock_moves()
|
||||||
|
|||||||
@@ -12,6 +12,9 @@
|
|||||||
<field name="model">stock.inventory.line</field>
|
<field name="model">stock.inventory.line</field>
|
||||||
<field name="inherit_id" ref="stock.stock_inventory_line_tree"/>
|
<field name="inherit_id" ref="stock.stock_inventory_line_tree"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
|
<field name="product_id" position="after">
|
||||||
|
<field name="product_barcode" optional="hide"/>
|
||||||
|
</field>
|
||||||
<tree position="attributes">
|
<tree position="attributes">
|
||||||
<!-- native :
|
<!-- native :
|
||||||
decoration-danger="product_qty != theoretical_qty"
|
decoration-danger="product_qty != theoretical_qty"
|
||||||
|
|||||||
@@ -13,6 +13,9 @@
|
|||||||
<field name="model">stock.quant</field>
|
<field name="model">stock.quant</field>
|
||||||
<field name="inherit_id" ref="stock.view_stock_quant_tree"/>
|
<field name="inherit_id" ref="stock.view_stock_quant_tree"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
|
<field name="product_id" position="after">
|
||||||
|
<field name="product_barcode" optional="hide"/>
|
||||||
|
</field>
|
||||||
<field name="quantity" position="attributes">
|
<field name="quantity" position="attributes">
|
||||||
<attribute name="sum">1</attribute>
|
<attribute name="sum">1</attribute>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user