[ADD] agreement_maintenance

This commit is contained in:
Bhavesh Odedra
2018-10-26 22:55:31 +05:30
committed by Murtaza Mithaiwala
parent 929495172c
commit cb9c4b8bc2
18 changed files with 381 additions and 0 deletions

View File

@@ -0,0 +1,129 @@
==========
Agreements
==========
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github
:target: https://github.com/OCA/contract/tree/11.0/agreement
:alt: OCA/contract
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-agreement
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/110/11.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
This module allows you to manage agreements, letter of intent and contract content.
The module is meant to be used by the legal team of a company and to allow them
to define sections, clauses and templates with their respective content that can
be dynamic.
Based on the template, an agreement can be created and the pdf document generated.
The agreement would go through a workflow to finally become a contract with the
customer signature.
**Table of contents**
.. contents::
:local:
Configuration
=============
To configure this module:
* Go to Agreement > Configuration > Templates
* Create a new template with sections and clauses and their respective content
* Go to Agreement > Configuration > Stages
* Create and reorder stages to match your process
Usage
=====
To use this module:
* Go to Agreement > Agrements
* Create a new agreement
* Select a template
* Follow the process to get the required approval
* Send the invitation to the customer to review and sign the agreement
Known issues / Roadmap
======================
* Split the module to remove the dependencies on sale and account and provide
the same feature in extra modules (agreement_sale, agreement_account,
agreement_purchase)
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20agreement%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Pavlov Media
* Open Source Integrators
Contributors
~~~~~~~~~~~~
* Patrick Wilson <pwilson@pavlovmedia.com>
* Bhavesh Odedra <bodedra@opensourceintegrators.com>
* Wolfgang Hall <whall@opensourceintegrators.com>
* Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
Other credits
~~~~~~~~~~~~~
The development of this module has been financially supported by:
* Pavlov Media
* Open Source Integrators
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
.. |maintainer-max3903| image:: https://github.com/max3903.png?size=40px
:target: https://github.com/max3903
:alt: max3903
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-max3903|
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/11.0/agreement>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -0,0 +1,4 @@
# Copyright (C) 2018 - TODAY, Pavlov Media
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models

View File

@@ -0,0 +1,29 @@
# Copyright (C) 2018 - TODAY, Pavlov Media
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Maintenance Agreements',
'summary': 'Manage maintenance agreements and contracts',
'author': 'Pavlov Media, '
'Open Source Integrators, '
'Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/contract',
'category': 'Partner',
'license': 'AGPL-3',
'version': '11.0.0.0.1',
'depends': [
'agreement',
'maintenance',
'fieldservice',
],
'data': [
'security/ir.model.access.csv',
'views/agreement.xml',
'views/agreement_serviceprofile.xml',
'views/product.xml',
'views/menu.xml',
],
'application': False,
'development_status': 'Beta',
'maintainers': ['max3903'],
}

View File

@@ -0,0 +1,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import (
agreement,
product_template,
agreement_serviceprofile,
)

View File

@@ -0,0 +1,15 @@
# Copyright (C) 2018 - TODAY, Pavlov Media
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class Agreement(models.Model):
_inherit = 'agreement'
serviceprofile_ids = fields.One2many(
'agreement.serviceprofile',
'agreement_id',
string="Service Profile",
copy=True
)

View File

@@ -0,0 +1,40 @@
# Copyright (C) 2018 - TODAY, Pavlov Media
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
PROFILE_TYPE = [
('equipment', 'Equipment'),
('product', 'Product')
]
class AgreementServiceProfile(models.Model):
_name = 'agreement.serviceprofile'
name = fields.Char(string="Name", required=True)
profile_type = fields.Selection(
PROFILE_TYPE,
string="Profile Type")
description = fields.Text(string="Description")
equipment_id = fields.Many2one(
'maintenance.equipment',
string="Equipment")
product_id = fields.Many2one(
'product.product',
string="Product",
domain=[('serviceprofile_ok', '=', True)])
equipment_category_id = fields.Many2one(
'maintenance.equipment.category',
related='equipment_id.category_id',
string="Equipment Category",
readonly=1)
agreement_id = fields.Many2one(
'agreement',
string="Agreement",
ondelete="cascade",
required=True)
fsm_location_id = fields.Many2one(
'fsm.location',
string="Service Location")

View File

@@ -0,0 +1,14 @@
# Copyright (C) 2018 - TODAY, Pavlov Media
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
class Product(models.Model):
_inherit = 'product.template'
serviceprofile_ok = fields.Boolean(
string='Include on Service Profile',
default=False,
help="Specify if the product can be selected in a service profile line"
)

