Skip to content
Snippets Groups Projects
Commit 3572ce3a authored by Pablo Paez's avatar Pablo Paez
Browse files

[FIX]account,account_debit_note: not show only purchaseable product

Only purchaseable products are not searchable in the lines of debit notes
and credit notes if this account moves are created from their tree view with
the CREATE button. This changes make that this behavieour were also if we
create this account moves from the buttons in the invoices "ADD CREDIT NOTE"
and "ADD DEBIT NOTE".

closes odoo/odoo#75402

Task: https://www.odoo.com/my/task/2543493


Signed-off-by: default avatarFlorian Gilbert <FlorianGilbert@users.noreply.github.com>
parent 8f3d3e90
No related branches found
No related tags found
No related merge requests found
......@@ -103,10 +103,13 @@ class AccountMoveReversal(models.TransientModel):
action.update({
'view_mode': 'form',
'res_id': moves_to_redirect.id,
'context':{'default_type': moves_to_redirect.type},
})
else:
action.update({
'view_mode': 'tree,form',
'domain': [('id', 'in', moves_to_redirect.ids)],
})
if len(set(moves_to_redirect.mapped('type'))) == 1:
action['context'] = {'default_type': moves_to_redirect.mapped('type').pop()}
return action
......@@ -76,6 +76,7 @@ class AccountDebitNote(models.TransientModel):
'name': _('Debit Notes'),
'type': 'ir.actions.act_window',
'res_model': 'account.move',
'context': {'default_type': default_values['type']},
}
if len(new_moves) == 1:
action.update({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment