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

[MIG] delivery_price_method: Migration to 14.0 #486

Closed
wants to merge 15 commits into from

Conversation

Vicenteagf
Copy link
Contributor

Migration to 14.0

rlizana and others added 14 commits May 16, 2022 18:11
- Add default price_method called "Carrier obtained price", for being more explicit
  and avoid user confusions.
- Shipment rate: Make it compatible with upstream code tricking the delivery_type
  field.
- Shipping sending: Call upstream carrier sending routine + call standard one, and
  merge results (excluding the tracking_number).
- Tests:

  * Make them more resilient (fixing the pricelist).
  * Use SavepointCase for executing setup only once.
  * Fine tune some code
- Improve README
If a user don't have the necessary permissions for writing in the
`delivery.carrier` model (like a low range salesman) he won't be able to
choose a carrier wich uses the rate shipment override.

TT31627
@pedrobaeza
Copy link
Member

/ocabot migration delivery_price_method

@OCA-git-bot OCA-git-bot added this to the 14.0 milestone Jun 6, 2022
@OCA-git-bot OCA-git-bot mentioned this pull request Jun 6, 2022
21 tasks
Copy link
Member

@hildickethan hildickethan left a comment

Choose a reason for hiding this comment

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

Works properly

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

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

And please squash both migration commits together.

self.pricelist = self.env["product.pricelist"].create(
{
"name": "Test pricelist",
"item_ids": [],
Copy link
Member

Choose a reason for hiding this comment

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

This was populated on purpose. Why are you removing it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On 13.0 the function fixed_rate_shipment of delivery.carrier returned the fixed_price of the carrier.
On 14.0 it just returns the product price of the pricelist which in this case is 0.0 and the test fails.

Should I try another approach?

Copy link
Member

Choose a reason for hiding this comment

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

This pricelist is put for avoiding weird behaviors when data pricelist has its currency changed (which happened in the past according to the installed modules). Thus, you should adjust the rest of the test code instead of removing this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it works properly now, thank you.

[FIX] delivery_price_method: fix test

Update delivery_price_method/__manifest__.py

Co-authored-by: Pedro M. Baeza <pedro.baeza@tecnativa.com>

[FIX] delivery_price_method: test correction
@Vicenteagf Vicenteagf force-pushed the 14.0-mig-delivery_price_method branch from 546c5fc to 4a8d04f Compare June 7, 2022 10:31
@@ -58,34 +58,35 @@ def _add_delivery(self):

def test_delivery_price_fixed(self):
sale = self.sale
self.pricelist.item_ids[0].write({"fixed_price": 99.99})
Copy link
Member

Choose a reason for hiding this comment

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

I still don't understand why is this needed, being the rule to use public price. Shouldn't you put instead this price in the product or see if the pricelist item structure is different?

@victoralmau
Copy link
Member

Superseed by: #518

@pedrobaeza pedrobaeza closed this Aug 11, 2022
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.

10 participants