I'm trying to change the default value of some property fields such as: 'cost_method', 'product_type' and 'valuation' of the 'product' module but I can only change the non-property fields only.
What I tried: - I created a new module and inherited the 'product.template' model and overridden the '_default' dictionary only but it didn't work.
- I created new fields with the same name but of another type (selection) not property but neither did this work.
The code:
_name = "product.template"
_inherit = "product.template"
_columns = {
'cost_method': fields.selection([('average', 'Average Price'),('standard', 'Standard Price'), ('real', 'Real Price')]) ,'type': fields.selection([('product', 'Stockable Product'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Consumable are product where you don't manage stock, a service is a non-material product provided by a company or an individual.") ,'company_id': fields.many2one('res.company', 'Company', required=False) }
_defaults = {
'company_id': False
,'type' : 'product'
, 'cost_method': 'average'
, 'barcode':'555'
}