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] rma_sale: Migration to 16.0 #364

Merged
merged 55 commits into from
Sep 2, 2023

Conversation

pedrobaeza
Copy link
Member

  • Standard procedure.
  • Adapt to new prepare_*_vals methods.
  • Renamed fields adaptation.

@Tecnativa TT44214

Ernesto Tejeda and others added 30 commits August 29, 2023 20:01
[UPD] Update rma_sale.pot

[ADD] icon.png
rma_sale 12.0.1.0.1

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: rma-12.0/rma-12.0-rma_sale
Translate-URL: https://translation.odoo-community.org/projects/rma-12-0/rma-12-0-rma_sale/
[FIX] rma: views permissions

Regular users don't have permissions to rma models, so we should avoid
loading views that lead to permission errors.

TT24986

rma_sale 12.0.1.1.0

[FIX] rma_sale: portal permissions

Some operations need to be sudoed to be reachable by the portal user

[UPD] Update rma_sale.pot

rma_sale 12.0.1.1.1

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: rma-12.0/rma-12.0-rma_sale
Translate-URL: https://translation.odoo-community.org/projects/rma-12-0/rma-12-0-rma_sale/

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: rma-12.0/rma-12.0-rma_sale
Translate-URL: https://translation.odoo-community.org/projects/rma-12-0/rma-12-0-rma_sale/

[IMP] rma: teams flow

- If no RMA Team is set, we'll assign a default one to the new RMA.
- A sequence is now used to search for the top team and assign it.
- No default user is assigned when it's not in the context (i.e. portal
rmas).

[UPD] Update rma_sale.pot

rma_sale 12.0.1.2.0

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: rma-12.0/rma-12.0-rma_sale
Translate-URL: https://translation.odoo-community.org/projects/rma-12-0/rma-12-0-rma_sale/
- Fix thrown error when trying to download a picking from the portal.
- Add the hook method to prepare RMA values ​​from the return pick wizard.
- Add the access rule for portal users.
- Show the portal 'Request RMAs' button on the sales page only to users
related to the sales order.

[UPD] Update rma_sale.pot

rma_sale 12.0.1.3.0

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: rma-12.0/rma-12.0-rma_sale
Translate-URL: https://translation.odoo-community.org/projects/rma-12-0/rma-12-0-rma_sale/
Currently translated at 81.5% (44 of 54 strings)

Translation: rma-12.0/rma-12.0-rma_sale
Translate-URL: https://translation.odoo-community.org/projects/rma-12-0/rma-12-0-rma_sale/es/
- Now it's possible to open several RMAs in a sale order from the portal
- A new comment button has been added to allow the portal user to enter
relevant information like serial numbers o issue description.
- If the requested operation isn't set no RMA will be opened
- The RMA product qty is now a numeric control with limits according to
the qty available to return

[FIX] rma,rma_sale: fix linter errors

[UPD] Update rma_sale.pot

rma_sale 12.0.1.4.0

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: rma-12.0/rma-12.0-rma_sale
Translate-URL: https://translation.odoo-community.org/projects/rma-12-0/rma-12-0-rma_sale/
- Proper dependency is `sale_stock`, not `sale`, as we are using some fields added
  by this module.
- Propagate salesman from sales order when available.

TT25525

rma_sale 12.0.1.4.1
[FIX+IMP] rma: usability

* IMP - Now the description will be an html son we can show rich styles
in the customers report.
* FIX - On locked sale orders it was need to unlock them to be able to open an RMA.
* IMP - Make the description label visible in the backend form so the
user can easily spot it.
* IMP - Added date and deadline filters.
* IMP - Added pending RMAs filter.
* IMP - Added late RMAs filter.
* IMP - Added danger decoration in tree view

rma_sale 12.0.1.5.0

Translated using Weblate (Spanish)

Currently translated at 100.0% (62 of 62 strings)

Translation: rma-12.0/rma-12.0-rma_sale
Translate-URL: https://translation.odoo-community.org/projects/rma-12-0/rma-12-0-rma_sale/es/
Fine-tune of 9a25d6, as for one record, the domain is not applied, but the list is
shown.
Currently translated at 100.0% (63 of 63 strings)

Translation: rma-13.0/rma-13.0-rma_sale
Translate-URL: https://translation.odoo-community.org/projects/rma-13-0/rma-13-0-rma_sale/ro/
Currently translated at 61.9% (39 of 63 strings)

Translation: rma-13.0/rma-13.0-rma_sale
Translate-URL: https://translation.odoo-community.org/projects/rma-13-0/rma-13-0-rma_sale/nl/
If there are several stock moves with the same product in the picking we
won't be able to make the RMA
When a sale line has a phantom product (mrp kits) the RMA would not be
possible as the wizard couldn't pair the components moves with the
product in the line. With this approach, we can at least return the
spare components of the original kit line.

