I want to make the creator of the contact as salesperson automatically as they normally forgot to add. It is required field now but normally the creator just choose any user id.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
Hi Aklili Lamudok,
For this, you can add code like this in create method of 'Contact' model.
Please find code in comment.
Feel free to contact us for further assistance
Hope this answer helps you.
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
Please find code example here :-
EX:
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.model
def create(self, values):
# If the user_id is not provided, set it to the creator's user_id
if 'user_id' not in values:
values['user_id'] = self.env.uid
return super(ResPartner, self).create(values)
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
3
sie 25
|
2599 | ||
|
1
maj 25
|
2634 | ||
|
1
kwi 25
|
3623 | ||
|
1
kwi 25
|
4488 | ||
|
1
kwi 25
|
1954 |