Add more information on stock move form

issue11768
review439591003
This commit is contained in:
Cédric Krier committed 2022-10-09 19:07:16 +02:00
1 parent 6d74bb36d7
commit 6d996560e0
4 files changed
+28 -2

No files matched your search

+6 -2
View File
@@ -3,12 +3,16 @@
from trytond.model import fields
from trytond.modules.product import price_digits
from trytond.pool import PoolMeta
from trytond.pyson import Eval
class Move(metaclass=PoolMeta):
__name__ = 'stock.move'
unit_landed_cost = fields.Numeric('Unit Landed Cost',
digits=price_digits, readonly=True)
unit_landed_cost = fields.Numeric(
"Unit Landed Cost", digits=price_digits, readonly=True,
states={
'invisible': ~Eval('unit_landed_cost'),
})
def _compute_unit_price(self, unit_price):
if self.unit_landed_cost:
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.ui.view" id="stock_move_view_form">
<field name="model">stock.move</field>
<field name="inherit" ref="stock.move_view_form"/>
<field name="name">stock_move_form</field>
</record>
</data>
</tryton>
+1
View File
@@ -13,4 +13,5 @@ extra_depends:
xml:
account.xml
product.xml
stock.xml
message.xml
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="//field[@name='cost_price']" position="after">
<label name="unit_landed_cost"/>
<field name="unit_landed_cost"/>
</xpath>
</data>