[ADD] agreement_maintenance

This commit is contained in:
Bhavesh Odedra
2018-10-26 22:55:31 +05:30
committed by Murtuza Saleh
parent b0f6356e84
commit 0a9bdc0d76
18 changed files with 381 additions and 0 deletions

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"
)