[FIX] point_of_sale: unable to close open session with deleted journal
Steps to reproduce the bug: - Create POS (P) - Create journal (J) and link it to (P) - Open a new session in (P) - Exit the session without closing it - Delete (J) Bug: You cannot close the session nor assign a new journal to the POS. opw:2347169 closes odoo/odoo#59097 X-original-commit: 636f1358e72e65a3210c95c60d1703c9cbd914dc Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com> Signed-off-by: backspac <backspac@users.noreply.github.com>
This commit is contained in:
@@ -111,7 +111,8 @@ class PosConfig(models.Model):
|
||||
'account.journal', string='Sales Journal',
|
||||
domain=[('type', '=', 'sale')],
|
||||
help="Accounting journal used to post sales entries.",
|
||||
default=_default_sale_journal)
|
||||
default=_default_sale_journal,
|
||||
ondelete='restrict')
|
||||
invoice_journal_id = fields.Many2one(
|
||||
'account.journal', string='Invoice Journal',
|
||||
domain=[('type', '=', 'sale')],
|
||||
|
||||
@@ -246,7 +246,7 @@ class PosOrder(models.Model):
|
||||
note = fields.Text(string='Internal Notes')
|
||||
nb_print = fields.Integer(string='Number of Print', readonly=True, copy=False, default=0)
|
||||
pos_reference = fields.Char(string='Receipt Number', readonly=True, copy=False)
|
||||
sale_journal = fields.Many2one('account.journal', related='session_id.config_id.journal_id', string='Sales Journal', store=True, readonly=True)
|
||||
sale_journal = fields.Many2one('account.journal', related='session_id.config_id.journal_id', string='Sales Journal', store=True, readonly=True, ondelete='restrict')
|
||||
fiscal_position_id = fields.Many2one(
|
||||
comodel_name='account.fiscal.position', string='Fiscal Position',
|
||||
readonly=True,
|
||||
|
||||
Reference in New Issue
Block a user