I configured an invoice to print the total kilograms of a product I'm selling, but when I configure the model to show the total weight (product_id.weight * qty_done) it works fine, except on back orders, if for some reason I have less stock of a product than what my client wants to buy, I can create a back order and it will reserve the ammount of the product I have on stock, this way, when I print the invoice, it shows the corresponding weight of the products I will be giving to the client, but if I edit the quantity done (for example my client wants 60 of "X" product, I have 30 on stock, but I choose to only deliver 15 in this back order), when I print the invoice it shows the full weight of the quantity of the product I have on stock (30) rather than what I specified (15).
my model to calculate the total weight is as follows:
for record in self:
record[("x_totalweight")] = record.product_id.weight * record.qty_done
any help will be appreciated