Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] Added settings parameter to update cep in database
- Loading branch information
1 parent
1f37e00
commit 48ed002
Showing
5 changed files
with
87 additions
and
32 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,5 +1,6 @@ | ||
# Copyright (C) 2015 Renato Lima - Akretion | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
from . import res_config_settings | ||
from . import l10n_br_zip | ||
from . import format_address_mixin |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright (C) 2019 Renato Lima (Akretion) # | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
from odoo import models, fields | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = 'res.config.settings' | ||
|
||
cep_update_days = fields.Integer( | ||
config_parameter='l10n_br_zip.cep_update_days', | ||
default=365, | ||
string='Days to Update CEP') |
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="l10n_br_base_res_config_settings_form" model="ir.ui.view"> | ||
<field name="name">res.config.settings.form</field> | ||
<field name="model">res.config.settings</field> | ||
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div[@name='l10n_br_zip_api']/div[2]" position="inside"> | ||
<div attrs="{'invisible': [('module_l10n_br_zip', '=', False)]}"> | ||
<div class="content-group mt16"> | ||
<label for="cep_update_days" class="o_light_label"/> | ||
<field name="cep_update_days" attrs="{'required': [('module_l10n_br_zip', '=', True)]}"/> days | ||
</div> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</odoo> |