-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] sale_order_partner_invoice_period: added last requirements
- Loading branch information
1 parent
6d1e51f
commit 27748aa
Showing
6 changed files
with
60 additions
and
14 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,2 +1,3 @@ | ||
from . import res_config_settings | ||
from . import res_partner | ||
from . import sale_order |
20 changes: 20 additions & 0 deletions
20
sale_order_partner_invoice_period/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,20 @@ | ||
# © 2024 Solvos Consultoría Informática (<http://www.solvos.es>) | ||
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html | ||
from odoo import fields, models | ||
from .res_partner import INVOICE_PERIOD_SELECTION | ||
|
||
class ResCompany(models.Model): | ||
_inherit = "res.company" | ||
|
||
invoice_period_default = fields.Selection(INVOICE_PERIOD_SELECTION) | ||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = 'res.config.settings' | ||
|
||
invoice_period_default = fields.Selection( | ||
selection=INVOICE_PERIOD_SELECTION, | ||
related='company_id.invoice_period_default', | ||
help="Select default invoice period for new companys", | ||
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
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
20 changes: 20 additions & 0 deletions
20
sale_order_partner_invoice_period/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,20 @@ | ||
<?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 (in sale_order_partner_invoice_period) | ||
</field> | ||
<field name="model">res.config.settings</field> | ||
<field name="priority" eval="20"/> | ||
<field name="inherit_id" ref="sale.res_config_settings_view_form"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//setting[@id='automatic_invoicing']" position="after"> | ||
<setting id="default_invoice_period" help="Select default invoice period for new companys"> | ||
<field name="invoice_period_default"/> | ||
</setting> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</odoo> |