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, sale_commission : Migration to 15.0 #372

Closed
wants to merge 150 commits into from

Conversation

AungKoKoLin1997
Copy link
Contributor

This is the migration of sale_commission to 15.0.

martiita and others added 30 commits September 7, 2022 05:52
* 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
primes2h and others added 24 commits September 7, 2022 05:52
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/
There will be 2 settlement per month, one covering the first 15 days,
and the other for the rest of the month.

TT35385
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/
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.

"author": "Tecnativa," "Odoo Community Association (OCA)",
"category": "Sales Management",
"license": "AGPL-3",
"depends": ["product", "sale_management"],
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
"depends": ["product", "sale_management"],
"depends": ["product", "account"],

It shouldn't depend on sale_management. Menu items should be moved under invoicing.

@ValentinVinagre ValentinVinagre mentioned this pull request Sep 19, 2022
5 tasks
@ValentinVinagre
Copy link

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.

@pedrobaeza what do u think?

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.