main #7
@@ -57,10 +57,19 @@ class Fee(ModelSQL,ModelView):
|
|||||||
('perqt', 'Per qt'),
|
('perqt', 'Per qt'),
|
||||||
('pprice', '% price'),
|
('pprice', '% price'),
|
||||||
('pcost', '% cost price'),
|
('pcost', '% cost price'),
|
||||||
|
('ppack', 'Per packing'),
|
||||||
], 'Mode', required=True)
|
], 'Mode', required=True)
|
||||||
|
|
||||||
inherit_qt = fields.Boolean("Inh Qt")
|
inherit_qt = fields.Boolean("Inh Qt")
|
||||||
quantity = fields.Function(fields.Numeric("Qt",digits='unit'),'get_quantity')
|
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={
|
inherit_shipment = fields.Boolean("Inh Sh",states={
|
||||||
'invisible': (Eval('shipment_in')),
|
'invisible': (Eval('shipment_in')),
|
||||||
})
|
})
|
||||||
@@ -81,9 +90,16 @@ class Fee(ModelSQL,ModelView):
|
|||||||
|
|
||||||
weight_type = fields.Selection([
|
weight_type = fields.Selection([
|
||||||
('net', 'Net'),
|
('net', 'Net'),
|
||||||
('brut', 'Brut'),
|
('brut', 'Gross'),
|
||||||
], string='W. type')
|
], 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):
|
def get_lots(self, name):
|
||||||
logger.info("GET_LOTS_LINE:%s",self.line)
|
logger.info("GET_LOTS_LINE:%s",self.line)
|
||||||
logger.info("GET_LOTS_SHIPMENT_IN:%s",self.shipment_in)
|
logger.info("GET_LOTS_SHIPMENT_IN:%s",self.shipment_in)
|
||||||
@@ -155,7 +171,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
def default_p_r(cls):
|
def default_p_r(cls):
|
||||||
return 'pay'
|
return 'pay'
|
||||||
|
|
||||||
def get_unit(self, name):
|
def get_unit(self, name=None):
|
||||||
Lot = Pool().get('lot.lot')
|
Lot = Pool().get('lot.lot')
|
||||||
if self.lots:
|
if self.lots:
|
||||||
if self.lots[0].line:
|
if self.lots[0].line:
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<field name="type"/>
|
<field name="type"/>
|
||||||
<field name="product"/>
|
<field name="product"/>
|
||||||
<field name="supplier"/>
|
<field name="supplier"/>
|
||||||
<field name="currency"/>
|
|
||||||
<field name="p_r"/>
|
|
||||||
<field name="mode"/>
|
<field name="mode"/>
|
||||||
|
<field name="unit"/>
|
||||||
<field name="price"/>
|
<field name="price"/>
|
||||||
|
<field name="currency"/>
|
||||||
<field name="weight_type"/>
|
<field name="weight_type"/>
|
||||||
|
<field name="p_r"/>
|
||||||
<field name="quantity" symbol="unit"/>
|
<field name="quantity" symbol="unit"/>
|
||||||
<field name="amount"/>
|
<field name="amount"/>
|
||||||
<field name="inherit_shipment"/>
|
<field name="inherit_shipment"/>
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<field name="type"/>
|
<field name="type"/>
|
||||||
<field name="product"/>
|
<field name="product"/>
|
||||||
<field name="supplier"/>
|
<field name="supplier"/>
|
||||||
<field name="currency"/>
|
|
||||||
<field name="p_r"/>
|
|
||||||
<field name="mode"/>
|
<field name="mode"/>
|
||||||
|
<field name="unit"/>
|
||||||
<field name="price"/>
|
<field name="price"/>
|
||||||
|
<field name="currency"/>
|
||||||
<field name="weight_type"/>
|
<field name="weight_type"/>
|
||||||
|
<field name="p_r"/>
|
||||||
<field name="quantity" symbol="unit"/>
|
<field name="quantity" symbol="unit"/>
|
||||||
<field name="amount"/>
|
<field name="amount"/>
|
||||||
<!-- <field name="purchase"/> -->
|
<!-- <field name="purchase"/> -->
|
||||||
|
|||||||
Reference in New Issue
Block a user