How can i assign a vendor a certain warehouse to deliver to in odoo 13?
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ờ
Hi Yash,
There is no default option to do the mentioned process. But we can do a modification in both the vendor model and purchase module to set a default warehouse for a vendor.
First, let's inherit the 'res.partner' to add a new field to select the warehouse operation
class DefaultWarehouse(models.Model):
_inherit = 'res.partner'
default_warehouse_id = fields.Many2one('stock.picking.type', string="DefaultWarehouse",domain=[('code', '=', 'incoming')])
Then let's add this in the view
<record id="default_warehouse" model="ir.ui.view">
<field name="name">default.warehouse</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='purchase']" position="inside">
<field name="default_warehouse_id"/>
</xpath>
</field>
</record>
Next, we can inherit the purchase.order model so that when we select a vendor the delivery location will get assigned automatically
class PurchaseOrder(models.Model):
_inherit = 'purchase.order'
@api.onchange('partner_id')
def get_warehouse(self):
if self.partner_id.default_warehouse_id:
self.picking_type_id = self.partner_id.default_warehouse_id
Like this, we can assign a default warehouse for a vendor. Hope this helps. Thank you.
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 | |
---|---|---|---|---|
|
1
thg 6 21
|
2993 | ||
|
1
thg 4 21
|
2078 | ||
|
7
thg 3 24
|
35130 | ||
|
2
thg 9 25
|
296 | ||
|
1
thg 8 25
|
362 |