Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
1800 Zobrazení

I create custom module ....... it contain field from res.company module

when i update this field in my module it did not update in res.company module 

How can i update this field from my module

Avatar
Zrušit
Nejlepší odpověď

Hi,

Not sure of what you are looking to do. Do you need to add any new field into res.company model ? If yes, you can inherit the model and view, and add the new field into it.

If you need a field from company model in your model, as a related field, you can check the related field concept in odoo.

Related Field: How To Add Related Fields In Odoo

Add New Fields: https://www.youtube.com/watch?v=46yecsKX2tw

If this is not what you are looking for, please provide more details

Thanks

Avatar
Zrušit
Nejlepší odpověď

1- You have to put base in your manifest depends :

'depends': [
'base',
],

2- then you need to inherit res.company model

_inherit = "res.company"

target_field = yourfield data type or any new field 


3- if the field is already exist you don't need to xpath it if you need to add new field in company screen you have to inherited and x path your new field after or before


4- Upgrade your module.


hope this will help you 



Avatar
Zrušit
Autor

i do not want to xpath re.company view I want to use field in my module view