Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3562 Lượt xem

in product line lot_id(Many2one) field, qty_available(related) field, i need to get the lot by location, how to get Lot by location can anyone help me how to do.

My Code 

qty_lot_avl = ffelds.Float('QTY LOT', related="lot_id.product_qty")
lot_id = fields.Many2one(
'stock.production.lot', 'Lot/Serial Number',
domain="[('product_id', '=', product_id), ('company_id', '=', company_id)]", check_company=True)




Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

if you insert lot id in quants ? 

or is custom module

Ảnh đại diện
Huỷ bỏ
Tác giả

for Custom Module in product line i need to get lot by location and related qty_lot_avl need to get qty

Tác giả

at present its getting reserved qty also in the product available qty by branch, can you guide me how to do

product_id = fields.Many2one(
string='product',
comodel_name='product.product',
ondelete='restrict',
)

location_id = fields.Many2one(
string='location',
comodel_name='stock.quant',
ondelete='restrict',
domain=[('product_id','=',product_id)]

)
#if you have one lot peer location many2one field,
#if you have more lot peer location many2many field or one2many
lot_ids = fields.Many2one(
string='lot',
comodel_name='stock.production.lot',
ondelete='restrict',
related='location_id.lot_id',
readonly=True,
store=True
)

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 1 22
4343
1
thg 5 20
3331
1
thg 6 23
3183
1
thg 1 23
2967
0
thg 9 22
2678