Browse Source

Merge PR #355 into 12.0

Signed-off-by max3903
pull/368/head
OCA-git-bot 5 years ago
parent
commit
a5a049315b
  1. 9
      agreement_legal/data/agreement_stage.xml
  2. 17
      agreement_legal/i18n/agreement_legal.pot
  3. 3
      agreement_legal/models/agreement.py
  4. 5
      agreement_legal/models/agreement_stage.py
  5. 2
      agreement_legal/views/agreement.xml
  6. 2
      agreement_legal/views/agreement_stages.xml
  7. 1
      agreement_serviceprofile/README.rst
  8. 1
      agreement_serviceprofile/__manifest__.py
  9. 41
      agreement_serviceprofile/data/serviceprofile_stage.xml
  10. 24
      agreement_serviceprofile/i18n/agreement_serviceprofile.pot
  11. 1
      agreement_serviceprofile/models/__init__.py
  12. 17
      agreement_serviceprofile/models/agreement_serviceprofile.py
  13. 12
      agreement_serviceprofile/models/agreement_stage.py
  14. 1
      agreement_serviceprofile/readme/CONTRIBUTORS.rst
  15. 1
      agreement_serviceprofile/static/description/index.html
  16. 46
      agreement_serviceprofile/views/agreement_serviceprofile.xml

9
agreement_legal/data/agreement_stage.xml

@ -4,46 +4,55 @@
<record id="agreement_stage_new" model="agreement.stage"> <record id="agreement_stage_new" model="agreement.stage">
<field name="name">New</field> <field name="name">New</field>
<field name="sequence">10</field> <field name="sequence">10</field>
<field name="stage_type">agreement</field>
</record> </record>
<record id="agreement_stage_draft" model="agreement.stage"> <record id="agreement_stage_draft" model="agreement.stage">
<field name="name">Draft</field> <field name="name">Draft</field>
<field name="sequence">20</field> <field name="sequence">20</field>
<field name="stage_type">agreement</field>
</record> </record>
<record id="agreement_stage_reviewed" model="agreement.stage"> <record id="agreement_stage_reviewed" model="agreement.stage">
<field name="name">Reviewed</field> <field name="name">Reviewed</field>
<field name="sequence">30</field> <field name="sequence">30</field>
<field name="stage_type">agreement</field>
</record> </record>
<record id="agreement_stage_negotiation" model="agreement.stage"> <record id="agreement_stage_negotiation" model="agreement.stage">
<field name="name">Negotiation</field> <field name="name">Negotiation</field>
<field name="sequence">40</field> <field name="sequence">40</field>
<field name="stage_type">agreement</field>
</record> </record>
<record id="agreement_stage_out" model="agreement.stage"> <record id="agreement_stage_out" model="agreement.stage">
<field name="name">Out for Customer Signature</field> <field name="name">Out for Customer Signature</field>
<field name="sequence">50</field> <field name="sequence">50</field>
<field name="stage_type">agreement</field>
</record> </record>
<record id="agreement_stage_internal" model="agreement.stage"> <record id="agreement_stage_internal" model="agreement.stage">
<field name="name">Waiting Internal Signature</field> <field name="name">Waiting Internal Signature</field>
<field name="sequence">60</field> <field name="sequence">60</field>
<field name="stage_type">agreement</field>
</record> </record>
<record id="agreement_stage_active" model="agreement.stage"> <record id="agreement_stage_active" model="agreement.stage">
<field name="name">Active</field> <field name="name">Active</field>
<field name="sequence">70</field> <field name="sequence">70</field>
<field name="stage_type">agreement</field>
</record> </record>
<record id="agreement_stage_expired" model="agreement.stage"> <record id="agreement_stage_expired" model="agreement.stage">
<field name="name">Expired</field> <field name="name">Expired</field>
<field name="sequence">80</field> <field name="sequence">80</field>
<field name="stage_type">agreement</field>
</record> </record>
<record id="agreement_stage_cancelled" model="agreement.stage"> <record id="agreement_stage_cancelled" model="agreement.stage">
<field name="name">Cancelled</field> <field name="name">Cancelled</field>
<field name="sequence">100</field> <field name="sequence">100</field>
<field name="fold">True</field> <field name="fold">True</field>
<field name="stage_type">agreement</field>
</record> </record>
</odoo> </odoo>

