parent
a1148e4760
commit
3f5cc8c072
|
@ -243,7 +243,8 @@ class AccountJournal(models.Model):
|
||||||
the profile.
|
the profile.
|
||||||
"""
|
"""
|
||||||
vals = {'journal_id': self.id,
|
vals = {'journal_id': self.id,
|
||||||
'currency_id': self.currency_id.id}
|
'currency_id': self.currency_id.id,
|
||||||
|
'import_partner_id': self.partner_id.id}
|
||||||
vals.update(parser.get_move_vals())
|
vals.update(parser.get_move_vals())
|
||||||
return vals
|
return vals
|
||||||
|
|
||||||
|
|
|
@ -333,6 +333,17 @@ class AccountMove(models.Model):
|
||||||
related='journal_id.used_for_completion',
|
related='journal_id.used_for_completion',
|
||||||
readonly=True)
|
readonly=True)
|
||||||
completion_logs = fields.Text(string='Completion Log', readonly=True)
|
completion_logs = fields.Text(string='Completion Log', readonly=True)
|
||||||
|
partner_id = fields.Many2one(related=False, compute='_compute_partner_id')
|
||||||
|
import_partner_id = fields.Many2one('res.partner',
|
||||||
|
string="Partner from import")
|
||||||
|
|
||||||
|
@api.depends('line_ids.partner_id', 'import_partner_id')
|
||||||
|
def _compute_partner_id(self):
|
||||||
|
for move in self:
|
||||||
|
if move.import_partner_id:
|
||||||
|
move.partner_id = move.import_partner_id
|
||||||
|
elif move.line_ids:
|
||||||
|
move.partner_id = move.line_ids[0].partner_id
|
||||||
|
|
||||||
def write_completion_log(self, error_msg, number_imported):
|
def write_completion_log(self, error_msg, number_imported):
|
||||||
"""Write the log in the completion_logs field of the bank statement to
|
"""Write the log in the completion_logs field of the bank statement to
|
||||||
|
|
Loading…
Reference in New Issue