This commit is contained in:
2026-02-04 15:00:37 +01:00
parent eef972c679
commit 1ebbb874ef
3 changed files with 25 additions and 7 deletions

View File

@@ -57,10 +57,19 @@ class Fee(ModelSQL,ModelView):
('perqt', 'Per qt'),
('pprice', '% price'),
('pcost', '% cost price'),
('ppack', 'Per packing'),
], 'Mode', required=True)
inherit_qt = fields.Boolean("Inh Qt")
quantity = fields.Function(fields.Numeric("Qt",digits='unit'),'get_quantity')
unit = fields.Function(fields.Many2One('product.uom',"Unit"),'get_unit')
unit = fields.Many2One('product.uom',"Unit",domain=[
If(Eval('mode') == 'ppack',
('category', '=', 8),
()),
],
states={
'readonly': Eval('mode') != 'ppack',
})
inherit_shipment = fields.Boolean("Inh Sh",states={
'invisible': (Eval('shipment_in')),
})
@@ -81,9 +90,16 @@ class Fee(ModelSQL,ModelView):
weight_type = fields.Selection([
('net', 'Net'),
('brut', 'Brut'),
('brut', 'Gross'),
], string='W. type')
@fields.depends('mode')
def on_change_with_unit(self, name=None):
if self.mode != 'ppack':
return self.get_unit()
else:
return self.unit
def get_lots(self, name):
logger.info("GET_LOTS_LINE:%s",self.line)
logger.info("GET_LOTS_SHIPMENT_IN:%s",self.shipment_in)
@@ -155,7 +171,7 @@ class Fee(ModelSQL,ModelView):
def default_p_r(cls):
return 'pay'
def get_unit(self, name):
def get_unit(self, name=None):
Lot = Pool().get('lot.lot')
if self.lots:
if self.lots[0].line:

View File

@@ -5,11 +5,12 @@ this repository contains the full copyright notices and license terms. -->
<field name="type"/>
<field name="product"/>
<field name="supplier"/>
<field name="currency"/>
<field name="p_r"/>
<field name="mode"/>
<field name="unit"/>
<field name="price"/>
<field name="currency"/>
<field name="weight_type"/>
<field name="p_r"/>
<field name="quantity" symbol="unit"/>
<field name="amount"/>
<field name="inherit_shipment"/>

View File

@@ -5,11 +5,12 @@ this repository contains the full copyright notices and license terms. -->
<field name="type"/>
<field name="product"/>
<field name="supplier"/>
<field name="currency"/>
<field name="p_r"/>
<field name="mode"/>
<field name="unit"/>
<field name="price"/>
<field name="currency"/>
<field name="weight_type"/>
<field name="p_r"/>
<field name="quantity" symbol="unit"/>
<field name="amount"/>
<!-- <field name="purchase"/> -->