Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
overwrite WRITE method and change the value passed through it as UPPERCASE conversion.
from openerp import models, api class Product(models.Model): _inherit = 'product.product' @api.model def create(self, vals): if vals.get('default_code', False): vals['default_code'] = vals.get('default_code', '').upper() return super(Product, self).create(vals) @api.multi def write(self, vals): if vals.get('default_code', False): vals['default_code'] = vals.get('default_code', '').upper() return super(Product, self).write(vals)
To resolve old data, do an one time sql query
update product_product set default_code=UPPER(default_code)
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 4/13/15, 4:44 AM|
|Seen: 1067 times|
|Last updated: 4/15/15, 1:30 AM|