17
agreement_legal/i18n/agreement_legal.pot

@ -77,6 +77,7 @@ msgid "Advanced Features"
msgstr "" msgstr ""
#. module: agreement_legal #. module: agreement_legal
#: selection:agreement.stage,stage_type:0
#: model:ir.model,name:agreement_legal.model_agreement #: model:ir.model,name:agreement_legal.model_agreement
#: model:ir.model.fields,field_description:agreement_legal.field_agreement_appendix__agreement_id #: model:ir.model.fields,field_description:agreement_legal.field_agreement_appendix__agreement_id
#: model:ir.model.fields,field_description:agreement_legal.field_agreement_clause__agreement_id #: model:ir.model.fields,field_description:agreement_legal.field_agreement_clause__agreement_id
@ -930,8 +931,8 @@ msgstr ""
#. module: agreement_legal #. module: agreement_legal
#: code:addons/agreement_legal/models/agreement.py:84 #: code:addons/agreement_legal/models/agreement.py:84
#: code:addons/agreement_legal/models/agreement.py:364
#: code:addons/agreement_legal/models/agreement.py:367
#: code:addons/agreement_legal/models/agreement.py:365
#: code:addons/agreement_legal/models/agreement.py:368
#, python-format #, python-format
msgid "New" msgid "New"
msgstr "" msgstr ""
@ -1338,6 +1339,11 @@ msgstr ""
msgid "Sequence" msgid "Sequence"
msgstr "" msgstr ""
#. module: agreement_legal
#: selection:agreement.stage,stage_type:0
msgid "Service Profile"
msgstr ""
#. module: agreement_legal #. module: agreement_legal
#: model:ir.actions.act_window,name:agreement_legal.action_agreement_config #: model:ir.actions.act_window,name:agreement_legal.action_agreement_config
#: model:ir.ui.menu,name:agreement_legal.agreement_settings #: model:ir.ui.menu,name:agreement_legal.agreement_settings
@ -1539,7 +1545,7 @@ msgstr ""
#. module: agreement_legal #. module: agreement_legal
#: model:ir.model.fields,help:agreement_legal.field_agreement_stage__fold #: model:ir.model.fields,help:agreement_legal.field_agreement_stage__fold
msgid "This stage is folded in the kanban view by deafault."
msgid "This stage is folded in the kanban view by default."
msgstr "" msgstr ""
#. module: agreement_legal #. module: agreement_legal
@ -1558,6 +1564,11 @@ msgstr ""
msgid "Title:" msgid "Title:"
msgstr "" msgstr ""
#. module: agreement_legal
#: model:ir.model.fields,field_description:agreement_legal.field_agreement_stage__stage_type
msgid "Type"
msgstr ""
#. module: agreement_legal #. module: agreement_legal
#: model_terms:ir.ui.view,arch_db:agreement_legal.partner_agreement_type_list_view #: model_terms:ir.ui.view,arch_db:agreement_legal.partner_agreement_type_list_view
msgid "Type Name" msgid "Type Name"

3
agreement_legal/models/agreement.py

