delete model measurements and put in model product
This commit is contained in:
parent
5dce5130ce
commit
7b5cdd61b0
@ -1,6 +1,6 @@
|
||||
from trytond.pool import Pool
|
||||
from . import (address, party, product, purchase, sale,
|
||||
equipment, subscription, measurements)
|
||||
equipment, subscription)
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
@ -14,5 +14,4 @@ def register():
|
||||
equipment.OpticalEquipment,
|
||||
subscription.Subscription,
|
||||
subscription.SubscriptionEquipment,
|
||||
measurements.Template,
|
||||
module='optical_equipment', type_='model')
|
||||
|
@ -1,25 +0,0 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.model import fields
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Id
|
||||
from trytond.exceptions import UserError
|
||||
|
||||
class Template(metaclass=PoolMeta):
|
||||
__name__ = 'product.template'
|
||||
|
||||
temperature = fields.Float("Temperature")
|
||||
temperature_uom = fields.Many2One('product.uom', 'Temperature UOM',
|
||||
domain=[('category', '=', Id('optical_equipment', "uom_cat_temperature"))])
|
||||
frequency = fields.Float("Frequency")
|
||||
frequency_uom = fields.Many2One('product.uom', "Frequency UOM",
|
||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_frequency'))])
|
||||
wet = fields.Float("Wet")
|
||||
wet_uom = fields.Many2One('product.uom', "Wet UOM",
|
||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_relative_humedity'))])
|
||||
voltageAC = fields.Float("Voltage AC")
|
||||
voltageAC_uom = fields.Many2One('product.uom', "Voltage AC UOM",
|
||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_electrical_tension'))])
|
||||
voltageDC = fields.Float("Voltage DC")
|
||||
voltageDC_uom = fields.Many2One('product.uom', "Voltage DC UOM",
|
||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_electrical_tension'))])
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--This file file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<record model="ir.ui.view" id="template_view_form">
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit" ref="product.template_view_form"/>
|
||||
<field name="name">template_form</field>
|
||||
</record>
|
||||
</tryton>
|
24
product.py
24
product.py
@ -6,8 +6,8 @@ from sql.operators import Equal
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.model import (
|
||||
ModelView, ModelSQL, fields, Exclude)
|
||||
from trytond.pyson import If, Eval
|
||||
|
||||
from trytond.pyson import If, Eval, Id
|
||||
from trytond.exceptions import UserError
|
||||
|
||||
|
||||
|
||||
@ -64,6 +64,26 @@ class Template(metaclass=PoolMeta):
|
||||
"Health_Register", size=None)
|
||||
refurbish = fields.Boolean('Refurbish')
|
||||
|
||||
#These are measurements required for the equipments, are in this place
|
||||
# for manage of class 'product.template'
|
||||
temperature = fields.Float("Temperature")
|
||||
temperature_uom = fields.Many2One('product.uom', 'Temperature UOM',
|
||||
domain=[('category', '=', Id('optical_equipment', "uom_cat_temperature"))])
|
||||
frequency = fields.Float("Frequency")
|
||||
frequency_uom = fields.Many2One('product.uom', "Frequency UOM",
|
||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_frequency'))])
|
||||
wet = fields.Float("Wet")
|
||||
wet_uom = fields.Many2One('product.uom', "Wet UOM",
|
||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_relative_humedity'))])
|
||||
voltageAC = fields.Float("Voltage AC")
|
||||
voltageAC_uom = fields.Many2One('product.uom', "Voltage AC UOM",
|
||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_electrical_tension'))])
|
||||
voltageDC = fields.Float("Voltage DC")
|
||||
voltageDC_uom = fields.Many2One('product.uom', "Voltage DC UOM",
|
||||
domain=[('category', '=', Id('optical_equipment', 'uom_cat_electrical_tension'))])
|
||||
|
||||
|
||||
|
||||
@staticmethod
|
||||
def default_equipment():
|
||||
return False
|
||||
|
@ -15,7 +15,6 @@ xml:
|
||||
address.xml
|
||||
party.xml
|
||||
product.xml
|
||||
measurements.xml
|
||||
equipment.xml
|
||||
sale.xml
|
||||
purchase.xml
|
||||
|
Loading…
Reference in New Issue
Block a user