Tower: upload tk_construction_management 18.0.2.0.8 (was 18.0.2.0.8, via marketplace)
This commit is contained in:
26
addons/tk_construction_management/models/con_template.py
Normal file
26
addons/tk_construction_management/models/con_template.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2020-Today TechKhedut.
|
||||
# Part of TechKhedut. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ConstructionTemplate(models.Model):
|
||||
_name = 'construction.product.template'
|
||||
_description = "Product Template"
|
||||
|
||||
name = fields.Char(string="Title")
|
||||
template_ids = fields.One2many('construction.template.line', 'template_id')
|
||||
|
||||
|
||||
class ConstructionTemplateLine(models.Model):
|
||||
_name = 'construction.template.line'
|
||||
_description = "Product Template Line"
|
||||
|
||||
product_id = fields.Many2one('product.product', string="Product", domain="[('is_material','=',True)]")
|
||||
name = fields.Char(string="Description")
|
||||
template_id = fields.Many2one('construction.product.template')
|
||||
|
||||
@api.onchange('product_id')
|
||||
def _onchange_product_desc(self):
|
||||
for rec in self:
|
||||
rec.name = rec.product_id.name
|
||||
Reference in New Issue
Block a user