Odoo Help

0
1 Answer
0
Avatar

subbarao

--subbarao--

1108
| 5 1 5
Chennai, India
--subbarao--


subbarao
3/14/19, 8:54 AM

Try This one

@api.one

def load_defaults_two(self):

    self.ensure_one()

    part_two_company_objs = self.env['kpi.objectives.part'].search([])

    part_order_line = []

    self.part_order_line.unlink()

    for items in part_two_company_objs:

        part_order_line.append((0, 0, {'product_id': items.id,

                    'individual_score': 0,

                    'unit_price': 0,

                    'management_score': 0,})


    self.write({'part_order_line': part_order_line})

3 Comments
Dishon Kadoh
3/14/19, 9:12 AM

I have tried this but its not working out

Yenthe Van Ginneken
3/14/19, 9:36 AM

Plus you shouldn't use @api.one, it is being phased out for @api.multi with self.ensure_one()

Dishon Kadoh
3/15/19, 5:51 AM

Noted Yenthe

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