コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2312 ビュー

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

アバター
破棄
関連投稿 返信 ビュー 活動
0
7月 20
4380
2
12月 15
3947
1
6月 25
751
1
6月 25
790
2
6月 25
1510