I am not able to post links in the description, it creates a mess with lots of ///I posted the question in the comments section, there it is readable.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hello,
Can you please try this code in sale.order object:
@api.onchange('partner_invoice_id')
def onchange_partner_invoice_id(self):
if self.partner_id:
invoice_partner_ids = self.env['res.partner'].search([('id', 'child_of', self.partner_id.id)])
return {'domain': {'partner_invoice_id': [('type', '=', 'invoice'), ('id', 'in', invoice_partner_ids.ids)]}}
@api.onchange('partner_shipping_id')
def onchange_partner_shipping_id(self):
if self.partner_id:
delivery_partner_ids = self.env['res.partner'].search([('id', 'child_of', self.partner_id.id)])
return {'domain': {'partner_shipping_id': [('type', '=', 'delivery'), ('id', 'in', delivery_partner_ids.ids)]}}
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
5
thg 4 24
|
19816 | ||
|
2
thg 10 23
|
2716 | ||
|
0
thg 1 20
|
4528 | ||
|
1
thg 8 25
|
347 | ||
|
1
thg 7 25
|
1144 |
omg, how can I post links in this forum without creating this mess?
Sales order automatically selects contacts for invoice and delivery (but these contacts are set up as contacts only)
How can I avoid this?
See screenshot examples
I select the first entry showing up when creating a sales order: https://photos.app.goo.gl/VryAvHUuCDx613ms7
And it automatically preselects a contact for shipping and billing: https://photos.app.goo.gl/o6W5npc8TAFD3KHJ9
This contact is neither set up as shipping nor as billing contact: https://photos.app.goo.gl/mMcV7MHQsMSDUcH76 and
I believe it has to do with imported contacts. It happens with those. We imported some company contacts, and added further contacts manually. With those this is happening. If omeone can help me with that it would be greatly appreciated