I want to set issue warehouse on the sales documents on product lines level not globally on transaction level, how to do it? additionally, in case I don't want to start the sales process from Quotation and start it from Customer Invoice directly why I'm not able to set the warehouse at the invoice level?
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,
Please refer to the code:
from odoo import fields, models, api
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
warehouse_id = fields.Many2one(
'stock.warehouse',
string='Warehouse',
help='Warehouse to issue this product from. Overrides the order warehouse if set.'
)
@api.onchange('warehouse_id')
def _onchange_warehouse_id(self):
if self.warehouse_id:
self.warehouse_id = self.warehouse_id
def _prepare_procurement_values(self, group_id=False):
"""Override to inject custom warehouse in procurement."""
vals = super()._prepare_procurement_values(group_id)
if self.warehouse_id:
vals['warehouse_id'] = self.warehouse_id
vals['location_id'] = self.warehouse_id.lot_stock_id.id
return vals
Each sale line can define its own warehouse.
When confirming the order, Odoo will generate separate deliveries per warehouse (automatically handled via procurement groups).
Hope it helps.
Hello Kenan,
Odoo also provides warehouse configuration at the Sales Order Line level. You just need to confirm which warehouse is being used when the delivery order is created.
and you can't set the warehouse at the invoice level because the warehouse operations already done in backend, so it’s no longer relevant to the Accounting layer.
Hope it information helps, Thanks.
can you elaborate more please , as I didn't get anything
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 | |
---|---|---|---|---|
|
3
thg 10 25
|
353 | ||
|
4
thg 9 25
|
1257 | ||
|
2
thg 8 25
|
870 | ||
|
1
thg 8 25
|
580 | ||
|
1
thg 8 25
|
928 |
Please tell me where you want to more clarification.. Warehouse at Invoice level and warehouse id on sale order line?