Skip to content
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

[17.0][MIG] base_exception : Migration to 17.0 #2761

Closed
wants to merge 65 commits into from

Conversation

peluko00
Copy link

No description provided.

mourad-ehm and others added 30 commits November 17, 2023 11:11
…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
[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
OCA-git-bot and others added 3 commits November 17, 2023 11:11
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-16.0/server-tools-16.0-base_exception
Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-base_exception/
@peluko00 peluko00 mentioned this pull request Nov 17, 2023
34 tasks
@peluko00
Copy link
Author

peluko00 commented Nov 17, 2023

Module migrated to version 17.0

cc https://github.com/APSL 148520

@miquelalzanillas @lbarry-apsl @Javierbcn @samoros1 please review

Issue #2752

@pedrobaeza
Copy link
Member

The "pre-commit fixes" commit is missing.

Check migration guide: https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0

/ocabot merge base_exception

@pedrobaeza
Copy link
Member

/ocabot migration base_exception

@OCA OCA deleted a comment from OCA-git-bot Nov 17, 2023
@OCA-git-bot OCA-git-bot added this to the 17.0 milestone Nov 17, 2023
@peluko00
Copy link
Author

peluko00 commented Nov 17, 2023

The "pre-commit fixes" commit is missing.

Check migration guide: https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0

/ocabot merge base_exception

I squash the all migration's commits in one

@pedrobaeza
Copy link
Member

But "pre-commit fixes" is not a "migration commit". It's something apart. I told you about squashing in other PR because you have up to 3 "[MIG] xxxx: Migration to 17.0" commits.

@peluko00
Copy link
Author

peluko00 commented Nov 17, 2023

But "pre-commit fixes" is not a "migration commit". It's something apart. I told you about squashing in other PR because you have up to 3 "[MIG] xxxx: Migration to 17.0" commits.

I understand Pedro, sorry for the mistake. It's okay now?

@pedrobaeza
Copy link
Member

No worries, Antoni, it's a process to fully get into OCA that gets some time.

Coming again to this PR, it seems the order and the content is not the proper one. Maybe it's better to redo the migration, saving your final files before doing it, so you don't have also to redo the migration itself.

@peluko00
Copy link
Author

No worries, Antoni, it's a process to fully get into OCA that gets some time.

Coming again to this PR, it seems the order and the content is not the proper one. Maybe it's better to redo the migration, saving your final files before doing it, so you don't have also to redo the migration itself.

I go back to first commit when initialize the project and now i commited all i one. Much better?

@@ -0,0 +1,15 @@
- Raphaël Valyi \<\<<[email protected]>\>\>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbidoul seems that this conversion to MD is not correct, putting extra <.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this entire thing just hanging on correcting this, and if so can I fix it?

@pedrobaeza
Copy link
Member

The "pre-commit fixes" commit is still missing, but let's not be nitpicking.

/ocabot migration base_exception

)
f"<li>{html.escape(e.name)}: <i>{html.escape(e.description or '')}</i> <b>"
+ _(
"{'(Blocking exception)' if e.is_blocking else ''}</b></li>"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string format error
image

Try: f"{'(Blocking exception)' if e.is_blocking else ''}</b></li>"

return res

def write(self, vals):
res = super().write(vals)
self._get_cached_rules_for_domain.clear_cache(self)
self._get_cached_rules_for_domain.cache.clear(self)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i face this warning:

  File "/home/chien/code/odoo/odoo/17.0/odoo/models.py", line 4960, in _load_records_write
    self.write(values)
  File "/home/chien/code/oca/server-tools/17.0/base_exception/models/exception_rule.py", line 132, in write
    self._get_cached_rules_for_domain.cache.clear(self)
  File "/home/chien/code/odoo/odoo/17.0/odoo/tools/cache.py", line 113, in clear
    warnings.warn('Deprecated method ormcache.clear(model, *args), use registry.clear_cache() instead')

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm facing this warning too

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, using this for create, write and unlink should be the correct way now:

self.env.registry.clear_cache()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nguyenminhchien, may you check this #2809 ?

@@ -69,7 +71,7 @@
<page
name="help"
string="Help"
attrs="{'invisible': [('exception_type','!=','by_py_code')]}"
invisible="exception_type != 'by_py_code'"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the view is broken
image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I face this warning:
DeprecationWarning: XML declarations in HTML module descriptions are deprecated since Odoo 17, base_exception can just have a UTF8 description with not need for a declaration..

It's better if we remove the first line: <?xml version="1.0" encoding="utf-8"?>
You could also fetch this commit: OCA/maintainer-tools@8f89ec4 to let pre-commit does its things.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm facing this warning too

@john-herholz-dt
Copy link

@peluko00 are you still working on it?
Kind regards

<footer>
<button
name="action_confirm"
string="_Close"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe "_Close" is a typo.

@gurneyalex
Copy link
Member

Merged in #2809

@gurneyalex gurneyalex closed this Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.