How to make Inter-Company transfer with LOT numbers?

Enes Canıdemir

Dear all,

I am using Odoo V13.0+e (Enterprise Edition)

In stock module;

I want to transfer my products from Company A to Company B with the Lot/Serial Numbers.

To transfer my products i am using "Virtual Locations / Inter Company Transit" location.

To do that;

Firstly i am transferring my products from Company A / Stock to this Virtual Inter Company Transit location.
And using a custom Route (Push To);

"When products arrive in Virtual Locations/Inter Company Transit, Receipts are created to send them in Company B/Input"

I can easily transfer any products to Company B input location.

But if a product has a lot or serial number then the problem occurs.

The Error is:

Something went wrong!
Some records are incompatible with the company of the Product Moves (Stock Move Line).
Fields: lot_id
Record ids: 913

I think, the problem is, when you create a lot/serial number for a product, you need to select the company. So the lot number is assigned to that company. When i want to transfer this product to a different company, its automatically not recognised because of the lot/serial number. So i need to re-input (create) all the lot numbers when i am receiving these products. 

Is there a way to make this transfer without manually creating the lot numbers?

Thanks in advance.

1 Odpoveď
Ray Carnes (ray)
Best Answer

I ended up creating a Server Action to use the name of the reserved Lot and move it to the Lot Name field so that the Receipt would create the Lot in the second Company:

Note:  I did this in a demo, not an implementation, so didn't check how well this approach would work in a production system or it if works well for all Use Cases.  "Show Detailed Operations" was checked ON for the Operation Type during this demo.

for line in record.move_line_ids_without_package:
  if line.lot_id:
    line['lot_name'] = line.lot_id.sudo().name
    line['lot_id'] = False
    line['qty_done'] = line.product_uom_qty
  line['qty_done'] = line.product_uom_qty