Browse Source

[IMP] agreement

pull/255/head
Maxime Chambreuil 6 years ago
parent
commit
a81eec159b
  1. 1
      agreement/__manifest__.py
  2. 2
      agreement/data/agreement_stage.xml
  3. 16
      agreement/data/agreement_type.xml
  4. 4
      agreement/models/res_config_settings.py
  5. 5
      agreement/views/agreement.xml
  6. 23
      agreement/views/res_config_settings.xml

1
agreement/__manifest__.py

@ -22,6 +22,7 @@
'data/ir_sequence.xml', 'data/ir_sequence.xml',
'data/module_category.xml', 'data/module_category.xml',
'data/agreement_stage.xml', 'data/agreement_stage.xml',
'data/agreement_type.xml',
'security/res_groups.xml', 'security/res_groups.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'report/agreement.xml', 'report/agreement.xml',

2
agreement/data/agreement_stage.xml

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0"?>
<odoo> <odoo>
<record id="agreement_stage_new" model="agreement.stage"> <record id="agreement_stage_new" model="agreement.stage">

16
agreement/data/agreement_type.xml

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<odoo>
<record id="agreement_type_agreement" model="agreement.type">
<field name="name">Agreement</field>
</record>
<record id="agreement_type_contract" model="agreement.type">
<field name="name">Contract</field>
</record>
<record id="agreement_type_loi" model="agreement.type">
<field name="name">Letter of Intent</field>
</record>
</odoo>

4
agreement/models/res_config_settings.py

@ -17,6 +17,10 @@ class ResConfigSettings(models.TransientModel):
string='Link your repair orders to an agreement.') string='Link your repair orders to an agreement.')
module_agreement_rma = fields.Boolean( module_agreement_rma = fields.Boolean(
string='Link your RMAs to an agreement.') string='Link your RMAs to an agreement.')
module_agreement_sale = fields.Boolean(
string='Create an agreement when the sale order is confirmed.')
module_agreement_sale_subscription = fields.Boolean(
string='Link your subscriptions to an agreement.')
module_agreement_stock = fields.Boolean( module_agreement_stock = fields.Boolean(
string='Link your pickings to an agreement.') string='Link your pickings to an agreement.')
module_fieldservice_agreement = fields.Boolean( module_fieldservice_agreement = fields.Boolean(

5
agreement/views/agreement.xml

@ -121,8 +121,8 @@
</group> </group>
<group name="term_information"> <group name="term_information">
<group name="termdates_left" string="Term Dates"> <group name="termdates_left" string="Term Dates">
<field name="start_date" required="True" attrs="{'required': [('is_template', '=', False)], 'readonly':[('is_template', '=', True)]}"/>
<field name="end_date" required="True" attrs="{'required': [('is_template', '=', False)], 'readonly':[('is_template', '=', True)]}"/>
<field name="start_date" attrs="{'required': [('is_template', '=', False)], 'invisible': [('is_template', '=', True)]}"/>
<field name="end_date" attrs="{'required': [('is_template', '=', False)], 'invisible': [('is_template', '=', True)]}"/>
<field name="expiration_notice"/> <field name="expiration_notice"/>
<field name="change_notice"/> <field name="change_notice"/>
<field name="notification_address_id" domain="['|', ('parent_id', '=', partner_id), ('parent_id', '=', company_partner_id)]"/> <field name="notification_address_id" domain="['|', ('parent_id', '=', partner_id), ('parent_id', '=', company_partner_id)]"/>
@ -388,6 +388,7 @@
<field name="name">Templates</field> <field name="name">Templates</field>
<field name="res_model">agreement</field> <field name="res_model">agreement</field>
<field name="domain">[('is_template', '=', True)]</field> <field name="domain">[('is_template', '=', True)]</field>
<field name="context">[('is_template', '=', True)]</field>
<field name="view_mode">tree,kanban,form</field> <field name="view_mode">tree,kanban,form</field>
</record> </record>

23
agreement/views/res_config_settings.xml

@ -34,6 +34,29 @@
</div> </div>
<h2>Advanced Features</h2> <h2>Advanced Features</h2>
<div class="row mt16 o_settings_container"> <div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_agreement_sale"/>
</div>
<div class="o_setting_right_pane">
<label string="Sales"/>
<div class="text-muted">
Create an agreement when the sales order is confirmed
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box"
attrs="{'invisible': [('module_agreement_sale', '!=', True)]}">
<div class="o_setting_left_pane">
<field name="module_agreement_sale_subscription"/>
</div>
<div class="o_setting_right_pane">
<label string="Sale Subscriptions"/>
<div class="text-muted">
Link your subscriptions to an agreement
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box"> <div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane"> <div class="o_setting_left_pane">
<field name="module_fieldservice_agreement"/> <field name="module_fieldservice_agreement"/>

Loading…
Cancel
Save