It works for me, but I hope someone else knows a cleaner way.
You can inherit the core module class in your custom module, and then simply declare a new field with the same name that you want to change. Essentially, just copy the field declaration from the main module, paste it into your custom module, and then make the necessary changes. For example, our product_notes module expanded the Rack, Row, and Case fields to 255 from the product module .
_columns = {'loc_rack': fields.char('Rack', size=255), 'loc_row': fields.char('Row', size=255), 'loc_case': fields.char('Case', size=255)}
The reason I don't like it is because you now have duplication for all other field attributes. If you change the length of the field and then the main module changes the help text, you will still have the old help text. I was hoping there would be some way when the modules load and adjust your parent's field attributes, but I could not find the hooks at the right time.
One change you can make easier is the default value for the field. Just declare a default value for the core module field in your custom module and it will replace the original default value. For example, we changed the default values ββfor sale_delay and produce_delay from the product module .
_defaults = {'sale_delay': lambda *a: 5, 'produce_delay': lambda *a: 0}
source share