mirror of
https://github.com/NaN-tic/trytond-farm_feed_production.git
synced 2023-12-14 05:52:53 +01:00
Use lot field of prescription instead of feed_lot
This commit is contained in:
parent
790c4bf024
commit
f364ce3133
|
@ -268,7 +268,7 @@ class Production:
|
||||||
if getattr(main_output, 'lot', False) and reservation.prescription:
|
if getattr(main_output, 'lot', False) and reservation.prescription:
|
||||||
with Transaction().set_user(0, set_context=True):
|
with Transaction().set_user(0, set_context=True):
|
||||||
prescription = Prescription(reservation.prescription.id)
|
prescription = Prescription(reservation.prescription.id)
|
||||||
prescription.feed_lot = main_output.lot
|
prescription.lot = main_output.lot
|
||||||
prescription.save()
|
prescription.save()
|
||||||
return super(Production, self)._assign_reservation(main_output)
|
return super(Production, self)._assign_reservation(main_output)
|
||||||
|
|
||||||
|
@ -348,8 +348,7 @@ class Prescription:
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
super(Prescription, cls).__setup__()
|
super(Prescription, cls).__setup__()
|
||||||
for fname in ('farm', 'delivery_date', 'product', 'feed_lot',
|
for fname in ('farm', 'delivery_date', 'product', 'lot', 'quantity'):
|
||||||
'quantity'):
|
|
||||||
field = getattr(cls, fname)
|
field = getattr(cls, fname)
|
||||||
field.states['readonly'] = Or(field.states['readonly'],
|
field.states['readonly'] = Or(field.states['readonly'],
|
||||||
Bool(Eval('origin_production')))
|
Bool(Eval('origin_production')))
|
||||||
|
|
Loading…
Reference in a new issue