Browse Source
[12.0][IMP] - option to decide if we automaticallt create contract a sale confirm
pull/208/head
[12.0][IMP] - option to decide if we automaticallt create contract a sale confirm
pull/208/head
sbejaoui
5 years ago
committed by
Thomas Binsfeld
8 changed files with 130 additions and 4 deletions
-
1product_contract/__manifest__.py
-
2product_contract/models/__init__.py
-
14product_contract/models/res_company.py
-
14product_contract/models/res_config_settings.py
-
41product_contract/models/sale_order.py
-
24product_contract/tests/test_sale_order.py
-
31product_contract/views/res_config_settings.xml
-
7product_contract/views/sale_order.xml
@ -0,0 +1,14 @@ |
|||
# 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_contract_at_sale_order_confirmation = fields.Boolean( |
|||
string="Automatically Create Contracts At Sale Order Confirmation", |
|||
default=True, |
|||
) |
@ -0,0 +1,14 @@ |
|||
# 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_contract_at_sale_order_confirmation = fields.Boolean( |
|||
related="company_id.create_contract_at_sale_order_confirmation", |
|||
readonly=False |
|||
) |
@ -0,0 +1,31 @@ |
|||
<?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="name">res.config.settings.form (in product_contract) |
|||
</field> |
|||
<field name="model">res.config.settings</field> |
|||
<field name="inherit_id" ref="sale.res_config_settings_view_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//div[@id='sales_settings_invoicing_policy']/.." |
|||
position="inside"> |
|||
<div class="col-12 col-lg-6 o_setting_box"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="create_contract_at_sale_order_confirmation"/> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<label for="create_contract_at_sale_order_confirmation"/> |
|||
<div class="text-muted"> |
|||
Automatically Create Contracts At Sale Order Confirmation |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
|
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue