mirror of
https://github.com/NaN-tic/trytond-agronomics.git
synced 2023-12-14 05:33:01 +01:00
Modify weighing form, Reset weight and tara in forced analysis copy
This commit is contained in:
parent
e1381615c8
commit
58b900e5d0
2 changed files with 7 additions and 2 deletions
|
@ -34,11 +34,13 @@
|
|||
<page name="plantations">
|
||||
<field name="plantations" colspan="4"/>
|
||||
<field name="denomination_origin" colspan="4"/>
|
||||
<field name="parcels" colspan="4"/>
|
||||
</page>
|
||||
<page name="beneficiaries">
|
||||
<field name="beneficiaries" colspan="4"/>
|
||||
</page>
|
||||
<page string="Parcel Distribution" id="parcel_distribution" >
|
||||
<field name="parcels" colspan="4"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<label name="state"/>
|
||||
<field name="state"/>
|
||||
|
|
|
@ -367,10 +367,13 @@ class Weighing(Workflow, ModelSQL, ModelView):
|
|||
def force_analysis(cls, weighings):
|
||||
to_copy_values = {}
|
||||
for weighing in weighings:
|
||||
to_copy_values[weighing.id] = {'netweight': weighing.not_assigned_weight}
|
||||
to_copy_values[weighing.id] = {
|
||||
'netweight': weighing.not_assigned_weight}
|
||||
cls.copy(weighings, default={
|
||||
'netweight': lambda d: (
|
||||
to_copy_values[d['id']]['netweight']),
|
||||
'weight': None,
|
||||
'tara': None,
|
||||
})
|
||||
for weighing in weighings:
|
||||
weighing.forced_analysis = True
|
||||
|
|
Loading…
Reference in a new issue