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

I am working on an Odoo 16 module and I'm facing an issue with context passing when creating a new contact from my module. Specifically, I have three custom fields that should only be visible when a certain context is present, but they are not showing up as expected.

When I start writing in the contact_id field and click "create and edit", the context should be passed so that I can fill out the additional fields in res.partner, but it doesn't work. However, when I click on a contact that already exists, the context is being passed correctly and the fields are visible.

res_partner.py: 

from odoo import models, fields, api

class ResPartner(models.Model):
    _inherit = 'res.partner'

    age = fields.Integer(string="Age", tracking=True)
    sex = fields.Selection([
        ('male', 'Male'),
        ('female', 'Female'),
        ('other', 'Other')
    ], string="Sex", tracking=True)
    occupational_group = fields.Selection([
        ('white_collar', 'White Collar'),
        ('blue_collar', 'Blue Collar'),
        ('other', 'Other')
    ], string="Occupational Group", tracking=True)
    show_claim_fields = fields.Boolean(string="Show Claim Fields", compute="_compute_show_claim_fields")


res_partner_views.xml: 

res.partner.form.inherited res.partner



claim_details_views.xml: 

Add claim ir.actions.act_window claim.details form new {'default_policy_number': policy_number} Create Contact res.partner form new {'default_from_claims': True} claim.details.view.form claim.details




Any ideas how to fix it? Any help would be greatly appreciated!I

아바타
취소

Please post your xml view under code code snippet. Your question is unclear.

베스트 답변

Your question is not clear can you explain elaborate.


아바타
취소
관련 게시물 답글 화면 활동
4
7월 25
1572
1
7월 25
824
1
4월 25
871
0
3월 25
828
0
8월 24
1231