mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[ADD] agreement_maintenance
This commit is contained in:
committed by
Murtaza Mithaiwala
parent
929495172c
commit
cb9c4b8bc2
40
agreement_maintenance/models/agreement_serviceprofile.py
Normal file
40
agreement_maintenance/models/agreement_serviceprofile.py
Normal 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")
|
||||
Reference in New Issue
Block a user