Odoo Help

2

0
1 Answer
2
Avatar
--Qutechs, Ahmed M.Elmubarak--


Qutechs, Ahmed M.Elmubarak Sudan
3/31/16, 8:19 AM

Hello,

You can call the on_change methods in the order.line model to get the line update with calculations ...

let's try:

    @api.multi
def add_to_offer(self):
line_env = self.env['sale.order.line']
for wizard in self:
for what in wizard.entries:
new_line = line_env.create({
                            'product_id': what.product_id.id,
                            'name': what.product_id.name,
                            'order_id': what.sale_order_id.id,
                            'product_uom' : what.product_id.uom_id.id})
new_line.product_id_change() #Calling an onchange method to update the record


Then you'll get the Sale order update by the new values ..

Hope this could helps

Ask a Question
Writer
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.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now