-
-
Notifications
You must be signed in to change notification settings - Fork 586
[18.0][MIG]contract_sale_generation: Migration to 18.0 #1252
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: 18.0
Are you sure you want to change the base?
[18.0][MIG]contract_sale_generation: Migration to 18.0 #1252
Conversation
|
It seems this is bringing more changes apart from the module |
|
I did it only to take commits of contract_sale_generation from my PR branch: But then i realize i need contract_sale dependency on PR #1138... and i did only: I guess I should also run format-patch against the branch from PR #1138, and only apply the commits from the contract_sale module? I'm more used to migrating modules that already exist in the official OCA branch. |
fbc67b8 to
b107c68
Compare
|
For a non merged dependency, check https://github.com/OCA/maintainer-tools/wiki/Use-temporary-reference%28s%29-to-another-pull-request%28s%29 |
|
Hi @pedrobaeza One question that comes to mind after reviewing the procedure is: Since this is for v18, my understanding is that by simply editing the pyproject.toml file within the module, I'm telling the test environment that it needs that module, which means this PR can be independent. What confuses me is having a local branch that is missing the dependency (which it would actually need in order to be installed), but then not committing anything other than the module being migrated. In summary, my final question is: when a PR has a dependency on one or more other PRs, should the code from those dependencies be included in this PR's branch or not?. It seems it should be independient, but i'm not sure at all. |
|
OCA CI works with pip installable modules, so putting that test_requirements.txt, activate a pip installation over a GitHub pull request, not requiring the files in the traditional way. |
b107c68 to
30424ab
Compare
|
Hi @pedrobaeza To avoid close the PR i try to fix the branch with: I hope is well done now. |
|
Yes, excellent. For a veteran like you, these are peanuts, hehe! /ocabot migration contract_sale_generation |
rousseldenis
left a comment
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.
Code review
AtaponDew
left a comment
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.
It looks good to me, approve.
5751c01 to
8c20016
Compare
|
Hello, I applied the corrections from @acsonefho and removed the test-requirements.txt (since contract_sale has already been merged). I did a rebase, and now the failure is happening in the sale_project module — I think because the project is not being propagated correctly. What’s curious is that on a demo database, with this module and sale_project installed, the tests actually pass.
I thought something might be missing because I removed the check for the analytic_account_id field in this module’s test (it no longer exists, I believe it’s now handled with analytic_distribution). But this module doesn’t actually interact with the project or the analytic account… The fact that the tests pass on a demo database is confusing me. Any ideas? |
|
Just wanted to ask whats the status here? |
I'm using this module in production, it works as expected, and in my local enviroment, with sale_project installed (clean db, but no with all contract modules installed) there is no error in the tests... I dont know if the problem belongs to this module (maybe not doing well with the analytic account/distribution) or is in the oca CI demo data... |
@javierjcf |
|
I finally managed to reproduce the error locally. Until now, I was only installing contract_sale_generation and sale_project on a new database (with demo data), and there was no error. <record id="product.product_product_1" model="product.product">
<field name="service_type">timesheet</field>
<field name="service_tracking">task_global_project</field>
</record>If i install also sale_timesheet then i got the same error as in OCA CI I don’t have much control over the new analytic accounting part (now it’s a widget with JSON format), but I suspect that in the tests I’m not doing anything with it, and maybe I should, since the analytic account (now analytic distribution) used to be linked to the projects. I’d also like to ask if anyone knows the best way to reproduce OCA’s CI locally… or at least to know which modules are usually installed. It seems like all Odoo addons and all the modules from the given repository. Are the rest of the modules from other repositories included as well? I also have another question: why do many modules use generic demo data, which may not be installed, instead of declaring their own demo data? For example, this tests make a mixure of own demo data and odoo demo data cls.pricelist = cls.env["product.pricelist"].create(
{"name": "pricelist for contract test"}
)
cls.partner = cls.env["res.partner"].create(
{
"name": "partner test contract",
"property_product_pricelist": cls.pricelist.id,
"email": "demo@demo.com",
}
)
cls.product_1 = cls.env.ref("product.product_product_1")Pricelist and partner are own demo data, but not the product... In a production database I can’t run these tests, because they require Odoo’s demo data with id=product_product_1. But if the product to test were generated as part of the module’s own test data, and not Odoo’s demo data, then the test could be run on any database. I suppose there’s some reason it’s done this way, but I can’t figure it out. |
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: contract-16.0/contract-16.0-contract_sale_generation Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/
Currently translated at 100.0% (15 of 15 strings) Translation: contract-16.0/contract-16.0-contract_sale_generation Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/es/
Currently translated at 100.0% (15 of 15 strings) Translation: contract-16.0/contract-16.0-contract_sale_generation Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/nl/
Currently translated at 100.0% (15 of 15 strings) Translation: contract-16.0/contract-16.0-contract_sale_generation Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/it/
Currently translated at 100.0% (15 of 15 strings) Translation: contract-16.0/contract-16.0-contract_sale_generation Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/pt_BR/
Currently translated at 86.6% (13 of 15 strings) Translation: contract-16.0/contract-16.0-contract_sale_generation Translate-URL: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-contract_sale_generation/hr/
8c20016 to
390ce6f
Compare
|
I might be wrong, but I think it’s safer not to rely on generic demo data, since other modules can change it. Creating the needed records directly in the test seems more reliable and isolated to me — isn’t that the right approach? |
|
Hi @acsonefho , I did the requested changes, and solve the test error. I think this is ready to merge? |
|
Thank you @javierjcf for your contribution and this good work! 🙏 I hope it'll be merge quickly 💪 |
|
This PR has the |
1 similar comment
|
This PR has the |
390ce6f to
b5106f1
Compare
b5106f1 to
a1522ed
Compare
|
There was an issue with the analytic account test in v17. In v18, the account_analytic_id field no longer exists in sale.order. The group_id field set in the contract test data (which represents the analytic account) was lost due to the use of Form() when creating lines. (See discussion in #1234) However, it can be recovered so that the test—which verifies that generated sales orders carry that analytic account—matches. In v18, however, the analytic account field was removed from the header of sale order an the code seems does nothing with this group_id field, so i removed this check from the test in this versión. |


Depends on:
Migration from v17 with changes of this PR #1234 over v17.