add model measurements

This commit is contained in:
sinergia 2022-06-19 23:10:08 -05:00
parent 012985815c
commit 52797612ce
4 changed files with 39 additions and 2 deletions

View File

@ -1,5 +1,6 @@
from trytond.pool import Pool from trytond.pool import Pool
from . import party, product, purchase, sale, equipment, subscription from . import (party, product, purchase, sale,
equipment, subscription, measurements)
def register(): def register():
Pool.register( Pool.register(
@ -12,4 +13,5 @@ def register():
equipment.OpticalEquipment, equipment.OpticalEquipment,
subscription.Subscription, subscription.Subscription,
subscription.SubscriptionEquipment, subscription.SubscriptionEquipment,
measurements.Measurements,
module='optical_equipment', type_='model') module='optical_equipment', type_='model')

View File

@ -1,4 +1,17 @@
# 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 PoolMeta from trytond.pool import PoolMeta
class Measurements(metaclass=PoolMeta): class Measurements(metaclass=PoolMeta):
__name__ = 'product.measurements' __name__ = 'product.template'
temperature = fields.Float("Temperature")
temperature_uom = fields.Many2One('product.uom', "Temperature UOM")
voltageAC = fields.Float("Voltage AC")
voltageAC_uom = fields.Many2One('product.uom', "Voltage AC UOM")
voltageDC = fields.Float("Voltage DC")
voltageDC_uom = fields.Many2One('product.uom', "Voltage DC UOM")

9
measurements.xml Normal file
View File

@ -0,0 +1,9 @@
<?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>

View File

@ -40,4 +40,17 @@ this repository contains the full copyright notices and license terms. -->
<field name="observation"/> <field name="observation"/>
</page> </page>
</xpath> </xpath>
<xpath expr="/form/notebook/page[@id='measurements']" position="inside">
<label name="temperature"/>
<field name="temperature"/>
<field name="temperature_uom"/>
<label name="voltageAC"/>
<field name="voltageAC"/>
<field name="voltageAC_uom"/>
<label name="voltageDC"/>
<field name="voltageDC"/>
<field name="voltageDC_uom"/>
</xpath>
</data> </data>