We also need some hooks to intervine in the main methods, like in
invoicing.
When the user selects an operation, the comment shows up so the customer
doesn't forget to enter his comments
Allow to set the desired shipping address where the goods must be
returned after the RMA is processed.
Lesser fix for creating RMA from website.
Current values will break any custom behaviour because Many2one fields are set using strings instead of integer (IDs).
Lesser fix for sale.order.line.rma.wizard methods.
When method '_prepare_rma_values' was called upon records where field 'picking_id' was empty, Odoo raised a CacheError when trying to access field 'move_id'.
That happened because computed method '_compute_move_id' was not assigning a proper value to such field when 'picking_id' was empty.
Once the computed method is fixed (by simply assigning 'False' as 'move_id' value when no picking is set), the CacheError is solved.
If a product was already in an RMA in the past, we should be able to
place another RMA in the future.
Using move_dest_ids we can easily end in an infinite loop situation as
the return of the return of the return ends with some original moves on
in move_dest_ids. We must ensure to drop them to avoid the infinite
loop.

TT29886
Now it's possible to configure if the portal RMA request form is loaded
in a popup or in a single page.

In that page, we can add custom blocks (if the website is installed) a
customize the form text.

In this commit, we also add the possibility to extend the form view to allow
custom fields that will show up in the RMA description.

TT29670
@pedrobaeza
Copy link
Member Author

/ocabot migration rma_sale

@OCA-git-bot OCA-git-bot mentioned this pull request Aug 29, 2023
7 tasks
Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

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

Backend functionality ok. Some issues I came into:

The wizard form window doesn't show up properly

image

Looks like the portal wizard backend js code needs to be retailored as it doesn't work properly. Do you want me to take a look into it?

@pedrobaeza
Copy link
Member Author

Ouch, I looked for o2m in views, but not in wizards. Fixed.

About the portal JS, please do the needed changes, and it would be good to have a tour test for checking it.

Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

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

Finally no js revamp was needed but just some bs5 attributes tweaking

Comment on lines 48 to 49
data-toggle="collapse"
data-target="#delivery_address_picker"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
data-toggle="collapse"
data-target="#delivery_address_picker"
data-bs-toggle="collapse"
data-bs-target="#delivery_address_picker"

aria-expanded="false"
><i class="fa fa-truck" /> Choose a delivery address</button>
<div class="col-lg-12 collapse mt8" id="delivery_address_picker">
<div data-toggle="buttons" class="row">
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<div data-toggle="buttons" class="row">
<div data-bs-toggle="buttons" class="row">

<button
class="btn btn-primary fa fa-comments"
type="button"
data-toggle="collapse"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
data-toggle="collapse"
data-bs-toggle="collapse"

Comment on lines 219 to 220
data-toggle="modal"
data-target="#modal-request-rma"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
data-toggle="modal"
data-target="#modal-request-rma"
data-bs-toggle="modal"
data-bs-target="#modal-request-rma"

@chienandalu
Copy link
Member

I just tried this PR OCA/openupgradelib#338 to migrate the qweb templates and it looks that its working nicely :) I added a commit to the PR

@@ -61,15 +61,15 @@
type="radio"
name="partner_shipping_id"
t-att-value="address.id"
>
/>
Copy link
Member

@chienandalu chienandalu Aug 30, 2023

Choose a reason for hiding this comment

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

This change is weird. I guess, the bs4>bs5 scripts need some tweaking :) I'll fix it by hand

Ah, no, indeed it's correct to close it...

I'll check functionally

Copy link
Member

Choose a reason for hiding this comment

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

Ok, now I remember why this was strange. This was a bs4 hack to select the rma address from the address cards with no js. I'll check how to adapt it to make it work, but the change was correct, I think.

@pedrobaeza
Copy link
Member Author

Is it correct then? Are you going to prepare a tour test?

@chienandalu
Copy link
Member

Is it correct then? Are you going to prepare a tour test?

No, I should fix the delivery address selector in the portal. I can prepare a tour, yes.

@chienandalu chienandalu force-pushed the 16.0-mig-rma_sale branch 2 times, most recently from 802a191 to c077aac Compare August 31, 2023 10:49
Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

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

  • portal functionality fixed
  • tours added

@@ -61,15 +61,15 @@
type="radio"
name="partner_shipping_id"
t-att-value="address.id"
>
/>
Copy link
Member

Choose a reason for hiding this comment

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

Ok, now I remember why this was strange. This was a bs4 hack to select the rma address from the address cards with no js. I'll check how to adapt it to make it work, but the change was correct, I think.

@pedrobaeza
Copy link
Member Author

Is this finished then?

@chienandalu
Copy link
Member

Yes :)

pedrobaeza and others added 2 commits September 2, 2023 14:23
- Standard procedure.
- Adapt to new `prepare_*_vals` methods.
- Renamed fields adaptation.
- Improved test coverage.

TT44214

s
- Migrate bs4 to bs5
- Fix shipping address choice functionality
- Add tour for the user portal workflow
@pedrobaeza
Copy link
Member Author

I have improved a bit more the tests coverage and fine-tune several warnings, so it's time to merge it:

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

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

@OCA-git-bot OCA-git-bot merged commit 8e0eb52 into OCA:16.0 Sep 2, 2023
6 checks passed
@OCA-git-bot
Copy link
Contributor

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

@pedrobaeza pedrobaeza deleted the 16.0-mig-rma_sale branch September 2, 2023 15:11
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.