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

[16.0][MIG] contract_sale_generation: Migration to 16.0 #955

Conversation

JesusValdez96
Copy link

@JesusValdez96 JesusValdez96 commented May 28, 2023

Replacing #914

  • Migration according to migration guide.
  • Fix tests failing due to dates and discount field not showing if user doesn't have group_discount_per_so_line

angelmoya and others added 30 commits May 28, 2023 00:45
…ata (OCA#130)

* [FIX+IMP] contract: Improve usability and don't fail on wrong data

* Cron create invoices masked for avoiding silent errors
* New constraints for assuring data consistency
* UI helps for entering consistent data
* Spanish translation
* Remove double company_id field on form

* [FIX] contract_sale_generation: Adapt tests to upstream contract
* Change the method called in the view
* Complete the create_invoice method
* Bump version + authoring
* Correct bad call of method
  Small Documentation
* Add super call in python test
* FIX bad field names causing bad quantities in sale.order.line
Currently translated at 100.0% (10 of 10 strings)

Translation: contract-10.0/contract-10.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-10-0/contract-10-0-contract_sale_generation/gl/
Currently translated at 100.0% (10 of 10 strings)

Translation: contract-10.0/contract-10.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-10-0/contract-10-0-contract_sale_generation/de/
Currently translated at 100.0% (10 of 10 strings)

Translation: contract-10.0/contract-10.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-10-0/contract-10-0-contract_sale_generation/fi/
Currently translated at 100.0% (15 of 15 strings)

Translation: contract-12.0/contract-12.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract_sale_generation/pt_BR/
Currently translated at 100.0% (15 of 15 strings)

Translation: contract-12.0/contract-12.0-contract_sale_generation
Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract_sale_generation/fr/
….order.line

The product UOM qty was not correctly set on the Sale Order Line
During the creation of a recurring Order from a Contract, the given quantity on the Contract Line was not correctly set on the created Sale Order Line.
Use the generation_type field defined now in contract base module.

Improve tests
…fter generation on contract level

As in contract module, recompute recurring_next_date after sale generation on contract level
@JesusValdez96 JesusValdez96 force-pushed the 16.0-mig-contract_sale_generation-jesusvaldez96 branch from 22c255f to 705a908 Compare May 30, 2023 02:03
@JesusValdez96
Copy link
Author

@rousseldenis could you review this?

@rousseldenis
Copy link
Contributor

/ocabot migration contract_sale_generation

@OCA-git-bot
Copy link
Contributor

The migration issue (#880) has been updated to reference the current pull request.
however, a previous pull request was referenced : #914.
Perhaps you should check that there is no duplicate work.
CC : @vibhascs

Copy link
Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

Some questions

# Get other sale values from partner onchange
sale.onchange_partner_id()
# Get other sale values
sale._compute_partner_shipping_id()
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we really call the computes ? Wouldn't the values automatically computed ?

@@ -11,7 +11,7 @@ def _prepare_sale_line_vals(self, dates, order_id=False):
sale_line_vals = {
"product_id": self.product_id.id,
"product_uom_qty": self._get_quantity_to_invoice(*dates),
"product_uom": self.uom_id.id,
"product_uom": self.product_id.uom_id.id,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why changing this ? If we want to use a particular uom on contract line, that one should be used.

@@ -87,7 +88,7 @@ def test_contract_count_sale_2(self):
self.assertEqual(set(action["domain"][0][2]), set(orders.ids))

def test_cron_recurring_create_sale(self):
self.contract_line.date_start = "2020-01-01"
self.contract_line.date_start = "2020-01-15"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change ?

@JesusValdez96 JesusValdez96 force-pushed the 16.0-mig-contract_sale_generation-jesusvaldez96 branch 2 times, most recently from a8c2c49 to 69e5520 Compare June 2, 2023 02:28
@JesusValdez96 JesusValdez96 force-pushed the 16.0-mig-contract_sale_generation-jesusvaldez96 branch from 69e5520 to d71473a Compare June 2, 2023 02:36
@JesusValdez96
Copy link
Author

Thanks @rousseldenis those changes were certainly not necessary.
I made some changes, could you review again?

@moylop260
Copy link
Contributor

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-955-by-moylop260-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 0eb498b into OCA:16.0 Jun 5, 2023
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at de97d8a. 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.