Browse Source
[IMP] move some notions from agreement_legal to agreement
[IMP] move some notions from agreement_legal to agreement
we move the is_template field definition and the agreement.type model from the agreement_legal module to the agreement module. The fields are not displayed by default, unless the feature is enabled through a technical feature group, this is configurable in the agreement_sale module (because agreement in itself has no UI, and agreement_legal enables the feature by default)pull/383/head
Alexandre Fayolle
5 years ago
22 changed files with 217 additions and 37 deletions
-
1agreement/__manifest__.py
-
1agreement/models/__init__.py
-
14agreement/models/agreement.py
-
12agreement/models/agreement_type.py
-
1agreement/readme/CONTRIBUTORS.rst
-
6agreement/readme/DESCRIPTION.rst
-
9agreement/security/agreement_security.xml
-
6agreement/views/agreement.xml
-
54agreement/views/agreement_type.xml
-
9agreement_legal/models/agreement.py
-
3agreement_legal/models/agreement_type.py
-
2agreement_legal/security/res_groups.xml
-
31agreement_legal/views/agreement_type.xml
-
9agreement_legal_sale/views/sale_order.xml
-
2agreement_sale/__manifest__.py
-
1agreement_sale/models/__init__.py
-
14agreement_sale/models/res_config_settings.py
-
6agreement_sale/models/sale.py
-
2agreement_sale/security/ir.model.access.csv
-
2agreement_sale/views/agreement.xml
-
48agreement_sale/views/res_config_settings.xml
-
19agreement_sale/views/sale_order.xml
@ -1 +1,2 @@ |
|||
from . import agreement |
|||
from . import agreement_type |
@ -0,0 +1,12 @@ |
|||
# Copyright (C) 2018 - TODAY, Pavlov Media |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
from odoo import fields, models |
|||
|
|||
|
|||
class AgreementType(models.Model): |
|||
_name = "agreement.type" |
|||
_description = "Agreement Types" |
|||
|
|||
name = fields.Char(string="Name", required=True) |
|||
active = fields.Boolean(default=True) |
@ -1,2 +1,3 @@ |
|||
* Alexis de Lattre <alexis.delattre@akretion.com> |
|||
* Yves Goldberg <yves@ygol.com> |
|||
* Alexandre Fayolle <alexandre.fayolle@camptocamp.com> |
@ -0,0 +1,54 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- Agreement Type List View--> |
|||
<record model="ir.ui.view" id="agreement_type_list_view"> |
|||
<field name="name">Agreement Type List</field> |
|||
<field name="model">agreement.type</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Agreement Types" default_order="name"> |
|||
<field name="name" string="Type Name"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<!-- Agreement Type Form View --> |
|||
<record model="ir.ui.view" id="agreement_type_form_view"> |
|||
<field name="name">Agreement Type Form</field> |
|||
<field name="model">agreement.type</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Agreement Type"> |
|||
<div class="oe_button_box" name="button_box"> |
|||
<button name="toggle_active" type="object" |
|||
class="oe_stat_button" icon="fa-archive"> |
|||
<field name="active" widget="boolean_button" |
|||
options='{"terminology": "archive"}'/> |
|||
</button> |
|||
</div> |
|||
<sheet> |
|||
<div class="oe_title"> |
|||
<label for="name" class="oe_edit_only"/> |
|||
<h1><field name="name"/></h1> |
|||
</div> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="agreement_type_search" model="ir.ui.view"> |
|||
<field name="name">agreement.type.search</field> |
|||
<field name="model">agreement.type</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Agreement Type"> |
|||
<field name="name"/> |
|||
<filter name="archived" string="Archived" domain="[('active', '=', False)]"/> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<!-- Actions opening views on models --> |
|||
<record model="ir.actions.act_window" id="agreement_type_action"> |
|||
<field name="name">Agreement Types</field> |
|||
<field name="res_model">agreement.type</field> |
|||
<field name="view_mode">tree,form</field> |
|||
</record> |
|||
</odoo> |
@ -1 +1,2 @@ |
|||
from . import sale |
|||
from . import res_config_settings |
@ -0,0 +1,14 @@ |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ResConfigSettings(models.TransientModel): |
|||
_inherit = 'res.config.settings' |
|||
|
|||
group_use_agreement_type = fields.Boolean( |
|||
'Use agreement types', |
|||
implied_group='agreement.group_use_agreement_type' |
|||
) |
|||
group_use_agreement_template = fields.Boolean( |
|||
'Use agreement template', |
|||
implied_group='agreement.group_use_agreement_template' |
|||
) |
@ -1,2 +1,4 @@ |
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
|||
agreement.access_agreement_full,Full access on agreement grp,agreement.model_agreement,sales_team.group_sale_manager,1,1,1,1 |
|||
agreement_sale.access_agreement_type_full,Full access on agreement type grp,agreement.model_agreement_type,sales_team.group_sale_manager,1,1,1,1 |
|||
agreement_sale.access_agreement_type_read,Read access on agreement grp,agreement.model_agreement_type,base.group_user,1,0,0,0 |
@ -0,0 +1,48 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
|
|||
<record id="res_config_settings_view_form" model="ir.ui.view"> |
|||
<field name="name">res.config.settings.view.form.inherit.agreement</field> |
|||
<field name="model">res.config.settings</field> |
|||
<field name="priority" eval="11"/> |
|||
<field name="inherit_id" ref="sale.res_config_settings_view_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//div[@data-key='sale_management']" position="inside"> |
|||
<h2>Agreements</h2> |
|||
<div class="row mt16 o_settings_container"> |
|||
<div id="sales_settings_agreement_type_group" |
|||
class="col-12 col-lg-6 o_setting_box"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="group_use_agreement_type"/> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<label for="group_use_agreement_type"/> |
|||
<div class="text-muted"> |
|||
Manage agreements by types |
|||
</div> |
|||
<div class="content-group" attrs="{'invisible': [('group_use_agreement_type','=',False)]}"> |
|||
<div class="mt16"> |
|||
<button name="%(agreement.agreement_type_action)d" icon="fa-arrow-right" type="action" string="Agreement types" class="btn-link"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-12 col-md-6 o_setting_box" |
|||
id="sales_settings_agreement_template_group"> |
|||
<div class="col-12 col-lg-6 o_setting_box"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="group_use_agreement_template"/> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<label for="group_use_agreement_template"/> |
|||
<div class="text-muted"> |
|||
Have a special kind of agreements which act as templates |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,19 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<record id="sale_order_agreement_form_view" model="ir.ui.view"> |
|||
<field name="name">sale.order.agreement.form.view</field> |
|||
<field name="model">sale.order</field> |
|||
<field name="inherit_id" ref="sale.view_order_form"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="client_order_ref" position="after"> |
|||
<field name="agreement_id"/> |
|||
</field> |
|||
<field name="partner_id" position="after"> |
|||
<field name="agreement_type_id" |
|||
groups="agreement.group_use_agreement_type" |
|||
/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue