issue3209.diff # [production] Not validate cost inputs and outputs

#043523
This commit is contained in:
Raimon Esteve 2021-04-07 16:37:52 +02:00
parent 2b0780e142
commit 0ef4e7e1d9
2 changed files with 37 additions and 0 deletions

35
issue3209.diff Normal file
View File

@ -0,0 +1,35 @@
diff --git a/trytond/trytond/modules/production/production.py b/trytond/trytond/modules/production/production.py
index acd7a35..1ccc421 100644
--- a/trytond/trytond/modules/production/production.py
+++ b/trytond/trytond/modules/production/production.py
@@ -468,12 +468,6 @@ class Production(Workflow, ModelSQL, ModelView):
moves.append(output)
Move.save(moves)
- @classmethod
- def validate(cls, productions):
- super(Production, cls).validate(productions)
- for production in productions:
- production.check_cost()
-
@property
def output_cost(self):
cost_price = Decimal(0)
@@ -481,17 +475,6 @@ class Production(Workflow, ModelSQL, ModelView):
cost_price += (Decimal(str(output.quantity)) * output.unit_price)
return cost_price
- def check_cost(self):
- if self.state != 'done':
- return
- cost_price = self.output_cost
- if not self.company.currency.is_zero(self.cost - cost_price):
- raise CostError(gettext(
- 'production.msg_uneven_costs',
- production=self.rec_name,
- costs=self.cost,
- outputs=cost_price))
-
@classmethod
def view_attributes(cls):
return [

2
series
View File

@ -70,3 +70,5 @@ project_invoice_progress_compute_qty.diff # [project_invoice] Twice compute qty
issue10068.diff # [trytond] Use safe_join in SharedDataMiddlewareIndex
issue10053.diff # [party] Configure available identifiers
issue3209.diff # [production] Not validate cost inputs and outputs 043523 (not merge to 6.x)