python - Readonly field is not saving in database in openerp? -
I am using Python and XML to create an OpenerPid module. I have created a module with many fields, all the fields are read-only fields except the customer ID field, when I fill in the customer ID in the customer area, the other fields are filled automatically. But this customer ID field is all in the database The field values do not save.
This will save when all fields are not readable only, it will not save when all fields are read only
What do I need
- When I enter the customer ID, other fields should be filled automatically.
- All fields except the Customer ID field should be read-only.
- All prices must be saved in the database, when click on Save. Can anyone tell me? What should I do?
Thank you in advance
You state 'varaible' and especially 'state' For readonly = true, make their required variables. And to change the state to build or write your class.
Example: Use your variable instead of client_id in the following code
class archive_details (osv.osv)): _name = "collection.details" _description = "archive Details "('[' 'draft', 'draft sales order'], ('done', 'done'),], 'status', readonly = true, invisible = true, Track_visibility = 'onchange', help = "", select = true), 'client_id': fields.char ('client id', size = 64, read only = true, states = {'draft': [ ('Read only', false)]}}}} _defaults = {'state': 'draft',}
Hope this will help you
Comments
Post a Comment