-
-
Couldn't load subscription status.
- Fork 1.6k
[19.0][MIG] base_exception: Migration to 19.0 #3417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 19.0
Are you sure you want to change the base?
Conversation
…lled by constraint methods 'detect_exception' can be called on an empty recordset.
- Show menu only to Exception Rule Managers - Use sequence and active widgets on tree view - Updated form to use sheet
… the _popup_exceptions mehtod
[IMP] Computed exception descriptions field, to display better help messages [IMP] Exceptions shouldn't be copied
By default exceptions can be ignored by the click of a button. Users begin human they will just click that button what ever the internal rules. So this PR adds the option to set specific exceptions as blocking. When exceptions are detected if one of them is blocking, the user will not be able to ignore them.
use odoo-test-helper split test so one test do one thing
This method is used by other modules that depend on 'base_exception'.
377345c to
39384d7
Compare
|
@etobella Done! |
|
|
||
| @classmethod | ||
| def tearDownClass(cls): | ||
| cls.loader.restore_registry() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lef-adhoc You should keep this but using:
cls.addClassCleanup(cls.registry.__delitem__, "base.exception.test.purchase.line")
etc...
5d64547 to
9057175
Compare
|
@rousseldenis I removed the test_purchase_ids = fields.Many2many("base.exception.test.purchase") field from ExceptionRule. This field was creating a Many2many relationship from the exception.rule model to the test model base.exception.test.purchase. The problem occurred during teardown: when addClassCleanup deleted base.exception.test.purchase from the registry, the test_purchase_ids field became orphaned (referencing a non-existent model). This caused AssertionError: Field exception.rule.test_purchase_ids with unknown comodel_name 'base.exception.test.purchase' during reset_changes(). Since this field wasn't actually used in any test assertions, removing it was the cleanest solution. Also added @mute_logger("odoo.registry") to suppress expected ERROR logs during test model registration. When add_to_registry registers models, Odoo's registry verification detects they don't have database tables yet and logs ERROR odoo.registry: Model X has no table. These errors are harmless (tables are created immediately after by init_models()), but the ERROR keyword in logs causes CI to fail. The decorator mutes these registry errors without affecting actual test failures. |
|
@lef-adhoc @etobella So, the mechanism is not yet error prone safe. |
|
@rousseldenis no, it is safe. He was missing this cls.addClassCleanup(cls.registry["exception.rule"]._fields.__delitem__, "test_purchase_ids")I have tested it in local and worked like a charm 😉 |
9057175 to
f9f02a7
Compare
|
@etobella I changed it as you said, but it's not working for me. |
|
Myself... I didn't execute the full tests. Sorry. However, there is a way for making it work Can you test? it worked for me. |
f9f02a7 to
2327062
Compare
2327062 to
8a64493
Compare
|
@rousseldenis @etobella I think it's fine now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
This PR has the |
|
@rousseldenis Could we merge? |
No description provided.