Odoo Help

1

0
2 答案
3
头像

Sunny Sheth 印度

--Sunny Sheth--

1145
| 3 3 6
Ahmedabad, 印度
--Sunny Sheth--


Sunny Sheth 印度
2018/1/18 上午6:27

Hello Carlos,

add below attribute in One2many line and upgrade your module.

copy=True

Example with your source ==>
employee_line = fields.One2many(
                         'employee.line',
                         'order_id',
string='Employee Lines',
                         copy=True)

0
vladimir881002@outlook.com 古巴
2018/7/31 下午3:48

Hello Carlos, please try this, If you have any problem, let me know:

@api.multi
def copy(self, default=None):
default = default or {}
ids = self.one2many_ids.ids
    default['one2many_ids'] = [(6, False, ids)]
    return super(ClasName, self).copy(default)
提问
Writer
标签
Keep Informed
1 关注者(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