fix: Se hace visible button closed
This commit is contained in:
parent
d69283f90e
commit
6a8ebf7215
@ -111,7 +111,7 @@ class Contract(Workflow, ModelSQL, ModelView):
|
||||
cls._buttons.update({
|
||||
'draft': {'invisible': Eval('state').in_(['draft','closed'])},
|
||||
'running': {'invisible': Eval('state').in_(['cancelled', 'running'])},
|
||||
'closed': {'invisible': True},
|
||||
'closed': {'invisible': Eval('state').in_(['draft','cancelled'])},
|
||||
'cancelled': {'invisible': Eval('state').in_(['draft', 'cancelled'])}
|
||||
})
|
||||
|
||||
@ -168,7 +168,7 @@ class Contract(Workflow, ModelSQL, ModelView):
|
||||
@Workflow.transition('closed')
|
||||
def closed(cls, contracts):
|
||||
contract = contracts[0]
|
||||
for equipment in contract.equipments:
|
||||
for equipment in contract.current_equipments:
|
||||
equipment.state = "uncontrated"
|
||||
equipment.save()
|
||||
|
||||
|
@ -42,9 +42,10 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<newline/>
|
||||
<label name="state"/>
|
||||
<field name="state"/>
|
||||
<group col="2" colspan="2" id="button">
|
||||
<group col="6" id="button">
|
||||
<button name="draft"/>
|
||||
<button name="cancelled"/>
|
||||
<button name="closed"/>
|
||||
<button name="cancelled"/>
|
||||
<button name="running"/>
|
||||
</group>
|
||||
</form>
|
||||
|
Loading…
Reference in New Issue
Block a user