Odoo Help


1 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.?

Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now