Skip to content

Instantly share code, notes, and snippets.

@danypr92
Created May 3, 2018 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danypr92/9e545a0fadc58a670f1d0bee4467d70e to your computer and use it in GitHub Desktop.
Save danypr92/9e545a0fadc58a670f1d0bee4467d70e to your computer and use it in GitHub Desktop.
States required
class Contract:
"""
This overwrite of class Contract extend functionality of Contract
vanilla model.
Add the necessary functions to represent a ISP Contract.
"""
__metaclass__ = PoolMeta
__name__ = 'contract'
equipment_received = fields.Boolean('Equipment Received', states={
'required': Eval('state') in ['activation_scheduled', 'introduced']
})
@danypr92
Copy link
Author

danypr92 commented May 3, 2018

Debes utilizar el operador in de PYSON y no el estandard de python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment