Coffee lines

This commit is contained in:
2026-07-15 17:03:07 +02:00
parent 59171ec07b
commit cb35de91ba
3 changed files with 66 additions and 0 deletions

View File

@@ -1110,6 +1110,16 @@ class CoffeeLineMixin:
coffee_defect_max = fields.Integer('Defects max')
coffee_cup_score_min = fields.Numeric(
'Cup score min', digits=(5, 2))
coffee_packing_count = fields.Integer('Packages')
coffee_packing_unit_weight = fields.Numeric(
'Package weight', digits=(16, 5))
coffee_packing_weight_unit = fields.Many2One(
'product.uom', 'Package weight unit')
coffee_packing_description = fields.Char('Packing description')
coffee_market_reference = fields.Many2One(
'price.price', 'Market reference')
coffee_market_price = fields.Numeric('Market price', digits=(16, 5))
coffee_market_delta = fields.Numeric('Market delta', digits=(16, 5))
def _coffee_samples(self):
return list(getattr(self, 'coffee_samples', None) or [])

View File

@@ -30,6 +30,7 @@ this repository contains the full copyright notices and license terms. -->
colspan="1" col="4" panel="card" icon="tryton-archive"
xalign="0" yalign="0"
col_widths="min-content,1fr,min-content,1fr">
<field name="active_coffee_compatibility" invisible="1" colspan="4"/>
<label name="quantity_theorical"/>
<field name="quantity_theorical"/>
<label name="quantity"/>
@@ -39,9 +40,36 @@ this repository contains the full copyright notices and license terms. -->
<label name="unit"/>
<field name="unit"/>
</group>
<group id="coffee_packing" string="Packing"
colspan="1" col="4" panel="card" icon="tryton-archive"
xalign="0" yalign="0"
states="{'invisible': ~Eval('active_coffee_compatibility')}"
col_widths="min-content,1fr,min-content,1fr">
<label name="coffee_packing_count"/>
<field name="coffee_packing_count" width="120" xexpand="0" xfill="0"/>
<label name="coffee_packing_unit_weight"/>
<field name="coffee_packing_unit_weight" width="120" xexpand="0" xfill="0"/>
<label name="coffee_packing_weight_unit"/>
<field name="coffee_packing_weight_unit"/>
<label name="coffee_packing_description"/>
<field name="coffee_packing_description"/>
</group>
<group id="coffee_market_price" string="Market price"
colspan="1" col="4" panel="card" icon="tradon-price"
xalign="0" yalign="0"
states="{'invisible': ~Eval('active_coffee_compatibility')}"
col_widths="min-content,1fr,min-content,1fr">
<label name="coffee_market_reference"/>
<field name="coffee_market_reference"/>
<label name="coffee_market_price"/>
<field name="coffee_market_price" width="120" xexpand="0" xfill="0"/>
<label name="coffee_market_delta"/>
<field name="coffee_market_delta" width="120" xexpand="0" xfill="0"/>
</group>
<group id="tolerances" string="Tolerances &amp; Inheritance"
colspan="1" col="4" panel="card" icon="tryton-switch"
xalign="0" yalign="0"
states="{'invisible': Eval('active_coffee_compatibility')}"
col_widths="min-content,1fr,min-content,1fr">
<label name="inherit_tol"/>
<field name="inherit_tol"/>

View File

@@ -27,6 +27,7 @@ this repository contains the full copyright notices and license terms. -->
colspan="1" col="4" panel="card" icon="tryton-archive"
xalign="0" yalign="0"
col_widths="min-content,1fr,min-content,1fr">
<field name="active_coffee_compatibility" invisible="1" colspan="4"/>
<label name="quantity_theorical"/>
<field name="quantity_theorical"/>
<label name="quantity"/>
@@ -36,9 +37,36 @@ this repository contains the full copyright notices and license terms. -->
<label name="unit"/>
<field name="unit"/>
</group>
<group id="coffee_packing" string="Packing"
colspan="1" col="4" panel="card" icon="tryton-archive"
xalign="0" yalign="0"
states="{'invisible': ~Eval('active_coffee_compatibility')}"
col_widths="min-content,1fr,min-content,1fr">
<label name="coffee_packing_count"/>
<field name="coffee_packing_count" width="120" xexpand="0" xfill="0"/>
<label name="coffee_packing_unit_weight"/>
<field name="coffee_packing_unit_weight" width="120" xexpand="0" xfill="0"/>
<label name="coffee_packing_weight_unit"/>
<field name="coffee_packing_weight_unit"/>
<label name="coffee_packing_description"/>
<field name="coffee_packing_description"/>
</group>
<group id="coffee_market_price" string="Market price"
colspan="1" col="4" panel="card" icon="tradon-price"
xalign="0" yalign="0"
states="{'invisible': ~Eval('active_coffee_compatibility')}"
col_widths="min-content,1fr,min-content,1fr">
<label name="coffee_market_reference"/>
<field name="coffee_market_reference"/>
<label name="coffee_market_price"/>
<field name="coffee_market_price" width="120" xexpand="0" xfill="0"/>
<label name="coffee_market_delta"/>
<field name="coffee_market_delta" width="120" xexpand="0" xfill="0"/>
</group>
<group id="tolerances" string="Tolerances &amp; Inheritance"
colspan="1" col="4" panel="card" icon="tryton-switch"
xalign="0" yalign="0"
states="{'invisible': Eval('active_coffee_compatibility')}"
col_widths="min-content,1fr,min-content,1fr">
<label name="inherit_tol"/>
<field name="inherit_tol"/>