diff --git a/agreement_legal/data/agreement_stage.xml b/agreement_legal/data/agreement_stage.xml index cef2b25e..66e399ef 100644 --- a/agreement_legal/data/agreement_stage.xml +++ b/agreement_legal/data/agreement_stage.xml @@ -4,46 +4,55 @@ New 10 + agreement Draft 20 + agreement Reviewed 30 + agreement Negotiation 40 + agreement Out for Customer Signature 50 + agreement Waiting Internal Signature 60 + agreement Active 70 + agreement Expired 80 + agreement Cancelled 100 True + agreement diff --git a/agreement_legal/i18n/agreement_legal.pot b/agreement_legal/i18n/agreement_legal.pot index f94f0290..fee1fa92 100644 --- a/agreement_legal/i18n/agreement_legal.pot +++ b/agreement_legal/i18n/agreement_legal.pot @@ -77,6 +77,7 @@ msgid "Advanced Features" msgstr "" #. module: agreement_legal +#: selection:agreement.stage,stage_type:0 #: 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_clause__agreement_id @@ -930,8 +931,8 @@ msgstr "" #. module: agreement_legal #: 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 msgid "New" msgstr "" @@ -1338,6 +1339,11 @@ msgstr "" msgid "Sequence" msgstr "" +#. module: agreement_legal +#: selection:agreement.stage,stage_type:0 +msgid "Service Profile" +msgstr "" + #. module: agreement_legal #: model:ir.actions.act_window,name:agreement_legal.action_agreement_config #: model:ir.ui.menu,name:agreement_legal.agreement_settings @@ -1539,7 +1545,7 @@ msgstr "" #. module: agreement_legal #: 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 "" #. module: agreement_legal @@ -1558,6 +1564,11 @@ msgstr "" msgid "Title:" msgstr "" +#. module: agreement_legal +#: model:ir.model.fields,field_description:agreement_legal.field_agreement_stage__stage_type +msgid "Type" +msgstr "" + #. module: agreement_legal #: model_terms:ir.ui.view,arch_db:agreement_legal.partner_agreement_type_list_view msgid "Type Name" diff --git a/agreement_legal/models/agreement.py b/agreement_legal/models/agreement.py index fb5f1205..9421dafe 100644 --- a/agreement_legal/models/agreement.py +++ b/agreement_legal/models/agreement.py @@ -309,7 +309,8 @@ class Agreement(models.Model): # 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_ids = self.env["agreement.stage"].search( + [('stage_type', '=', 'agreement')]) return stage_ids stage_id = fields.Many2one( diff --git a/agreement_legal/models/agreement_stage.py b/agreement_legal/models/agreement_stage.py index 05cbb459..2c42106f 100644 --- a/agreement_legal/models/agreement_stage.py +++ b/agreement_legal/models/agreement_stage.py @@ -24,5 +24,8 @@ class AgreementStage(models.Model): fold = fields.Boolean( string="Is Folded", 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) diff --git a/agreement_legal/views/agreement.xml b/agreement_legal/views/agreement.xml index 72774995..f339d1aa 100644 --- a/agreement_legal/views/agreement.xml +++ b/agreement_legal/views/agreement.xml @@ -36,7 +36,7 @@
diff --git a/agreement_legal/views/agreement_stages.xml b/agreement_legal/views/agreement_stages.xml index fdb41380..30168d2e 100644 --- a/agreement_legal/views/agreement_stages.xml +++ b/agreement_legal/views/agreement_stages.xml @@ -9,6 +9,7 @@ + @@ -26,6 +27,7 @@
+
diff --git a/agreement_serviceprofile/README.rst b/agreement_serviceprofile/README.rst index d77abf28..9d588487 100644 --- a/agreement_serviceprofile/README.rst +++ b/agreement_serviceprofile/README.rst @@ -64,6 +64,7 @@ Contributors * Maxime Chambreuil * Sandip Mangukiya * Serpent Consulting Services Pvt. Ltd. +* Brian McMaster Maintainers ~~~~~~~~~~~ diff --git a/agreement_serviceprofile/__manifest__.py b/agreement_serviceprofile/__manifest__.py index 58748f12..4e104fd5 100644 --- a/agreement_serviceprofile/__manifest__.py +++ b/agreement_serviceprofile/__manifest__.py @@ -13,6 +13,7 @@ 'license': 'AGPL-3', 'depends': ['agreement_legal'], 'data': [ + 'data/serviceprofile_stage.xml', 'security/ir.model.access.csv', 'views/agreement_serviceprofile.xml', 'views/agreement.xml' diff --git a/agreement_serviceprofile/data/serviceprofile_stage.xml b/agreement_serviceprofile/data/serviceprofile_stage.xml new file mode 100644 index 00000000..584c47e5 --- /dev/null +++ b/agreement_serviceprofile/data/serviceprofile_stage.xml @@ -0,0 +1,41 @@ + + + + + Draft + 10 + serviceprofile + + + + In Progress + 20 + serviceprofile + + + + Suspended + 30 + serviceprofile + + + + To Renew + 40 + serviceprofile + + + + Closed + 50 + serviceprofile + + + + Cancelled + 60 + True + serviceprofile + + + diff --git a/agreement_serviceprofile/i18n/agreement_serviceprofile.pot b/agreement_serviceprofile/i18n/agreement_serviceprofile.pot index bb4fde1e..8f61bafb 100644 --- a/agreement_serviceprofile/i18n/agreement_serviceprofile.pot +++ b/agreement_serviceprofile/i18n/agreement_serviceprofile.pot @@ -24,6 +24,7 @@ msgid "Add Notes Here..." msgstr "" #. module: agreement_serviceprofile +#: selection:agreement.stage,stage_type:0 #: model:ir.model,name:agreement_serviceprofile.model_agreement #: 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 @@ -35,6 +36,11 @@ msgstr "" msgid "Agreement Service Profiles" msgstr "" +#. module: agreement_serviceprofile +#: model:ir.model,name:agreement_serviceprofile.model_agreement_stage +msgid "Agreement Stages" +msgstr "" + #. module: agreement_serviceprofile #: model:ir.model.fields,field_description:agreement_serviceprofile.field_agreement_serviceprofile__create_uid msgid "Created by" @@ -87,16 +93,34 @@ msgid "Notes" msgstr "" #. 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 msgid "Service Profile" msgstr "" #. module: agreement_serviceprofile #: 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.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_serviceprofile_tree msgid "Service Profiles" 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 "" + diff --git a/agreement_serviceprofile/models/__init__.py b/agreement_serviceprofile/models/__init__.py index a0e6354c..b0ff00e0 100644 --- a/agreement_serviceprofile/models/__init__.py +++ b/agreement_serviceprofile/models/__init__.py @@ -1,2 +1,3 @@ from . import agreement_serviceprofile from . import agreement +from . import agreement_stage diff --git a/agreement_serviceprofile/models/agreement_serviceprofile.py b/agreement_serviceprofile/models/agreement_serviceprofile.py index a645b5ee..3ec22e8d 100644 --- a/agreement_serviceprofile/models/agreement_serviceprofile.py +++ b/agreement_serviceprofile/models/agreement_serviceprofile.py @@ -2,14 +2,20 @@ # 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): _name = 'agreement.serviceprofile' _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) + 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", ondelete="cascade") active = fields.Boolean(string="Active", @@ -19,3 +25,12 @@ class AgreementServiceProfile(models.Model): " without removing it.") 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 diff --git a/agreement_serviceprofile/models/agreement_stage.py b/agreement_serviceprofile/models/agreement_stage.py new file mode 100644 index 00000000..cf578022 --- /dev/null +++ b/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')] + ) diff --git a/agreement_serviceprofile/readme/CONTRIBUTORS.rst b/agreement_serviceprofile/readme/CONTRIBUTORS.rst index 1869cddb..4f31127a 100644 --- a/agreement_serviceprofile/readme/CONTRIBUTORS.rst +++ b/agreement_serviceprofile/readme/CONTRIBUTORS.rst @@ -4,3 +4,4 @@ * Maxime Chambreuil * Sandip Mangukiya * Serpent Consulting Services Pvt. Ltd. +* Brian McMaster diff --git a/agreement_serviceprofile/static/description/index.html b/agreement_serviceprofile/static/description/index.html index b1dcbc81..e0a3d9b0 100644 --- a/agreement_serviceprofile/static/description/index.html +++ b/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
  • Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
  • Sandip Mangukiya <smangukiya@opensourceintegrators.com>
  • Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
  • +
  • Brian McMaster <brian@mcmpest.com>
  • diff --git a/agreement_serviceprofile/views/agreement_serviceprofile.xml b/agreement_serviceprofile/views/agreement_serviceprofile.xml index f8c1571f..e227240e 100644 --- a/agreement_serviceprofile/views/agreement_serviceprofile.xml +++ b/agreement_serviceprofile/views/agreement_serviceprofile.xml @@ -9,6 +9,7 @@ + @@ -20,6 +21,12 @@ agreement.serviceprofile
    +
    + +