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] sale_margin_delivered: Migration to 16.0 #183

Merged
merged 19 commits into from
Sep 15, 2023

Conversation

pilarvargas-tecnativa
Copy link

@pilarvargas-tecnativa pilarvargas-tecnativa commented Sep 12, 2023

Supersede: #176

cc @Tecnativa TT44910

@chienandalu @sergio-teruel please review

chienandalu and others added 16 commits September 12, 2023 08:30
…l on delivery purchase price

[UPD] README.rst

[UPD] Update sale_margin_delivered.pot

Update translation files

Updated by Update PO files to match POT (msgmerge) hook in Weblate.
…not delivered qty (OCA#43)

[FIX] sale_margin_delivered: Set % delivered percent to quantities ordered if the line has not delivered quantities

[ADD] icon.png
…to compute delivered margin. Other module tests fails

[UPD] README.rst
We don't want to compute margin based on stock moves for non storable
products. This specially true for services and kits.

TT33499
Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

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

code review.
Apart a dependency question. LGTM.
thanks !

"website": "https://github.com/OCA/margin-analysis",
"category": "Sales",
"license": "AGPL-3",
"depends": ["sale_stock", "sale_margin_security"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"depends": ["sale_stock", "sale_margin_security"],
"depends": ["sale_stock"],

Please do not force to install module that are not required.

Choose a reason for hiding this comment

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

But you need to depend on this module to be able to apply the permissions of the "sale_margin_security.group_sale_margin_security" group in the "sale_margin_delivered.view_order_form" view. Isn't it?

Copy link
Contributor

Choose a reason for hiding this comment

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

can be a glue module. something like sale_margin_delivered_security

  • module A : sale_margin_security deploy a restriction to hide margin to some users
  • module B : sale_margin_delivered displays real delivered margin. (other feature).

user can want feature B without feature A.
Making both modules working together can be done with a glue module IMO.

Copy link
Contributor

@carlosdauden carlosdauden Sep 12, 2023

Choose a reason for hiding this comment

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

I agree with what you say Sylvain, someone who has the need to have those modules separately should feel free to make those changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok ! So I'll propose a PR against this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Done here : Tecnativa#2

Copy link
Contributor

@sergio-teruel sergio-teruel left a comment

Choose a reason for hiding this comment

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

LGTM!!
Functional review ok

Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

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

waiting for some refactoring in the the dependency.

Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

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

Functional review on runboat. One comment inline.

other question : why this module doesn't introduced delivered margin at sale.order level, next to the standard one ?

image

/>
<field
name="margin_delivered_percent"
string="% Margin"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
string="% Margin"
string="% Margin dlvd. (%)"

This string is error prone IMO. The standard margin (introduced in sale_margin) is name "Margin (%)".

if both fields are displayed, it is not possible for end user to know what are the field displayed. In my opinion, should "Margin dlvd. (%)"
image

Choose a reason for hiding this comment

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

You are right much clearer and avoids leading to errors, thanks for everything :)

@pedrobaeza
Copy link
Member

Please do a rebase to remove the merge commit.

@pedrobaeza
Copy link
Member

/ocabot migration sale_margin_delivered

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Sep 15, 2023
@openupgrade.migrate()
def migrate(env, version):
if env["ir.module.module"].search(
[("name", "=", "sale_margin_delivered"), ("state", "=", "installed")]
Copy link
Member

Choose a reason for hiding this comment

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

This is not needed, as if this is being executed is because the module is installed.

]
)
if sale_margin_delivered_security:
sale_margin_delivered_security.button_immediate_install()
Copy link
Member

Choose a reason for hiding this comment

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

Don't do this, but just change the state to to install.

Choose a reason for hiding this comment

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

corrected :)

]
)
if sale_margin_delivered_security:
sale_margin_delivered_security.state = "installed"
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
sale_margin_delivered_security.state = "installed"
sale_margin_delivered_security.state = "to install"

@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-183-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 1c1083f into OCA:16.0 Sep 15, 2023
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@legalsylvain
Copy link
Contributor

Hi. I had a unanswered question here : #183 (review)
if anybody can answer...
Thanks !

@pedrobaeza pedrobaeza deleted the 16.0-mig-sale_margin_delivered branch September 15, 2023 13:35
@pedrobaeza
Copy link
Member

Hi. I had a unanswered question here : #183 (review) if anybody can answer... Thanks !

It can be an improvement, yes

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.

8 participants