changeset eb34f67adbfb in modules/purchase_shipment_cost:default details: https://hg.tryton.org/modules/purchase_shipment_cost?cmd=changeset&node=eb34f67adbfb description: Add more information on stock move form
issue11768 review439591003 diffstat: stock.py | 8 ++++++-- stock.xml | 6 ++++++ view/stock_move_form.xml | 9 +++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diffs (54 lines): diff -r 237134aa7ad7 -r eb34f67adbfb stock.py --- a/stock.py Thu Sep 29 09:08:06 2022 +0200 +++ b/stock.py Sun Oct 09 19:07:16 2022 +0200 @@ -7,6 +7,7 @@ from trytond.modules.product import price_digits, round_price from trytond.modules.stock_shipment_cost import ShipmentCostMixin from trytond.pool import Pool, PoolMeta +from trytond.pyson import Eval class ShipmentIn(ShipmentCostMixin, metaclass=PoolMeta): @@ -110,8 +111,11 @@ class Move(metaclass=PoolMeta): __name__ = 'stock.move' - unit_shipment_cost = fields.Numeric('Unit Shipment Cost', - digits=price_digits, readonly=True) + unit_shipment_cost = fields.Numeric( + "Unit Shipment Cost", digits=price_digits, readonly=True, + states={ + 'invisible': ~Eval('unit_shipment_cost'), + }) def _compute_unit_price(self, unit_price): if self.unit_shipment_cost: diff -r 237134aa7ad7 -r eb34f67adbfb stock.xml --- a/stock.xml Thu Sep 29 09:08:06 2022 +0200 +++ b/stock.xml Sun Oct 09 19:07:16 2022 +0200 @@ -3,6 +3,12 @@ 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> + <record model="ir.ui.view" id="shipment_in_view_form"> <field name="model">stock.shipment.in</field> <field name="type" eval="None"/> diff -r 237134aa7ad7 -r eb34f67adbfb view/stock_move_form.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/view/stock_move_form.xml Sun Oct 09 19:07:16 2022 +0200 @@ -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='shipment_out_cost_price']" position="after"> + <label name="unit_shipment_cost"/> + <field name="unit_shipment_cost"/> + </xpath> +</data>