@ -309,7 +309,8 @@ class Agreement(models.Model):
# Used for Kanban grouped_by view # Used for Kanban grouped_by view
@api.model @api.model
def _read_group_stage_ids(self, stages, domain, order): def _read_group_stage_ids(self, stages, domain, order):
stage_ids = self.env["agreement.stage"].search([])
stage_ids = self.env["agreement.stage"].search(
[('stage_type', '=', 'agreement')])
return stage_ids return stage_ids
stage_id = fields.Many2one( stage_id = fields.Many2one(

5
agreement_legal/models/agreement_stage.py

@ -24,5 +24,8 @@ class AgreementStage(models.Model):
fold = fields.Boolean( fold = fields.Boolean(
string="Is Folded", string="Is Folded",
required=False, required=False,
help="This stage is folded in the kanban view by deafault.",
help="This stage is folded in the kanban view by default.",
) )
stage_type = fields.Selection(
[('agreement', 'Agreement')],
string='Type', required=True)

2
agreement_legal/views/agreement.xml

@ -36,7 +36,7 @@
<header> <header>
<button string="New Version" type="object" name="create_new_version" class="oe_highlight" attrs="{'invisible': [('state', '=', 'active')]}"/> <button string="New Version" type="object" name="create_new_version" class="oe_highlight" attrs="{'invisible': [('state', '=', 'active')]}"/>
<button string="New Agreement" type="object" name="create_new_agreement" class="oe_highlight" attrs="{'invisible': [('is_template', '=', False)]}"/> <button string="New Agreement" type="object" name="create_new_agreement" class="oe_highlight" attrs="{'invisible': [('is_template', '=', False)]}"/>
<field name="stage_id" widget="statusbar" clickable="True" options="{'fold_field': 'fold'}"/>
<field name="stage_id" widget="statusbar" clickable="True" options="{'fold_field': 'fold'}" domain="[('stage_type', '=', 'agreement')]"/>
</header> </header>
<sheet> <sheet>
<div class="oe_button_box" name="button_box"> <div class="oe_button_box" name="button_box">

2
agreement_legal/views/agreement_stages.xml

@ -9,6 +9,7 @@
<tree default_order='sequence, name'> <tree default_order='sequence, name'>
<field name="sequence" widget="handle"/> <field name="sequence" widget="handle"/>
<field name="name" string="Stage Name"/> <field name="name" string="Stage Name"/>
<field name="stage_type"/>
</tree> </tree>
</field> </field>
</record> </record>
@ -26,6 +27,7 @@
</div> </div>
<group> <group>
<field name="sequence"/> <field name="sequence"/>
<field name="stage_type"/>
<field name="fold"/> <field name="fold"/>
</group> </group>
</sheet> </sheet>

1
agreement_serviceprofile/README.rst

@ -64,6 +64,7 @@ Contributors
* Maxime Chambreuil <mchambreuil@opensourceintegrators.com> * Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
* Sandip Mangukiya <smangukiya@opensourceintegrators.com> * Sandip Mangukiya <smangukiya@opensourceintegrators.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com> * Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
* Brian McMaster <brian@mcmpest.com>
Maintainers Maintainers
~~~~~~~~~~~ ~~~~~~~~~~~

1
agreement_serviceprofile/__manifest__.py

@ -13,6 +13,7 @@
'license': 'AGPL-3', 'license': 'AGPL-3',
'depends': ['agreement_legal'], 'depends': ['agreement_legal'],
'data': [ 'data': [
'data/serviceprofile_stage.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'views/agreement_serviceprofile.xml', 'views/agreement_serviceprofile.xml',
'views/agreement.xml' 'views/agreement.xml'

41
agreement_serviceprofile/data/serviceprofile_stage.xml

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">
<record id="servpro_stage_draft" model="agreement.stage">
<field name="name">Draft</field>
<field name="sequence">10</field>
<field name="stage_type">serviceprofile</field>
</record>
<record id="servpro_stage_progress" model="agreement.stage">
<field name="name">In Progress</field>
<field name="sequence">20</field>
<field name="stage_type">serviceprofile</field>
</record>
<record id="servpro_stage_suspend" model="agreement.stage">
<field name="name">Suspended</field>
<field name="sequence">30</field>
<field name="stage_type">serviceprofile</field>
</record>
<record id="servpro_stage_renew" model="agreement.stage">
<field name="name">To Renew</field>
<field name="sequence">40</field>
<field name="stage_type">serviceprofile</field>
</record>
<record id="servpro_stage_close" model="agreement.stage">
<field name="name">Closed</field>
<field name="sequence">50</field>
<field name="stage_type">serviceprofile</field>
</record>
<record id="servpro_stage_cancel" model="agreement.stage">
<field name="name">Cancelled</field>
<field name="sequence">60</field>
<field name="fold">True</field>
<field name="stage_type">serviceprofile</field>
</record>
</odoo>

24
agreement_serviceprofile/i18n/agreement_serviceprofile.pot

@ -24,6 +24,7 @@ msgid "Add Notes Here..."
msgstr "" msgstr ""
#. module: agreement_serviceprofile #. module: agreement_serviceprofile
#: selection:agreement.stage,stage_type:0
#: model:ir.model,name:agreement_serviceprofile.model_agreement #: model:ir.model,name:agreement_serviceprofile.model_agreement
#: model:ir.model.fields,field_description:agreement_serviceprofile.field_agreement_serviceprofile__agreement_id #: model:ir.model.fields,field_description:agreement_serviceprofile.field_agreement_serviceprofile__agreement_id
#: model_terms:ir.ui.view,arch_db:agreement_serviceprofile.agreement_serviceprofile_search #: model_terms:ir.ui.view,arch_db:agreement_serviceprofile.agreement_serviceprofile_search
@ -35,6 +36,11 @@ msgstr ""
msgid "Agreement Service Profiles" msgid "Agreement Service Profiles"
msgstr "" msgstr ""
#. module: agreement_serviceprofile
#: model:ir.model,name:agreement_serviceprofile.model_agreement_stage
msgid "Agreement Stages"
msgstr ""
#. module: agreement_serviceprofile #. module: agreement_serviceprofile
#: model:ir.model.fields,field_description:agreement_serviceprofile.field_agreement_serviceprofile__create_uid #: model:ir.model.fields,field_description:agreement_serviceprofile.field_agreement_serviceprofile__create_uid
msgid "Created by" msgid "Created by"
@ -87,16 +93,34 @@ msgid "Notes"
msgstr "" msgstr ""
#. module: agreement_serviceprofile #. module: agreement_serviceprofile
#: model:ir.model.fields,field_description:agreement_serviceprofile.field_agreement_serviceprofile__product_id
msgid "Service"
msgstr ""
#. module: agreement_serviceprofile
#: selection:agreement.stage,stage_type:0
#: model_terms:ir.ui.view,arch_db:agreement_serviceprofile.agreement_serviceprofile_form #: model_terms:ir.ui.view,arch_db:agreement_serviceprofile.agreement_serviceprofile_form
msgid "Service Profile" msgid "Service Profile"
msgstr "" msgstr ""
#. module: agreement_serviceprofile #. module: agreement_serviceprofile
#: model:ir.actions.act_window,name:agreement_serviceprofile.agreement_serviceprofile_action #: model:ir.actions.act_window,name:agreement_serviceprofile.agreement_serviceprofile_action
#: model:ir.actions.act_window,name:agreement_serviceprofile.agreement_serviceprofile_dashboard
#: model:ir.model.fields,field_description:agreement_serviceprofile.field_agreement__serviceprofile_ids #: model:ir.model.fields,field_description:agreement_serviceprofile.field_agreement__serviceprofile_ids
#: model:ir.ui.menu,name:agreement_serviceprofile.agreement_serviceprofiles #: model:ir.ui.menu,name:agreement_serviceprofile.agreement_serviceprofiles
#: model:ir.ui.menu,name:agreement_serviceprofile.dashboard_serviceprofiles
#: model_terms:ir.ui.view,arch_db:agreement_serviceprofile.agreement_fsm_order_form_view #: model_terms:ir.ui.view,arch_db:agreement_serviceprofile.agreement_fsm_order_form_view
#: model_terms:ir.ui.view,arch_db:agreement_serviceprofile.agreement_serviceprofile_tree #: model_terms:ir.ui.view,arch_db:agreement_serviceprofile.agreement_serviceprofile_tree
msgid "Service Profiles" msgid "Service Profiles"
msgstr "" msgstr ""
#. module: agreement_serviceprofile
#: model:ir.model.fields,field_description:agreement_serviceprofile.field_agreement_serviceprofile__stage_id
msgid "Stage"
msgstr ""
#. module: agreement_serviceprofile
#: model:ir.model.fields,field_description:agreement_serviceprofile.field_agreement_stage__stage_type
msgid "Type"
msgstr ""

1
agreement_serviceprofile/models/__init__.py

@ -1,2 +1,3 @@
from . import agreement_serviceprofile from . import agreement_serviceprofile
from . import agreement from . import agreement
from . import agreement_stage

17
agreement_serviceprofile/models/agreement_serviceprofile.py

@ -2,14 +2,20 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
from odoo import fields, models, api
class AgreementServiceProfile(models.Model): class AgreementServiceProfile(models.Model):
_name = 'agreement.serviceprofile' _name = 'agreement.serviceprofile'
_description = 'Agreement Service Profiles' _description = 'Agreement Service Profiles'
def _default_stage_id(self):
return self.env.ref('agreement_serviceprofile.servpro_stage_draft')
name = fields.Char(string="Name", required=True) name = fields.Char(string="Name", required=True)
stage_id = fields.Many2one('agreement.stage', string="Stage",
default=_default_stage_id, copy=False,
group_expand='_read_group_stage_ids',)
agreement_id = fields.Many2one('agreement', string="Agreement", agreement_id = fields.Many2one('agreement', string="Agreement",
ondelete="cascade") ondelete="cascade")
active = fields.Boolean(string="Active", active = fields.Boolean(string="Active",
@ -19,3 +25,12 @@ class AgreementServiceProfile(models.Model):
" without removing it.") " without removing it.")
notes = fields.Text(string="Notes") notes = fields.Text(string="Notes")
product_id = fields.Many2one('product.template', 'Service',
domain="[('type', '=', 'service')]")
# Used for Kanban grouped_by view
@api.model
def _read_group_stage_ids(self, stages, domain, order):
stage_ids = self.env["agreement.stage"].search(
[('stage_type', '=', 'serviceprofile')])
return stage_ids

12
agreement_serviceprofile/models/agreement_stage.py

@ -0,0 +1,12 @@
# Copyright (C) 2019 - TODAY, Brian McMaster
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AgreementStage(models.Model):
_inherit = 'agreement.stage'
stage_type = fields.Selection(
selection_add=[('serviceprofile', 'Service Profile')]
)

1
agreement_serviceprofile/readme/CONTRIBUTORS.rst

@ -4,3 +4,4 @@
* Maxime Chambreuil <mchambreuil@opensourceintegrators.com> * Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
* Sandip Mangukiya <smangukiya@opensourceintegrators.com> * Sandip Mangukiya <smangukiya@opensourceintegrators.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com> * Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
* Brian McMaster <brian@mcmpest.com>

1
agreement_serviceprofile/static/description/index.html

@ -412,6 +412,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Maxime Chambreuil &lt;<a class="reference external" href="mailto:mchambreuil&#64;opensourceintegrators.com">mchambreuil&#64;opensourceintegrators.com</a>&gt;</li> <li>Maxime Chambreuil &lt;<a class="reference external" href="mailto:mchambreuil&#64;opensourceintegrators.com">mchambreuil&#64;opensourceintegrators.com</a>&gt;</li>
<li>Sandip Mangukiya &lt;<a class="reference external" href="mailto:smangukiya&#64;opensourceintegrators.com">smangukiya&#64;opensourceintegrators.com</a>&gt;</li> <li>Sandip Mangukiya &lt;<a class="reference external" href="mailto:smangukiya&#64;opensourceintegrators.com">smangukiya&#64;opensourceintegrators.com</a>&gt;</li>
<li>Serpent Consulting Services Pvt. Ltd. &lt;<a class="reference external" href="mailto:support&#64;serpentcs.com">support&#64;serpentcs.com</a>&gt;</li> <li>Serpent Consulting Services Pvt. Ltd. &lt;<a class="reference external" href="mailto:support&#64;serpentcs.com">support&#64;serpentcs.com</a>&gt;</li>
<li>Brian McMaster &lt;<a class="reference external" href="mailto:brian&#64;mcmpest.com">brian&#64;mcmpest.com</a>&gt;</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">

46
agreement_serviceprofile/views/agreement_serviceprofile.xml

@ -9,6 +9,7 @@
<tree string="Service Profiles" default_order='agreement_id'> <tree string="Service Profiles" default_order='agreement_id'>
<field name="name"/> <field name="name"/>
<field name="agreement_id"/> <field name="agreement_id"/>
<field name="product_id"/>
<field name="active" invisible="1"/> <field name="active" invisible="1"/>
</tree> </tree>
</field> </field>
@ -20,6 +21,12 @@
<field name="model">agreement.serviceprofile</field> <field name="model">agreement.serviceprofile</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Service Profile"> <form string="Service Profile">
<header>
<field name="stage_id" widget="statusbar"
clickable="True"
options="{'fold_field': 'fold'}"
domain="[('stage_type', '=', 'serviceprofile')]"/>
</header>
<sheet> <sheet>
<div class="oe_button_box" name="button_box"> <div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" <button name="toggle_active" type="object"
@ -38,7 +45,9 @@
<group> <group>
<field name="agreement_id"/> <field name="agreement_id"/>
</group> </group>
<group></group>
<group>
<field name="product_id"/>
</group>
</group> </group>
<group string="Notes"> <group string="Notes">
<field name="notes" nolabel="1" widget="html"/> <field name="notes" nolabel="1" widget="html"/>
@ -48,6 +57,28 @@
</field> </field>
</record> </record>
<!-- Agreement Service Profile Kanban View -->
<record id="agreement_serviceprofile_kanban" model="ir.ui.view">
<field name="name">Agreement Service Profile Kanban</field>
<field name="model">agreement.serviceprofile</field>
<field name="arch" type="xml">
<kanban default_group_by="stage_id">
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_content">
<div>
<strong class="o_kanban_record_title">
<field name="name"/>
</strong>
</div>
<div class="oe_clear"/>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- Agreement Service Profile Search View --> <!-- Agreement Service Profile Search View -->
<record id="agreement_serviceprofile_search" model="ir.ui.view"> <record id="agreement_serviceprofile_search" model="ir.ui.view">
<field name="name">Agreement Service Profile Search</field> <field name="name">Agreement Service Profile Search</field>
@ -68,6 +99,12 @@
<field name="view_mode">tree,form</field> <field name="view_mode">tree,form</field>
</record> </record>
<record id="agreement_serviceprofile_dashboard" model="ir.actions.act_window">
<field name="name">Service Profiles</field>
<field name="res_model">agreement.serviceprofile</field>
<field name="view_mode">kanban,tree,form</field>
</record>
<menuitem <menuitem
name="Service Profiles" name="Service Profiles"
id="agreement_serviceprofiles" id="agreement_serviceprofiles"
@ -75,4 +112,11 @@
sequence="50" sequence="50"
action="agreement_serviceprofile_action"/> action="agreement_serviceprofile_action"/>
<menuitem
name="Service Profiles"
id="dashboard_serviceprofiles"
parent="agreement_legal.agreement_dashboard"
sequence="20"
action="agreement_serviceprofile_dashboard"/>
</odoo> </odoo>
Loading…
Cancel
Save