Targeted Qt

This commit is contained in:
2026-05-17 18:56:23 +02:00
parent 23fbcfa988
commit 149306ff4e
4 changed files with 14 additions and 0 deletions

View File

@@ -1367,6 +1367,8 @@ class Line(metaclass=PoolMeta):
fields.Numeric("Tolerance min"), 'get_tolerance_min')
tolerance_max = fields.Function(
fields.Numeric("Tolerance max"), 'get_tolerance_max')
targeted_qt = fields.Function(
fields.Numeric("Targeted Qt", digits='unit'), 'get_targeted_qt')
# certification = fields.Selection([
# (None, ''),
# ('bci', 'BCI'),
@@ -1574,6 +1576,9 @@ class Line(metaclass=PoolMeta):
return Decimal(str(purchase.tol_max or 0))
return Decimal(str(self.tol_max or 0))
def get_targeted_qt(self, name):
return self._tolerance_actual_quantity()
def get_progress(self,name):
PS = Pool().get('purchase.pricing.summary')
ps = PS.search(['line','=',self.id])

View File

@@ -1349,6 +1349,8 @@ class SaleLine(metaclass=PoolMeta):
fields.Numeric("Tolerance min"), 'get_tolerance_min')
tolerance_max = fields.Function(
fields.Numeric("Tolerance max"), 'get_tolerance_max')
targeted_qt = fields.Function(
fields.Numeric("Targeted Qt", digits='unit'), 'get_targeted_qt')
certif = fields.Many2One('purchase.certification',"Certification",states={'readonly': (Eval('inherit_cer')),})
# certification = fields.Selection([
# (None, ''),
@@ -1564,6 +1566,9 @@ class SaleLine(metaclass=PoolMeta):
return Decimal(str(sale.tol_max or 0))
return Decimal(str(self.tol_max or 0))
def get_targeted_qt(self, name):
return self._tolerance_actual_quantity()
def get_progress(self,name):
PS = Pool().get('sale.pricing.summary')
ps = PS.search(['sale_line','=',self.id])

View File

@@ -48,6 +48,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="tolerance_used" widget="tolerance_gauge"
min_field="tolerance_min" max_field="tolerance_max"
xexpand="1" xfill="1"/>
<label name="targeted_qt"/>
<field name="targeted_qt"/>
<field name="tolerance_min" invisible="1"/>
<field name="tolerance_max" invisible="1"/>
<newline/>

View File

@@ -48,6 +48,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="tolerance_used" widget="tolerance_gauge"
min_field="tolerance_min" max_field="tolerance_max"
xexpand="1" xfill="1"/>
<label name="targeted_qt"/>
<field name="targeted_qt"/>
<field name="tolerance_min" invisible="1"/>
<field name="tolerance_max" invisible="1"/>
<newline/>