hi all
in this function i add new lines in "custody.settlement" custom model
the last line update function remove all old lines in my custom model and remain only newly one .. how to add new line in line_ids without remove old lines
Thanks
def button_post(self):
super(InheritAccountBankStatement, self).button_post()
for rec in self:
for line in rec.line_ids:
if line.account_type == 'custody' and line.selected == True:
custody = line.custody_settlement_id
move_vals = {
'name': line.payment_ref,
'date': line.date,
'partner_id': line.partner_id.id,
'ref': line.custody_settlement_id.name,
'journal_id': rec.journal_id.id,
}
move_id = custody.env['account.move'].create(move_vals)
custody.update({'line_ids': move_id})