Odoo Help

0

0
1 Answer
0
Avatar

subbarao

--subbarao--

1198
| 5 1 7
Chennai, 印度
--subbarao--


subbarao
2019/3/14 上午8:54

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
2019/3/14 上午9:12

I have tried this but its not working out

Yenthe Van Ginneken
2019/3/14 上午9:36

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

Dishon Kadoh
2019/3/15 上午5:51

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