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

[18.0] [MIG] sale_commission: Migration to 18.0 #583

Open
wants to merge 119 commits into
base: 18.0
Choose a base branch
from

Conversation

Borruso
Copy link

@Borruso Borruso commented Dec 6, 2024

Migration from 17.0 to 18.0

Issue: #564

martiita and others added 30 commits December 6, 2024 17:57
* 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
felipemotter and others added 30 commits December 6, 2024 17:59
There will be 2 settlement per month, one covering the first 15 days,
and the other for the rest of the month.

TT35385
- Make specific top-level menu and permissions for commissions.
- Don't depend on account.
- Reorganize elements.
- Change some parts of the code to fit better ORM tools.
- Adjust permissions in children modules.
- Add <sheet> to some form views to get modern view.
This way, we can restrict which commissions we can select or be
automatically populate in the different documents.
Currently translated at 100.0% (22 of 22 strings)

Translation: commission-15.0/commission-15.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-15-0/commission-15-0-sale_commission/ja/
Currently translated at 13.0% (3 of 23 strings)

Translation: commission-16.0/commission-16.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-16-0/commission-16-0-sale_commission/pt_BR/
Steps to reproduce:

- With a user with only sales permission and no invoicing one.
- Go to an invoiced sales order.
- Click on the smart-button "Invoice".

You get a permission error on `account.invoice.line.agent` model.

With this commit, we add read permission to salesmen over that object
to avoid the problem. The other option would be to protect the view
under the invoicing group, but it's interesting that salesmen can
check its own invoices commissions.

TT44083
Currently translated at 100.0% (23 of 23 strings)

Translation: commission-16.0/commission-16.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-16-0/commission-16-0-sale_commission/es/
Currently translated at 100.0% (23 of 23 strings)

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

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

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

Translation: commission-16.0/commission-16.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-16-0/commission-16-0-sale_commission/pt_BR/
Currently translated at 100.0% (23 of 23 strings)

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

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

Translation: commission-17.0/commission-17.0-sale_commission
Translate-URL: https://translation.odoo-community.org/projects/commission-17-0/commission-17-0-sale_commission/tr/
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.