Community mailing list archives
Re: Accessing Delivery from Invoice Line in v9by
I will examine these and, if suitable, migrate them to v9.
On 16 May 2016, at 11:47, Pedro Manuel Baeza Romero <email@example.com> wrote:Look to migrate these modules that makes this work:Regards.
https://github.com/OCA/account-invoice-reporting/tree/8.0/account_invoice_production_lot2016-05-15 23:38 GMT+02:00 Harry Jollenbeck <firstname.lastname@example.org>:Hi all, I am working on a project which requires showing lot numbers on generated invoices (in the invoice table as an additional column), as chosen in the related delivery order. Now, in v9 as far as I can tell there is no direct relationship between an invoice and a delivery, so my first idea was to transverse through the below relations to retrieve the related lot numbers in a computed field on invoice_line: Invoice_line -> sale_order_line -> (using procurement group) -> stock_move -> stock_pack_operation -> stock_pack_operation_lot But this presents some problems. What if there are multiple deliveries, or more difficult- multiple invoices for a single sales order? My next idea, is to add a lot_id field on sale_order_line and record the lot number here at the time the delivery is completed. I guess this would happen at the same time the qty_deliveried field is updated. Then the lot number could be either accessed in the invoice through the sale_order_line_invoice_rel relationship, or could be stored as an additional field in the invoice_line model when generating the invoice from the sale order. I wonder if any of you clever ones have had to implement something similar before? And what you think of my implementation ideas? Thank you, Harry