summaryrefslogtreecommitdiff
path: root/addons/account_debit_note/wizard/account_debit_note.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/account_debit_note/wizard/account_debit_note.py')
-rw-r--r--addons/account_debit_note/wizard/account_debit_note.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/account_debit_note/wizard/account_debit_note.py b/addons/account_debit_note/wizard/account_debit_note.py
index af553426c12..3501599c60a 100644
--- a/addons/account_debit_note/wizard/account_debit_note.py
+++ b/addons/account_debit_note/wizard/account_debit_note.py
@@ -39,14 +39,14 @@ class AccountDebitNote(models.TransientModel):
def _compute_from_moves(self):
for record in self:
move_ids = record.move_ids
- record.move_type = move_ids[0].type if len(move_ids) == 1 or not any(m.type != move_ids[0].type for m in move_ids) else False
+ record.move_type = move_ids[0].move_type if len(move_ids) == 1 or not any(m.move_type != move_ids[0].move_type for m in move_ids) else False
record.journal_type = record.move_type in ['in_refund', 'in_invoice'] and 'purchase' or 'sale'
def _prepare_default_values(self, move):
- if move.type in ('in_refund', 'out_refund'):
- type = 'in_invoice' if move.type == 'in_refund' else 'out_invoice'
+ if move.move_type in ('in_refund', 'out_refund'):
+ type = 'in_invoice' if move.move_type == 'in_refund' else 'out_invoice'
else:
- type = move.type
+ type = move.move_type
default_values = {
'ref': '%s, %s' % (move.name, self.reason) if self.reason else move.name,
'date': self.date or move.date,
@@ -54,9 +54,9 @@ class AccountDebitNote(models.TransientModel):
'journal_id': self.journal_id and self.journal_id.id or move.journal_id.id,
'invoice_payment_term_id': None,
'debit_origin_id': move.id,
- 'type': type,
+ 'move_type': type,
}
- if not self.copy_lines or move.type in [('in_refund', 'out_refund')]:
+ if not self.copy_lines or move.move_type in [('in_refund', 'out_refund')]:
default_values['line_ids'] = [(5, 0, 0)]
return default_values