Skip to Content
Menu
This question has been flagged
1 Reply
2101 Views

The way that my company orders and receives goods requires extra information on the Vendor Bill Lines to validate payment to our Vendors.

Often, when I order items, I will receive them over many months.  I am Billed monthly for what I received.

This means that if I order 100 Chairs, I could receive 10 in the first week of January, 25 in the second week of January, none in the third week of January and 20 in the last week of January.

Then, I get a Bill with three lines at the end of January:

10 Chairs shipped on Manifest 12345

25 Chairs shipped on Manifest 54321

20 Chairs shipped on Manifest 66666

The Vendor Bill in Odoo will look like this:

55 Chairs.

On this line, I would like to see the THREE Receipt Transfers (and the Quantities from each if possible) for the 55 Chairs I received, so I can match the Manifest Numbers on my Vendor Bill.

I am storing the Manifest Number in the Tracking Reference field on the Receipt Transfer (stock.picking)

Avatar
Discard
Best Answer

I was able to get this working via UI customizations, you may want to do this in a module:

I needed to create a custom field x_type which allowed me to only do this for Vendor Bills, then another custom field x_picking_ref to store the Manifest and Quantity.  x_picking_ref is dependent on purchase_line_id.  If you supply the Manifest it will show it, otherwise it will show the Receipt name:

My code:

for record in self:

     if record.x_type == 'in_invoice':

         x_picking_ref = ''

         for move in record.purchase_line_id.move_ids:

             if move.state == 'done':

                 if move.picking_id.carrier_tracking_ref:

                     x_picking_ref += move.picking_id.carrier_tracking_ref

                 else:

                     x_picking_ref += move.picking_id.name

                 x_picking_ref += " (" + str(move.product_uom_qty) + ")"

                 x_picking_ref += "\n"

         record['x_picking_ref'] = x_picking_ref[:-1]

Result:


Avatar
Discard

just wow,,thumbs up