OCA-git-bot
5 years ago
8 changed files with 128 additions and 10 deletions
-
1contract/__manifest__.py
-
7contract/migrations/12.0.5.0.1/post-migration.py
-
2contract/models/__init__.py
-
36contract/models/contract_line.py
-
17contract/models/res_company.py
-
19contract/models/res_config_settings.py
-
28contract/tests/test_contract.py
-
28contract/views/res_config_settings.xml
@ -0,0 +1,7 @@ |
|||||
|
def migrate(cr, version): |
||||
|
cr.execute( |
||||
|
"""\ |
||||
|
UPDATE res_company |
||||
|
SET create_new_line_at_contract_line_renew = true |
||||
|
""" |
||||
|
) |
@ -0,0 +1,17 @@ |
|||||
|
# Copyright 2019 ACSONE SA/NV |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ResCompany(models.Model): |
||||
|
|
||||
|
_inherit = 'res.company' |
||||
|
|
||||
|
create_new_line_at_contract_line_renew = fields.Boolean( |
||||
|
string="Create New Line At Contract Line Renew", |
||||
|
help="If checked, a new line will be generated at contract line renew " |
||||
|
"and linked to the original one as successor. The default " |
||||
|
"behavior is to extend the end date of the contract by a new " |
||||
|
"subscription period", |
||||
|
) |
@ -0,0 +1,19 @@ |
|||||
|
# Copyright 2019 ACSONE SA/NV |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ResConfigSettings(models.TransientModel): |
||||
|
|
||||
|
_inherit = 'res.config.settings' |
||||
|
|
||||
|
create_new_line_at_contract_line_renew = fields.Boolean( |
||||
|
related="company_id.create_new_line_at_contract_line_renew", |
||||
|
readonly=False, |
||||
|
string="Create New Line At Contract Line Renew", |
||||
|
help="If checked, a new line will be generated at contract line renew " |
||||
|
"and linked to the original one as successor. The default " |
||||
|
"behavior is to extend the end date of the contract by a new " |
||||
|
"subscription period", |
||||
|
) |
@ -0,0 +1,28 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- Copyright 2019 ACSONE SA/NV |
||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> |
||||
|
|
||||
|
<odoo> |
||||
|
|
||||
|
<record model="ir.ui.view" id="res_config_settings_form_view"> |
||||
|
<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="//div[@data-key='account']" position="inside"> |
||||
|
<h2>Contract</h2> |
||||
|
<div class="row mt16 o_settings_container"> |
||||
|
<div class="col-12 col-lg-6 o_setting_box"> |
||||
|
<div class="o_setting_left_pane"> |
||||
|
<field name="create_new_line_at_contract_line_renew"/> |
||||
|
</div> |
||||
|
<div class="o_setting_right_pane"> |
||||
|
<label for="create_new_line_at_contract_line_renew"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
|
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue