Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2399 Widoki

I have created a wizard and I am trying to automatically fill in the form below. For some reason, I am facing an issue with the “location_id”. Even though I am passing a value, I continue to have a problem (Validation Error).


Error:



Code:

stock_picking.create({
​'picking_type_id': self.env['stock.picking.type'].search([('name', '=', 'Warehouse Deliveries')]).id,
​'location_dest_id': self.from_location.id,
'location_id':  self.from_location.id,
​'move_ids_without_package': [Command.create({
​'product_id': product.id,
​'product_uom_qty': product.qty_wizard,
​'name': product.name,
​}) for product in self.product_ids],
})
Awatar
Odrzuć
Autor Najlepsza odpowiedź

Solution:

        stock_picking.create({
​'location_dest_id': self.env['stock.location'].search([('name', '=', 'Warehouse Transfers')]).id,
'location_id': self.from_location.id,
​'picking_type_id': self.env['stock.picking.type'].search([('name', '=', 'Warehouse Deliveries')]).id,
​'move_ids_without_package': [Command.create({
​'product_id': product.id,
​'name': product.name,
​'quantity_done': product.qty_wizard,
​'location_id': self.from_location.id,
​'location_dest_id': self.env['stock.location'].search([('name', '=', 'Warehouse Transfers')]).id,
​}) for product in self.product_ids],
​})
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
gru 22
2914
3
paź 19
4601
1
gru 24
4091
0
lis 24
1673
2
lip 24
3425