-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by PicchiSeba
- Loading branch information
Showing
8 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
from . import account_invoice_line_agent | ||
from . import account_invoice_line_agent_partial | ||
from . import account_partial_reconcile | ||
from . import res_company | ||
from . import res_config_settings | ||
from . import sale_commission | ||
from . import sale_commission_settlement | ||
from . import sale_commission_settlement_line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class ResCompany(models.Model): | ||
_inherit = "res.company" | ||
|
||
commission_show_settlement_dates = fields.Boolean( | ||
"Show invoice and payment dates in settlements", | ||
) |
10 changes: 10 additions & 0 deletions
10
sale_commission_partial_settlement/models/res_config_settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
commission_show_settlement_dates = fields.Boolean( | ||
related="company_id.commission_show_settlement_dates", | ||
readonly=False, | ||
) |
18 changes: 16 additions & 2 deletions
18
sale_commission_partial_settlement/models/sale_commission_settlement.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
from odoo import models | ||
from odoo import fields, models | ||
|
||
|
||
class Settlement(models.Model): | ||
class SaleCommissionSettlement(models.Model): | ||
_inherit = "sale.commission.settlement" | ||
|
||
show_settlement_dates = fields.Boolean( | ||
related="company_id.commission_show_settlement_dates" | ||
) | ||
settlement_date_to = fields.Date( | ||
readonly=True, | ||
string="Invoice date up to", | ||
help="The invoice date used to create the settlement", | ||
) | ||
settlement_date_payment_to = fields.Date( | ||
readonly=True, | ||
string="Payment date up to", | ||
help="The payment date used to create the settlement", | ||
) | ||
|
||
def unlink(self): | ||
self.mapped("line_ids.agent_line_partial_ids").unlink() | ||
return super().unlink() |
34 changes: 34 additions & 0 deletions
34
sale_commission_partial_settlement/views/res_config_settings_view.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
<record id="res_config_settings_view_form" model="ir.ui.view"> | ||
<field name="name">res.config.settings.view.form.inherit.sale.management</field> | ||
<field name="model">res.config.settings</field> | ||
<field name="inherit_id" ref="sale_management.res_config_settings_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath | ||
expr="//div[@name='quotation_order_setting_container']" | ||
position="inside" | ||
> | ||
<div | ||
class="col-12 col-lg-6 o_setting_box" | ||
id="commission_show_settlement_dates" | ||
> | ||
<div class="o_setting_left_pane"> | ||
<field name="commission_show_settlement_dates" /> | ||
</div> | ||
<div class="o_setting_right_pane"> | ||
<label for="commission_show_settlement_dates" /> | ||
<span | ||
class="fa fa-lg fa-building-o" | ||
title="Values set here are company-specific." | ||
groups="base.group_multi_company" | ||
/> | ||
<div class="text-muted"> | ||
Shows the dates used to create the settlement itself | ||
</div> | ||
</div> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
18 changes: 18 additions & 0 deletions
18
sale_commission_partial_settlement/views/sale_commission_settlement_view.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="view_settlement_form" model="ir.ui.view"> | ||
<field name="name">Settlements</field> | ||
<field name="model">sale.commission.settlement</field> | ||
<field name="inherit_id" ref="sale_commission.view_settlement_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//group[field[@name='date_to']]" position="after"> | ||
<group attrs="{'invisible': [('show_settlement_dates', '=', False)]}"> | ||
<field name="show_settlement_dates" invisible="1" /> | ||
<field name="settlement_date_to" /> | ||
<field name="settlement_date_payment_to" /> | ||
<field name="create_date" /> | ||
</group> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters