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] account_invoice_constraint_chronology #1360

Merged

Conversation

Shide
Copy link
Contributor

@Shide Shide commented Mar 22, 2022

Straight forward migration.

  • Added return on the @api.onchange method to pass pre-commit
  • Changed SavepointCase to TransactionCase on tests

Please review @yajo @rafaelbn @HaraldPanten 😄

MT-455 @moduon

@oca-clabot
Copy link

Hey @Shide, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

@Shide Shide changed the title [15.0][MIG] account_invoice_constraint_chronology [15.0][MIG] WIP account_invoice_constraint_chronology Mar 22, 2022
@Shide Shide force-pushed the 15.0-mig-account_invoice_constraint_chronology branch from 0d42d9d to b847bef Compare March 22, 2022 15:31
@Shide
Copy link
Contributor Author

Shide commented Mar 22, 2022

Seems like installing vatnumber is failing (for version 1.2 and 1.1) due to base_vat_optional_vies dependency

Installing vatnumber with pip on my machine discards v1.2 and v1.1, falling onto v1.0

pip install vatnumber
Collecting vatnumber
  Downloading vatnumber-1.2.tar.gz (19 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/eduardo/anaconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vrk6z_42/vatnumber_dfc1096ac71340a296dbdd18671ee685/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vrk6z_42/vatnumber_dfc1096ac71340a296dbdd18671ee685/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-b3bnk0xg
         cwd: /tmp/pip-install-vrk6z_42/vatnumber_dfc1096ac71340a296dbdd18671ee685/
    Complete output (1 lines):
    error in vatnumber setup command: use_2to3 is invalid.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/d7/7c/869b59cd9cb6ed1057372cb704a3b86688ae8c12cfc7fcaedbc1424f5e7f/vatnumber-1.2.tar.gz#sha256=4e9e9cabcff6076d8deb8a347edfd5d0ab8cab1ed344fdbe5dd4a6110a2f2c7b (from https://pypi.org/simple/vatnumber/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading vatnumber-1.1.tar.gz (22 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/eduardo/anaconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vrk6z_42/vatnumber_a71c44053b364b6da662b29160aa60a4/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vrk6z_42/vatnumber_a71c44053b364b6da662b29160aa60a4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-vdrrcew8
         cwd: /tmp/pip-install-vrk6z_42/vatnumber_a71c44053b364b6da662b29160aa60a4/
    Complete output (1 lines):
    error in vatnumber setup command: use_2to3 is invalid.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/1f/77/18485f3f4bdcec93004a3eac639565eb21e4a556b9d16a5687b735a02498/vatnumber-1.1.tar.gz#sha256=ff7017420e137609a74ce0dbe6ba16c86ea5317d50ca398f8f423141c07fae18 (from https://pypi.org/simple/vatnumber/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading vatnumber-1.0.tar.gz (21 kB)
Building wheels for collected packages: vatnumber
  Building wheel for vatnumber (setup.py) ... done
  Created wheel for vatnumber: filename=vatnumber-1.0-py3-none-any.whl size=20265 sha256=8e8684a96810443f653c00a2ba21aa8b9ac624548e682c859d0ee83c21802669
  Stored in directory: /home/eduardo/.cache/pip/wheels/4d/27/32/6d4e8da4f5a851bf0486a9dcc4ea3dc11fee12f9502eaba950
Successfully built vatnumber
Installing collected packages: vatnumber
Successfully installed vatnumber-1.0

Same error than runboat trying to install vatnumber from pip, but in my case, pip fallbacks well.

@Shide Shide changed the title [15.0][MIG] WIP account_invoice_constraint_chronology [15.0][MIG] account_invoice_constraint_chronology Mar 22, 2022
@rafaelbn
Copy link
Member

@sbidoul please could you take a quick look on #1360 (comment) about PIP and vatnumber

Thank you!

@sbidoul
Copy link
Member

sbidoul commented Mar 22, 2022

vatnumber is unmaintained and does not install with the last setuptools. Odoo does not use it anymore, we must find a replacement too.

@Shide
Copy link
Contributor Author

Shide commented Mar 23, 2022

@sbidoul Any chances to allow pip to fallaback to older versions on Runboat?
This will unlock migrations not related directly or indirectly to modules that has external dependencies such vatnumber.

@sbidoul
Copy link
Member

sbidoul commented Mar 23, 2022

@Shide actually setuptools is already constrained for older Odoo branches for that same reason. Since for these, it is an Odoo dependency which we can't change, there is no other solution.

Here,
1/ we have control on the use of that unmaintained dependency, so we can replace it
2/ actually I don't even see where it is imported in this repo: base_vat_optional_vies declares the dependency but does not seem to use it, so maybe it's simply a migration oversight
3/ I'm not keen to pin setuptools for more recent Odoo versions because it will certainly create problems down the line if there are dependencies that themselves require a recent setuptools

@rafaelbn rafaelbn requested a review from yajo March 23, 2022 23:39
@rafaelbn
Copy link
Member

/ocabot migration account_invoice_constraint_chronology

yajo added a commit to moduon/account-financial-tools that referenced this pull request Mar 28, 2022
This dependency is giving problems elsewhere and is not really used directly by this module.

See OCA#1360 (comment)

@moduon MT-455
@yajo
Copy link
Member

yajo commented Mar 28, 2022

I pushed the fix for the vatnumber problem. Let's see now. Regarding the PR itself, it looks good to me.

@rafaelbn
Copy link
Member

/ocabot rebase

@OCA-git-bot
Copy link
Contributor

@rafaelbn The rebase process failed, because command git push --force moduon tmp-pr-1360:15.0-mig-account_invoice_constraint_chronology failed with output:

remote: Permission to moduon/account-financial-tools.git denied to OCA-git-bot.
fatal: unable to access 'https://github.com/moduon/account-financial-tools/': The requested URL returned error: 403

Copy link
Member

@rafaelbn rafaelbn left a comment

Choose a reason for hiding this comment

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

Functional 👍

Adrien Peiffer and others added 7 commits March 31, 2022 07:42
…ice_constraint_chronology

[IMP] DEFAULT_SERVER_DATE_FORMAT

[IMP] display formatted date with context timezone in exception popup for account_invoice_constraint_chronology addons

[ADD] Add context in  tests for account_invoice_constraint_chronology addons

[IMP] Use exceptions.warning for account_invoice_constraint_chronology addons

[IMP] Remove exclamation mark

[ADD] Add .pot file for account_invoice_constraint_chronology

[IMP] Use .env for account_invoice_constraint_chronology tests

[IMP] Use onchange decorator, add white space at end of file, correct ypo mistake for account_invoice_constraint_chronology

[IMP] Improve performance
In order to get visibility on https://www.odoo.com/apps the OCA board has
decided to add the OCA as author of all the addons maintained as part of the
association.
It was not used in these tests anyway.
OCA-git-bot and others added 11 commits March 31, 2022 07:42
Addresses the issue as commented here:

- OCA#1206
- OCA#1152 (comment)

Summary of the steps to reproduce the problem:

1. Set on the invoices journal the constraint chronology.
2. Validate an invoice for this journal today.
3. Your accountant says there's an error on an invoice from yesterday.
4. Cancel it an set it to draft. You don't even need to modify anything
5. Try to post the invoice.
6. You'll get a chronology error.

In v12 this was considered but it was lost on the migration to v13:

https://github.com/OCA/account-financial-tools/blob/800c02474e5aa43cee592e93499d2a480be46d32/account_invoice_constraint_chronology/model/account_invoice.py#L50

https://github.com/OCA/account-financial-tools/blob/800c02474e5aa43cee592e93499d2a480be46d32/account_invoice_constraint_chronology/model/account_invoice.py#L70-L73

TT34624
This dependency is giving problems elsewhere and is not really used directly by this module.

See OCA#1360 (comment)

@moduon MT-455
@yajo yajo force-pushed the 15.0-mig-account_invoice_constraint_chronology branch from 7df0b27 to 7a467d7 Compare March 31, 2022 07:42
@yajo
Copy link
Member

yajo commented Mar 31, 2022

Rebased, to see if that fixes the build.

@yajo
Copy link
Member

yajo commented Mar 31, 2022

Please @Shide review test failures.

@Shide
Copy link
Contributor Author

Shide commented Mar 31, 2022

Please @Shide review test failures.

Done, thanks! :)

@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). 🤖

@rafaelbn
Copy link
Member

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 15.0-ocabot-merge-pr-1360-by-rafaelbn-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 3dd61fc into OCA:15.0 Mar 31, 2022
@OCA-git-bot
Copy link
Contributor

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

@yajo yajo deleted the 15.0-mig-account_invoice_constraint_chronology branch April 1, 2022 07:41
RodrigoBM pushed a commit to factorlibre/account-financial-tools that referenced this pull request Jan 26, 2023
This dependency is giving problems elsewhere and is not really used directly by this module.

See OCA#1360 (comment)

@moduon MT-455
RodrigoBM pushed a commit to factorlibre/account-financial-tools that referenced this pull request Jan 31, 2023
This dependency is giving problems elsewhere and is not really used directly by this module.

See OCA#1360 (comment)

@moduon MT-455
cormaza pushed a commit to cormaza/account-financial-reporting that referenced this pull request Jun 2, 2024
This dependency is giving problems elsewhere and is not really used directly by this module.

See OCA/account-financial-tools#1360 (comment)

@moduon MT-455
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.