-
-
Notifications
You must be signed in to change notification settings - Fork 700
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP]: account_invoice_section_sale_order add option to always create…
… sections
- Loading branch information
1 parent
7a9dc08
commit a6abeb0
Showing
6 changed files
with
63 additions
and
1 deletion.
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 +1,3 @@ | ||
from . import sale_order | ||
from . import res_config_settings | ||
from . import res_company |
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,12 @@ | ||
# Copyright 2021 Camptocamp SA | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) | ||
from odoo import fields, models | ||
|
||
|
||
class ResCompany(models.Model): | ||
_inherit = "res.company" | ||
|
||
always_create_invoice_section = fields.Boolean( | ||
help="Defines when to create sections", | ||
default=False, | ||
) |
12 changes: 12 additions & 0 deletions
12
account_invoice_section_sale_order/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,12 @@ | ||
# Copyright 2021 Camptocamp SA | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) | ||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
always_create_invoice_section = fields.Boolean( | ||
related="company_id.always_create_invoice_section", | ||
readonly=False, | ||
) |
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
27 changes: 27 additions & 0 deletions
27
account_invoice_section_sale_order/views/res_config_settings.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,27 @@ | ||
<?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.account</field> | ||
<field name="model">res.config.settings</field> | ||
<field name="inherit_id" ref="account.res_config_settings_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//block[@id='invoicing_settings']" position="inside"> | ||
|
||
<setting | ||
id="invoice_section_sale_order" | ||
string="Section configuration" | ||
help="Customize section when invoicing from sale orders" | ||
> | ||
<div class="row"> | ||
<label | ||
for="always_create_invoice_section" | ||
class="col-lg-4 o_light_label" | ||
string="Create section even if an invoice is created from a single sale order" | ||
/> | ||
<field name="always_create_invoice_section" /> | ||
</div> | ||
</setting> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |