Skip to Content
Menu
This question has been flagged
1 Reply
4729 Views
I add multiple PRODUCTS in the order lines of the REPAIR-ORDER, the price of each product shows up - but the untaxed sub total and total display (0) instead of the total of all products.

[![TOTAL AMOUNT][1]][1]

[![UNTAXED AMOUNT][2]][2]


Avatar
Discard
Author Best Answer

I found that without the code below (this code causes MRP_REPAIR to add order lines both to the REPAIR ORDER and SALES ORDER), adding a product with a price doesnt get calculated in total field, and shows zero (0)

            
elif this.repair_sale_order_line_id:
                sale_obj = self.pool.get('sale.order')
                so_vals = {
                    'partner_id' : this.repair_sale_order_line_id.partner_id.id,
                    'fleet_id': this.repair_sale_order_line_id.fleet_id.id,
                    'responsable_id': uid,
                }
                created_so_id = so_obj.create(cr, uid, so_vals, context=context)
                sol_vals = {'order_id': created_so_id,
                           'price_unit': this.price_unit,
                           'product_uom_qty': this.product_uom_qty,
                           'price_subtotal': this.price_subtotal,
                           'discount': this.discount,
                           'product_id': this.product_id.id,
                           'tax_id': [(6, 0, [x.id for x
                                                     in this.tax_id])],
                           'name': this.name,
                           }
                self.pool.get('mrp.repair').write(cr, uid, this.repair_sale_order_line_id.id, {'sale_id':created_so_id},context=context)
                sol_id = sol_obj.create_sol(cr, uid, sol_vals, context)
                super(repair_sale_order_line, self).write(cr, uid, [res],{'sale_order_line_id':sol_id})

it seems that the Sale Order lines are used instead of the internal Repair Sale Order lines. The question is: how can i make the mrp not depend on the SO or its ORDER LINES.?

Avatar
Discard
Related Posts Replies Views Activity
0
May 21
4888
2
May 21
3672
0
Oct 21
1734
1
Aug 23
12547
1
Aug 23
11050