How can I change the default contact type [Contact, Invoice Address, Delivery Address, Other Address, Private Address] when creating new Contacts?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
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
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.
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
AanmeldenGerelateerde posts | Antwoorden | Weergaven | Activiteit | |
---|---|---|---|---|
|
1
mei 25
|
695 | ||
|
1
mrt. 18
|
4251 | ||
|
0
sep. 22
|
1832 | ||
|
2
mrt. 22
|
2930 | ||
|
0
dec. 19
|
1805 |