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

[15.0][MIG] Commission : Migration to 15.0 #363

Closed

Conversation

manuelcalerosolis
Copy link

[This is the migration of the "commissions" repo to 15.0 but there are important changes with respect to previous versions.]

(#343)

martiita and others added 30 commits March 8, 2022 09:09
* PEP 8 fixes
* Replace depreciated osv for orm and other depreciation fixes
* Code fix and optimization
* Add context
* migrate models security and i18n
* add demo data and minor fixes
* add sale agent and commission views
* add stock dependency add views and product/stock overrides
* fixed related fields
* minor fixes: names and labels
* change 'onchange' attribute in view to api.onchange'
* improve comments about migration
* add invoice view
* add wizards
* use api.onchange
* add store attribute on res.partner.agent
* set default currency
* change state field to readonly
* migrate stock picking and settlements views
* fix invoice view
* fix invoice wizard
* change osv.except_osv to openerp.exceptions
* add missed report
* fix taxes in action_invoice_create
* Take default commission when manual adding agents + error on settled filter
* Many2one pointer of comission section
* Fix translation problem + add commission total on sales orders
* Cancel settlement when the associated invoice is cancel and go back to invoiced when re-validated
On generate agent invoice you can only select journal of type "sale". This can cause the numbers of sales invoices not correlated.
IMHO, agent invoices must be of type purchase and this solves it, allowing to select journals of type purchase.
…elect if commission is calculated from subtotal or from margin

* added python tests
Tests create invoices in a month previous the current date, which
makes that they fail on January, as previous fiscal year doesn't
exist. This is fixed creating invoices in the current date, and
calling the settle wizard with one month more. This won't fail
on December, because there's no need of the next fiscal year for
this operation
When creating a refund from an invoice, pass correct values
(converted as dictionary) for the agents lines, so that the refund
keep the same commissions (but reversed) than the original invoice.
…omer. (instead of showing when agent is not an agent)
Without this condition, all partners are suppliers, because the default
value for agent_type is agent and the onchange is executed.
* Show wizards results
* Fix refunds
* Fixes OCA#61
* Fixes OCA#63.
add same method for account invoice
FIX after changing customer on SO with lines, can't save sale order anymore
See odoo/odoo#17618
Also add button to recompute agents on SO lines
as May would have June as period start:
((5 - 1) // 3 + 1) * 3

instead, the new formula:
>>> for m in range(1, 13):
...     print (m - 1) // 3 * 3 + 1
...
1
1
1
4
4
4
7
7
7
10
10
10

See
hurrinico#2
and
odoo/odoo#17618

This extends the workaround, fixing "Record not found" after changing invoice date, for example
francesco-ooops and others added 19 commits March 8, 2022 09:09
Currently translated at 79.4% (124 of 156 strings)

Translation: commission-14.0/commission-14.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission/it/
Currently translated at 100.0% (156 of 156 strings)

Translation: commission-14.0/commission-14.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission/it/
Currently translated at 80.1% (125 of 156 strings)

Translation: commission-14.0/commission-14.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission/it/
Currently translated at 80.7% (126 of 156 strings)

Translation: commission-14.0/commission-14.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission/it/
Currently translated at 76.2% (119 of 156 strings)

Translation: commission-14.0/commission-14.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission/it/
Currently translated at 95.5% (149 of 156 strings)

Translation: commission-14.0/commission-14.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission/it/
Currently translated at 97.4% (152 of 156 strings)

Translation: commission-14.0/commission-14.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission/it/
Currently translated at 98.7% (154 of 156 strings)

Translation: commission-14.0/commission-14.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission/it/
Currently translated at 98.7% (154 of 156 strings)

Translation: commission-14.0/commission-14.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission/it/
Currently translated at 100.0% (156 of 156 strings)

Translation: commission-14.0/commission-14.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: commission-14.0/commission-14.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission/
@BT-aestebanez
Copy link

@manuelcalerosolis To be honest, I don't see the point on removing sale_comission in 5fb8108 in order to add it again in bf13df3 This process only removes the original authors of the lines...
Imho, you can do it in two commits, the one with black, isort with only the changes done automatically, and another commit with the rest, making sure you include @dani-xtendoo as contributor.

@BT-aestebanez BT-aestebanez mentioned this pull request Jul 6, 2022
5 tasks
@pedrobaeza pedrobaeza mentioned this pull request Aug 23, 2022
@francescapenso
Copy link

Hello any update about this PR?

@yostashiro
Copy link
Member

We are interested in working on this migration if this one is not moving forward soon. If that happens, I was wondering whether we should create one PR covering commission and sale_commission like this one, or create two separate PRs, each covering a module. Any preference?

@pedrobaeza
Copy link
Member

Only one, as the split occurs from the same previous module.

Copy link
Member

@yostashiro yostashiro left a comment

Choose a reason for hiding this comment

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

I feel that the split is not done in an optimal way although I haven't done a thorough check. For example, shouldn't settlement be part of the commission module instead of sale_commission?

There is also this comment #328 (comment) from @pedrobaeza of intending to have commission, account_commission and sale_commission out of 14.0 sale_commission. I think we should go in line with this.

Edit: Sorry, commented in the wrong PR (it was meant to be here #372 (review)), but I guess it applies to this one as well...

@ValentinVinagre
Copy link

Hello @manuelcalerosolis has the migration finished?

@manuelcalerosolis
Copy link
Author

Yes, it is finished, in fact I use it in several clients.
I don't know what's wrong with the PR, if you can help me I'd appreciate it.

@pedrobaeza
Copy link
Member

The problem with this one is that the refactoring is not what we talked about, so let's supersede by #374

@pedrobaeza pedrobaeza closed this Oct 28, 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.