View File

@@ -0,0 +1,6 @@
To configure this module:
* Go to Agreement > Configuration > Templates
* Create a new template with sections and clauses and their respective content
* Go to Agreement > Configuration > Stages
* Create and reorder stages to match your process

View File

@@ -0,0 +1,4 @@
* Patrick Wilson <pwilson@pavlovmedia.com>
* Bhavesh Odedra <bodedra@opensourceintegrators.com>
* Wolfgang Hall <whall@opensourceintegrators.com>
* Maxime Chambreuil <mchambreuil@opensourceintegrators.com>

View File

@@ -0,0 +1,4 @@
The development of this module has been financially supported by:
* Pavlov Media
* Open Source Integrators

View File

@@ -0,0 +1 @@
This module allows you to manage maintenance agreements and contracts.

View File

@@ -0,0 +1,7 @@
To use this module:
* Go to Agreement > Agrements
* Create a new agreement
* Select a template
* Follow the process to get the required approval
* Send the invitation to the customer to review and sign the agreement

View File

@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_agreement_serviceprofile_allusers,serviceprofile all users,model_agreement_serviceprofile,agreement.group_agreement_user,1,0,0,0
access_agreement_serviceprofile_manager,serviceprofile manager,model_agreement_serviceprofile,agreement.group_agreement_manager,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_agreement_serviceprofile_allusers serviceprofile all users model_agreement_serviceprofile agreement.group_agreement_user 1 0 0 0
3 access_agreement_serviceprofile_manager serviceprofile manager model_agreement_serviceprofile agreement.group_agreement_manager 1 1 1 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<odoo>
<!-- Agreement Form View -->
<record model="ir.ui.view" id="agreement_form_view">
<field name="name">Agreement Form</field>
<field name="model">agreement</field>
<field name="inherit_id" ref="agreement.partner_agreement_form_view"/>
<field name="arch" type="xml">
<xpath expr="//notebook/page[@name='products']/group"
position="after">
<group string="Service Profiles">
<field name="serviceprofile_ids" nolabel="1">
<tree>
<field name="name"/>
<field name="profile_type"/>
<field name="equipment_id"/>
<field name="product_id"/>
<field name="fsm_location_id"/>
</tree>
</field>
</group>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,63 @@
<?xml version="1.0"?>
<odoo>
<!-- Agreement Service Profile List View-->
<record model="ir.ui.view" id="agreement_serviceprofile_list_view">
<field name="name">Agreement Service Profile List</field>
<field name="model">agreement.serviceprofile</field>
<field name="arch" type="xml">
<tree string="Service Profiles"
create="false" edit="false">
<field name="name"/>
<field name="profile_type"/>
<field name="equipment_id"/>
<field name="product_id"/>
<field name="fsm_location_id"/>
<field name="agreement_id"/>
</tree>
</field>
</record>
<!-- Agreement Service Profile Form View -->
<record model="ir.ui.view" id="agreement_serviceprofile_form_view">
<field name="name">Agreement Service Profile Form</field>
<field name="model">agreement.serviceprofile</field>
<field name="arch" type="xml">
<form string="Service Profile"
create="false" edit="false">
<sheet>
<div class="oe_title">
<h1>
<field name="name" placeholder="Name"/>
</h1>
</div>
<group>
<group>
<field name="profile_type"/>
<field name="equipment_id"
attrs="{'invisible': [('profile_type', '!=', 'equipment')]}"/>
<field name="equipment_category_id"
attrs="{'invisible': [('profile_type', '!=', 'equipment')]}"/>
<field name="product_id"
attrs="{'invisible': [('profile_type', '!=', 'product')]}"/>
</group>
<group>
<field name="fsm_location_id"/>
</group>
</group>
<group string="Description">
<field name="description" nolabel="1"/>
</group>
</sheet>
</form>
</field>
</record>
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="agreement_action_serviceprofile">
<field name="name">Agreement Service Profile</field>
<field name="res_model">agreement.serviceprofile</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<odoo>
<!-- Master Data -->
<menuitem name="Service Profiles"
id="agreement_service_profiles"
sequence="30"
parent="agreement.agreement_masterdata"
action="agreement_action_serviceprofile"/>
</odoo>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<odoo>
<record model="ir.ui.view" id="product_template_serviceprofile_form_view">
<field name="name">product.template.common.serviceprofile.ok.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<div name="options" position="inside">
<div>
<field name="serviceprofile_ok"/>
<label for="serviceprofile_ok"/>
</div>
</div>
</field>
</record>
</odoo>