-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
@pedrobaeza is everything correct? |
I will try to review ASAP. Why doing this in this fork? |
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. |
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 |
There was a problem hiding this comment.
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))
84f33ed
to
edc4c38
Compare
2b00674
to
8b05a8f
Compare
8b05a8f
to
03cedd7
Compare
[15.0][FIX] update dotfiles w/ copier: flake8 source
…e_commission rev 7)
* 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
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/
…oices with a negative
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/
03cedd7
to
08c91a3
Compare
This PR is already merged in OCA repo and I will close this one. |
For reference, discussion session here 328