[MIG] account_usability_misc: Migration to 18.0

This commit is contained in:
Stéphan Sainléger
2026-03-17 23:04:52 +01:00
parent 8cef75a9b3
commit f74229181b
8 changed files with 130 additions and 122 deletions

View File

@@ -4,11 +4,17 @@ from odoo import fields, models
class AccountBankStatementLine(models.Model):
_inherit = "account.bank.statement.line"
move_line_journal_type = fields.Char(string="Journal Type", compute="_compute_move_line_journal_type")
move_line_journal_type = fields.Char(
string="Journal Type", compute="_compute_move_line_journal_type"
)
def _compute_move_line_journal_type(self):
for rec in self:
if self._context.get('default_journal_id'):
rec.move_line_journal_type = self.env["account.journal"].browse(self._context.get('default_journal_id')).type
if self._context.get("default_journal_id"):
rec.move_line_journal_type = (
self.env["account.journal"]
.browse(self._context.get("default_journal_id"))
.type
)
else:
rec.move_line_journal_type = None