Skip to Content
Menu
This question has been flagged
2 Replies
2101 Views

Hello All,


I am looking for tips on how to replicate the VAT/EIN/TaxID field behavior for other fields I have created on res.partner model with Studio.


When a partner has Children, the VAT can only be entered on the Parent Contact, and then the VAT cascades down and is shown on all the Children.


I have a need for the same behavior on customer partner fields I have created with Studio.


The same cascade behavior is observed on the "Company ID" field on a partner, however that field goes invisible on children instead of readonly but still visible.

Avatar
Discard
Best Answer

Hi,

To replicate the behavior of the VAT field on a new field created via Studio, you'll need to implement a compute function for your field while ensuring that it has the correct field dependencies.

The VAT field in Odoo typically utilizes a widget called 'field_partner_autocomplete' and may involve a separate module that extends the 'res.partner' model, often named 'partner_autocomplete'. These files can be referenced within the Odoo addons directory to understand better how the VAT functionality is implemented and integrated into the system. Studying these files can provide valuable insights into replicating similar behavior for your custom field.


Hope it helps

Avatar
Discard
Best Answer

I think you will need to add code for that. Try to replicate the behavior using compute fields in Odoo Studio when you add a field and click on `More` you would be able to put the code for the compute field, fields dependencies and everything referring to the others fields in the model or through relationship fields

Avatar
Discard
Author

Hello Axel. Yes I think this is where it needs to happen. The question I guess if if the compute code entered there will be enough to fire from onchange events for that field. For instance I know EIN field has some other onchange code written on the base module itself for res_partner.py file.

If anyone can point us in the right direction for code to test would be greatly appreciated.

Using the proper fields dependencies the answer is should be enough

Related Posts Replies Views Activity
1
Feb 25
975
1
Oct 23
1461
1
Mar 23
4574
2
Nov 20
3291
2
Nov 20
7931