[12.0][IMP] - option to decide if we automaticallt create contract a sale confirm

This commit is contained in:
sbejaoui
2019-09-05 13:01:02 +02:00
committed by Abraham Anes
parent a1cdd4169d
commit bc0f33760e
8 changed files with 130 additions and 4 deletions

View File

@@ -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>

View File

@@ -12,6 +12,13 @@
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<field name="need_contract_creation" invisible="1"/>
<button name="action_create_contract"
string="Create Contracts"
type="object"
class="oe_highlight" attrs="{'invisible': [('need_contract_creation', '=', False)]}"/>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<button name="action_show_contracts"
type="object" icon="fa-book"