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

[15.0][MIG] sale_invoice_policy #2027

Merged
merged 29 commits into from
Jun 5, 2022

Conversation

yankinmax
Copy link
Contributor

No description provided.

rousseldenis and others added 28 commits May 17, 2022 17:32
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_invoice_policy
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_invoice_policy/
Currently translated at 100.0% (17 of 17 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_invoice_policy
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_invoice_policy/ca/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_invoice_policy
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_invoice_policy/
Currently translated at 100.0% (17 of 17 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_invoice_policy
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_invoice_policy/pt/
Currently translated at 70.6% (12 of 17 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_invoice_policy
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_invoice_policy/fr/
Currently translated at 100.0% (17 of 17 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_invoice_policy
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_invoice_policy/fr/
Currently translated at 100.0% (17 of 17 strings)

Translation: sale-workflow-13.0/sale-workflow-13.0-sale_invoice_policy
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-13-0/sale-workflow-13-0-sale_invoice_policy/es_MX/
@yankinmax yankinmax force-pushed the 15.0-mig-sale_invoice_policy branch from 9b0bc4f to 396da8b Compare May 18, 2022 06:41
Copy link
Contributor

@ivantodorovich ivantodorovich left a comment

Choose a reason for hiding this comment

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

LG

@yankinmax
Copy link
Contributor Author

@rousseldenis can you pls take a look and probably approve the workflow?

@rousseldenis
Copy link
Sponsor Contributor

/ocabot migration sale_invoice_policy

@OCA-git-bot OCA-git-bot added this to the 15.0 milestone May 18, 2022
@@ -7,17 +7,16 @@
class ProductTemplate(models.Model):
_inherit = "product.template"

def _default_default_invoice_policy(self):
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Mmmh maybe this had been done at purpose to easy override

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, I got the idea of what it was used for.
But the reason I made it another way is the fact that at v15 we don't have this default.
I checked it through debugging. We have None value returned in this method.
At the module installation in test db I've always met:

Traceback (most recent call last):
  File "/odoo/src/odoo/service/server.py", line 1246, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/odoo/src/odoo/modules/registry.py", line 87, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/odoo/src/odoo/modules/loading.py", line 474, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "/odoo/src/odoo/modules/loading.py", line 363, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/odoo/src/odoo/modules/loading.py", line 199, in load_module_graph
    registry.init_models(cr, model_names, {'module': package.name}, new_install)
  File "/odoo/src/odoo/modules/registry.py", line 432, in init_models
    env['ir.model.fields.selection']._reflect_selections(model_names)
  File "/odoo/src/odoo/addons/base/models/ir_model.py", line 1216, in _reflect_selections
    expected = {
  File "/odoo/src/odoo/addons/base/models/ir_model.py", line 1219, in <dictcomp>
    for field_id in [IMF._get_ids(field.model_name)[field.name]]
KeyError: 'default_invoice_policy'

So, not to break logic, I propose to use another default which should return the same value => order.
If you have suggestion how to resolve this error another way I would highly appreciate ideas.
Thanks for review @rousseldenis

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@dreispt
Copy link
Sponsor Member

dreispt commented Jun 5, 2022

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 15.0-ocabot-merge-pr-2027-by-dreispt-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 44c6ee3 into OCA:15.0 Jun 5, 2022
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 74217b8. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet