How to save the reference of every product as uppercase (when click on the "save" button)
please some help in both xml code and python code !
thank you
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How to save the reference of every product as uppercase (when click on the "save" button)
please some help in both xml code and python code !
thank you
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)
update product_product set default_code=UPPER(default_code)
Please, inside which class (product.product or product.template) should i insert the method ?
Product.Product
Product.Product
--
Atchuthan - Technical Consultant, Sodexis Inc
Sent by Odoo Inc. using Odoo access your messages
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
Registrieren