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

How can I change the default contact type [Contact, Invoice Address, Delivery Address, Other Address, Private Address] when creating new Contacts?

아바타
취소
베스트 답변

If the contacts are created via the contact module?

Then it should work via the "Context Value" in the action.

f.e.: {'default_is_company': False, 'default_type': 'other'}

아바타
취소
작성자

It's not via the contact module, when the customer registers himself, I can't change the address type.

베스트 답변

Hello Fojja Bilel,

You can use default_get method below is one of the example of the default_get method you can overwrite it based on your need and use it.

    @api.model
    def default_get(self, fields):
        vals = super(AccountBankStmtCashWizard, self).default_get(fields)
        balance = self.env.context.get('balance')
        statement_id = self.env.context.get('statement_id')
        if statement_id:
            vals['start_bank_stmt_ids'] = statement_id.id
        return vals


Hope it will work for you.
Thanks

아바타
취소
관련 게시물 답글 화면 활동
1
5월 25
1011
1
3월 18
4514
0
9월 22
2002
2
3월 22
3090
0
12월 19
1805