콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
2309 화면

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.

아바타
취소
베스트 답변

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

아바타
취소
베스트 답변

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

아바타
취소
작성자

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

관련 게시물 답글 화면 활동
1
2월 25
1068
1
10월 23
1657
1
3월 23
4885
Editing Fields 해결 완료
2
11월 20
3461
Editing Fields 해결 완료
2
11월 20
8158