mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] agreement_serviceprofile: add stage
- Add stage_type to agreement.stage - Track stage of service profile - Add Kanban view for service profiles to the dashboard - Add product_id field to service profile [UPD] Update agreement_serviceprofile.pot [UPD] README.rst Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: contract-12.0/contract-12.0-agreement_serviceprofile Translate-URL: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_serviceprofile/
This commit is contained in:
committed by
Patrick Wilson
parent
7149c46060
commit
58048a73cc
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user