Make pay button readonly if no lines are added to sale
This commit is contained in:
parent
ab0b73ff95
commit
a5fe0dd36f
3
sale.py
3
sale.py
@ -5,7 +5,7 @@ from decimal import Decimal
|
|||||||
|
|
||||||
from trytond.model import ModelView, fields
|
from trytond.model import ModelView, fields
|
||||||
from trytond.pool import PoolMeta, Pool
|
from trytond.pool import PoolMeta, Pool
|
||||||
from trytond.pyson import Eval
|
from trytond.pyson import Bool, Eval, Not
|
||||||
from trytond.transaction import Transaction
|
from trytond.transaction import Transaction
|
||||||
from trytond.wizard import Wizard, StateView, StateTransition, Button
|
from trytond.wizard import Wizard, StateView, StateTransition, Button
|
||||||
|
|
||||||
@ -28,6 +28,7 @@ class Sale:
|
|||||||
cls._buttons.update({
|
cls._buttons.update({
|
||||||
'wizard_sale_payment': {
|
'wizard_sale_payment': {
|
||||||
'invisible': Eval('state') == 'done',
|
'invisible': Eval('state') == 'done',
|
||||||
|
'readonly': Not(Bool(Eval('lines'))),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user