Make pay button readonly if no lines are added to sale

This commit is contained in:
jmartin 2014-07-09 10:52:33 +02:00
parent ab0b73ff95
commit a5fe0dd36f

View File

@ -5,7 +5,7 @@ from decimal import Decimal
from trytond.model import ModelView, fields
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.wizard import Wizard, StateView, StateTransition, Button
@ -28,6 +28,7 @@ class Sale:
cls._buttons.update({
'wizard_sale_payment': {
'invisible': Eval('state') == 'done',
'readonly': Not(Bool(Eval('lines'))),
},
})