mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[11.0][RM] agreement_maintenance module
This commit is contained in:
committed by
Murtuza Saleh
parent
e681dae56b
commit
6437b39f66
@@ -1,7 +0,0 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import (
|
||||
agreement,
|
||||
product_template,
|
||||
agreement_serviceprofile,
|
||||
)
|
||||
@@ -1,15 +0,0 @@
|
||||
# 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
|
||||
)
|
||||
@@ -1,40 +0,0 @@
|
||||
# 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")
|
||||
@@ -1,14 +0,0 @@
|
||||
# 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"
|
||||
)
|
||||
Reference in New Issue
Block a user