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

Closed
wants to merge 152 commits into from

Conversation

AungKoKoLin1997
Copy link

For reference, discussion session here 328

@ValentinVinagre
Copy link

@pedrobaeza is everything correct?

@pedrobaeza
Copy link

pedrobaeza commented Oct 6, 2022

I will try to review ASAP. Why doing this in this fork?

@yostashiro
Copy link
Member

Was intending to review this internally before making a PR in the OCA repo to reduce the noise (but just haven't got the time to do so).

@AungKoKoLin1997 Please go ahead create a PR in the OCA repo as talked this morning.

Comment on lines +7 to +30
class CommissionMakeSettle(models.TransientModel):
_inherit = "commission.make.settle"

settlement_type = fields.Selection(
selection_add=[("invoice", "Invoice")],
ondelete={"invoice": "cascade"},
)

def _get_settlement_line_date(self, line):
if self.settlement_type == "invoice":
return line.invoice_date
return super()._get_settlement_line_date

def _get_agent_lines(self, agent, date_to_agent):
if self.settlement_type == "invoice":
return self.env["account.invoice.line.agent"].search(
[
("invoice_date", "<", date_to_agent),
("agent_id", "=", agent.id),
("settled", "=", False),
],
order="invoice_date",
)
return super()._get_agent_lines
Copy link
Author

@AungKoKoLin1997 AungKoKoLin1997 Oct 27, 2022

Choose a reason for hiding this comment

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

@yostashiro The purpose of this code is we want to share this wizard for every source? When we choose settlement type to invoice, we will get commission data from invoice and will create settlement. If my thought is correct, can you please pay attention to the following conversation? Question(OCA#328 (comment)) Answer(OCA#328 (comment))

yostashiro and others added 14 commits November 19, 2022 08:00
[15.0][FIX] update dotfiles w/ copier: flake8 source
* 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
primes2h and others added 27 commits November 19, 2022 08:52
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/
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/
@AungKoKoLin1997
Copy link
Author

This PR is already merged in OCA repo and I will close this one.

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.