When we create an invoice in the accounting app, we select a contact as customer. But, when we go to Other Info, the salesperson is the user that create the invoice, not the one associated to the contact. Is there a way to configure it to take the salesperson associated to the contact as default value?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
1
回复
976
查看
Hi,
Please refer to the code:
from odoo import models, api
class AccountMove(models.Model):
_inherit = 'account.move'
@api.onchange('partner_id')
def _onchange_partner_id_set_salesperson(self):
if self.partner_id and self.partner_id.user_id:
self.user_id = self.partner_id.user_id
Hope it helps.
相关帖文 | 回复 | 查看 | 活动 | |
---|---|---|---|---|
|
0
9月 25
|
215 | ||
|
1
9月 25
|
924 | ||
|
3
9月 25
|
256 | ||
|
1
9月 25
|
257 | ||
|
3
9月 25
|
1416 |