[MIG] base_exception_user: bump version, add unit tests

H7674
This commit is contained in:
Cedric Collins
2022-01-14 17:31:02 -06:00
committed by Salomon Chambi
parent a8709fc316
commit ab33759618
10 changed files with 194 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
from odoo import api, fields, models
class PurchaseUserTest(models.Model):
_name = 'base.exception.test.purchase'
_inherit = 'base.exception.test.purchase'
def button_confirm(self):
if self.detect_exceptions():
return self._popup_exceptions()
super(PurchaseUserTest, self).button_confirm()
@api.model
def _get_popup_action(self):
return self.env['ir.actions.act_window'].sudo().create(
{'name': 'Outstanding exceptions to manage',
'type': 'ir.actions.act_window',
'view_id': self.env.ref('base_exception.view_exception_rule_confirm').id,
'res_model': 'purchase.test.exception.rule.confirm',
'target': 'new',
'view_mode': 'form',
})
class PurchaseTestExceptionRuleConfirm(models.TransientModel):
_name = 'purchase.test.exception.rule.confirm'
_description = 'Exception Rule Confirm Wizard'
_inherit = 'exception.rule.confirm'
related_model_id = fields.Many2one('base.exception.test.purchase')