enviromental conditions in calibration

This commit is contained in:
sinergia 2022-11-09 16:33:30 -05:00
parent 1ac2816f39
commit 6929fec5ec
4 changed files with 104 additions and 20 deletions

View File

@ -659,6 +659,30 @@ msgctxt "field:optical_equipment.maintenance,description_activity:"
msgid "Activity"
msgstr "Descripción del Mantenimiento"
msgctxt "field:optical_equipment.maintenance,temperature_min:"
msgid "Temp Min"
msgstr "Temp Min"
msgctxt "field:optical_equipment.maintenance,temperature_max:"
msgid "Temp Max"
msgstr "Temp Max"
msgctxt "field:optical_equipment.maintenance,moisture_min:"
msgid "Moisture Min"
msgstr "Humedad Min"
msgctxt "field:optical_equipment.maintenance,moisture_max:"
msgid "Moisture Max"
msgstr "Humedad Max"
msgctxt "field:optical_equipment.maintenance,moisture_uom:"
msgid "Moisture UOM"
msgstr "Humedad UOM"
msgctxt "field:optical_equipment.maintenance,temperature_uom:"
msgid "Temperature UOM"
msgstr "Temperatura UOM"
msgctxt "field:optical_equipment_maintenance.service,reference:"
msgid "Reference"
msgstr "Referencia"
@ -1031,6 +1055,14 @@ msgctxt "view:optical_equipment.maintenance:"
msgid "Corrective"
msgstr "Correctivo"
msgctxt "view:optical_equipment.maintenance:"
msgid "Enviromental Conditions"
msgstr "Condiciones Ambientales"
msgctxt "view:optical_equipment.maintenance:"
msgid "Graph"
msgstr "Grafíca"
msgctxt "view:optical_equipment.maintenance:"
msgid "Calibration"
msgstr "Calibración"

View File

@ -220,6 +220,23 @@ class Maintenance(Workflow, ModelSQL, ModelView):
description_activity = fields.Char('Activity')
next_maintenance = fields.Function(fields.Date('Next Maintenance'), 'get_next_maintenance')
temperature_min = fields.Float("Temp Min", required=True)
temperature_max = fields.Float("Temp Max", required=True)
temperature_uom = fields.Many2One('product.uom', 'Temperature UOM',required=True,
domain=[('category', '=', Id('optical_equipment', "uom_cat_temperature"))],
states={'invisible': If(Eval('temperature_min') == None, True),
'readonly' : (Eval('state') == 'finished')},
depends=['itemperature_min']
)
moisture_min = fields.Float("Moisture Min", required=True)
moisture_max = fields.Float("Moisture Max", required=True)
moisture_uom = fields.Many2One('product.uom', "Moisture UOM", required=True,
domain=[('category', '=', Id('optical_equipment', 'uom_cat_relative_humedity'))],
states={'invisible' : If(Eval('moisture_min') == None, True),
'readonly': Eval('state') == 'finished'},
depends=['moisture_min']
)
graph_calibration = fields.Binary('Graphs')
@ -293,6 +310,22 @@ class Maintenance(Workflow, ModelSQL, ModelView):
def default_check_calibration(self):
return True
@fields.depends('temperature_min', 'temperature_uom')
def on_change_temperature_min(self):
if self.temperature_min:
pool = Pool()
Measurements = pool.get('product.uom')
self.temperature_uom = Measurements.search(['name', '=', 'Celsius'])[0].id
@fields.depends('moisture_min', 'moisture_uom')
def on_change_moisture_min(self):
pool = Pool()
Measurements = pool.get('product.uom')
self.moisture_uom = Measurements.search(['name', '=', 'Relative Humedity'])[0].id
def get_next_maintenance(self, action):
next_maintenance = None
if self.service_maintenance.estimated_agended:

View File

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
<office:meta><meta:creation-date>2022-10-11T16:28:51.101948480</meta:creation-date><dc:date>2022-11-08T21:17:39.171982622</dc:date><meta:editing-duration>PT4H7M49S</meta:editing-duration><meta:editing-cycles>47</meta:editing-cycles><meta:generator>LibreOffice/7.3.6.2$Linux_X86_64 LibreOffice_project/30$Build-2</meta:generator><meta:document-statistic meta:table-count="8" meta:image-count="1" meta:object-count="0" meta:page-count="2" meta:paragraph-count="65" meta:word-count="271" meta:character-count="3077" meta:non-whitespace-character-count="2861"/></office:meta>
<office:meta><meta:creation-date>2022-10-11T16:28:51.101948480</meta:creation-date><dc:date>2022-11-09T16:09:59.035898686</dc:date><meta:editing-duration>PT4H10M58S</meta:editing-duration><meta:editing-cycles>48</meta:editing-cycles><meta:generator>LibreOffice/7.3.6.2$Linux_X86_64 LibreOffice_project/30$Build-2</meta:generator><meta:document-statistic meta:table-count="8" meta:image-count="1" meta:object-count="0" meta:page-count="2" meta:paragraph-count="65" meta:word-count="271" meta:character-count="2933" meta:non-whitespace-character-count="2717"/></office:meta>
<office:settings>
<config:config-item-set config:name="ooo:view-settings">
<config:config-item config:name="ViewAreaTop" config:type="long">34463</config:config-item>
<config:config-item config:name="ViewAreaTop" config:type="long">5290</config:config-item>
<config:config-item config:name="ViewAreaLeft" config:type="long">0</config:config-item>
<config:config-item config:name="ViewAreaWidth" config:type="long">34851</config:config-item>
<config:config-item config:name="ViewAreaHeight" config:type="long">16028</config:config-item>
<config:config-item config:name="ViewAreaHeight" config:type="long">15291</config:config-item>
<config:config-item config:name="ShowRedlineChanges" config:type="boolean">true</config:config-item>
<config:config-item config:name="InBrowseMode" config:type="boolean">false</config:config-item>
<config:config-item-map-indexed config:name="Views">
<config:config-item-map-entry>
<config:config-item config:name="ViewId" config:type="string">view2</config:config-item>
<config:config-item config:name="ViewLeft" config:type="long">17425</config:config-item>
<config:config-item config:name="ViewTop" config:type="long">44390</config:config-item>
<config:config-item config:name="ViewLeft" config:type="long">19819</config:config-item>
<config:config-item config:name="ViewTop" config:type="long">14568</config:config-item>
<config:config-item config:name="VisibleLeft" config:type="long">0</config:config-item>
<config:config-item config:name="VisibleTop" config:type="long">34463</config:config-item>
<config:config-item config:name="VisibleTop" config:type="long">5290</config:config-item>
<config:config-item config:name="VisibleRight" config:type="long">34849</config:config-item>
<config:config-item config:name="VisibleBottom" config:type="long">50490</config:config-item>
<config:config-item config:name="VisibleBottom" config:type="long">20579</config:config-item>
<config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
<config:config-item config:name="ViewLayoutColumns" config:type="short">1</config:config-item>
<config:config-item config:name="ViewLayoutBookMode" config:type="boolean">false</config:config-item>
@ -88,7 +88,7 @@
<config:config-item config:name="ChartAutoUpdate" config:type="boolean">true</config:config-item>
<config:config-item config:name="PrinterSetup" config:type="base64Binary"/>
<config:config-item config:name="AddParaTableSpacingAtStart" config:type="boolean">true</config:config-item>
<config:config-item config:name="Rsid" config:type="int">4119373</config:config-item>
<config:config-item config:name="Rsid" config:type="int">4127259</config:config-item>
<config:config-item config:name="EmbeddedDatabaseName" config:type="string"/>
<config:config-item config:name="FieldAutoUpdate" config:type="boolean">true</config:config-item>
<config:config-item config:name="OutlineLevelYieldsNumbering" config:type="boolean">false</config:config-item>
@ -159,7 +159,7 @@
<office:styles>
<style:default-style style:family="graphic">
<style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
<style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:font-independent-line-spacing="false">
<style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
<style:tab-stops/>
</style:paragraph-properties>
<style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="es" fo:country="CO" style:letter-kerning="true" style:font-name-asian="Droid Sans Fallback" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Droid Sans Devanagari1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
@ -301,16 +301,16 @@
<text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/>
<text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/>
<text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/>
<number:currency-style style:name="N108P0" style:volatile="true">
<number:currency-style style:name="N122P0" style:volatile="true">
<number:currency-symbol number:language="es" number:country="CO">$</number:currency-symbol>
<number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
</number:currency-style>
<number:currency-style style:name="N108">
<number:currency-style style:name="N122">
<style:text-properties fo:color="#ff0000"/>
<number:text>-</number:text>
<number:currency-symbol number:language="es" number:country="CO">$</number:currency-symbol>
<number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
<style:map style:condition="value()&gt;=0" style:apply-style-name="N108P0"/>
<style:map style:condition="value()&gt;=0" style:apply-style-name="N122P0"/>
</number:currency-style>
<style:default-page-layout>
<style:page-layout-properties style:writing-mode="lr-tb" style:layout-grid-standard-mode="true"/>
@ -882,8 +882,8 @@
<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
<style:text-properties style:font-name="Droid Sans Japanese1" fo:font-size="8pt" fo:font-style="normal" fo:font-weight="normal" officeooo:paragraph-rsid="003b2e2b" style:font-size-asian="8pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="8pt" style:font-style-complex="normal" style:font-weight-complex="normal"/>
</style:style>
<style:style style:name="P106" style:family="paragraph" style:parent-style-name="Frame_20_contents">
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
<style:style style:name="P106" style:family="paragraph" style:parent-style-name="Standard">
<style:text-properties style:font-name="Droid Sans Japanese1" fo:font-size="8pt" fo:font-weight="normal" officeooo:rsid="001b9ac0" officeooo:paragraph-rsid="003efa1b" style:font-size-asian="8pt" style:font-weight-asian="normal" style:font-name-complex="Arial" style:font-size-complex="8pt" style:font-weight-complex="normal"/>
</style:style>
<style:style style:name="P107" style:family="paragraph">
<style:paragraph-properties fo:text-align="center"/>
@ -1660,7 +1660,7 @@
<text:p text:style-name="Standard"/>
</style:header>
<style:footer>
<text:p text:style-name="P1"><text:span text:style-name="T1">Pagina</text:span> <text:page-number text:select-page="current">1</text:page-number></text:p>
<text:p text:style-name="P1"><text:span text:style-name="T1">Pagina</text:span> <text:page-number text:select-page="current">2</text:page-number></text:p>
</style:footer>
</style:master-page>
</office:master-styles>
@ -1746,13 +1746,13 @@
<text:p text:style-name="P63">Temperatura Min</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tabla6.A2" office:value-type="string">
<text:p text:style-name="P102"><text:placeholder text:placeholder-type="text" text:description="str(maintenance.equipment.product.temperature_min) + str(maintenance.equipment.product.temperature_uom.symbol) if maintenance.equipment.product.temperature_min else &quot;&quot;">&lt;str(maintenance.equipment.product.temperature_min) + str(maintenance.equipment.product.temperature_uom.symbol) if maintenance.equipment.product.temperature_min else &quot;&quot;&gt;</text:placeholder></text:p>
<text:p text:style-name="P102"><text:placeholder text:placeholder-type="text" text:description="str(maintenance.temperature_min) + str(maintenance.temperature_uom.symbol) if maintenance.temperature_min else &quot;&quot;">&lt;str(maintenance.temperature_min) + str(maintenance.temperature_uom.symbol) if maintenance.temperature_min else &quot;&quot;&gt;</text:placeholder></text:p>
</table:table-cell>
<table:table-cell table:style-name="Tabla6.A2" office:value-type="string">
<text:p text:style-name="P63">Humedad Min</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tabla6.D2" office:value-type="string">
<text:p text:style-name="P102"><text:placeholder text:placeholder-type="text" text:description="str(maintenance.equipment.product.moisture_min) + str(maintenance.equipment.product.moisture_uom.symbol) if maintenance.equipment.product.moisture_min else &quot;&quot;">&lt;str(maintenance.equipment.product.moisture_min) + str(maintenance.equipment.product.moisture_uom.symbol) if maintenance.equipment.product.moisture_min else &quot;&quot;&gt;</text:placeholder></text:p>
<text:p text:style-name="P102"><text:placeholder text:placeholder-type="text" text:description="str(maintenance.moisture_min) + str(maintenance.equipment.product.moisture_uom.symbol) if maintenance.moisture_min else &quot;&quot;">&lt;str(maintenance.moisture_min) + str(maintenance.equipment.product.moisture_uom.symbol) if maintenance.moisture_min else &quot;&quot;&gt;</text:placeholder></text:p>
</table:table-cell>
</table:table-row>
<table:table-row>
@ -1760,13 +1760,13 @@
<text:p text:style-name="P63">Temperatura Max</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tabla6.A2" office:value-type="string">
<text:p text:style-name="P103"><text:placeholder text:placeholder-type="text" text:description="str(maintenance.equipment.product.temperature_max) + str(maintenance.equipment.product.temperature_uom.symbol) if maintenance.equipment.product.temperature_max else &quot;&quot;">&lt;str(maintenance.equipment.product.temperature_max) + str(maintenance.equipment.product.temperature_uom.symbol) if maintenance.equipment.product.temperature_max else &quot;&quot;&gt;</text:placeholder></text:p>
<text:p text:style-name="P106"><text:placeholder text:placeholder-type="text" text:description="str(maintenance.temperature_max) + str(maintenance.temperature_uom.symbol) if maintenance.temperature_max else &quot;&quot;">&lt;str(maintenance.temperature_max) + str(maintenance.temperature_uom.symbol) if maintenance.temperature_max else &quot;&quot;&gt;</text:placeholder></text:p>
</table:table-cell>
<table:table-cell table:style-name="Tabla6.A2" office:value-type="string">
<text:p text:style-name="P63">Humedad Max</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tabla6.D2" office:value-type="string">
<text:p text:style-name="P102"><text:placeholder text:placeholder-type="text" text:description="str(maintenance.equipment.product.moisture_max) + str(maintenance.equipment.product.moisture_uom.symbol) if maintenance.equipment.product.moisture_max else &quot;&quot;">&lt;str(maintenance.equipment.product.moisture_max) + str(maintenance.equipment.product.moisture_uom.symbol) if maintenance.equipment.product.moisture_max else &quot;&quot;&gt;</text:placeholder></text:p>
<text:p text:style-name="P106"><text:placeholder text:placeholder-type="text" text:description="str(maintenance.moisture_max) + str(maintenance.equipment.product.moisture_uom.symbol) if maintenance.moisture_max else &quot;&quot;">&lt;str(maintenance.moisture_max) + str(maintenance.equipment.product.moisture_uom.symbol) if maintenance.moisture_max else &quot;&quot;&gt;</text:placeholder></text:p>
</table:table-cell>
</table:table-row>
</table:table>
@ -1861,7 +1861,6 @@
</table:table-cell>
<table:covered-table-cell/>
</table:table-row>
<text:soft-page-break/>
<table:table-row>
<table:table-cell table:style-name="Tabla1.A3" office:value-type="string">
<text:p text:style-name="P89"><text:placeholder text:placeholder-type="text">&lt;line.diopter&gt;</text:placeholder></text:p>
@ -1879,6 +1878,7 @@
<text:p text:style-name="P88"><text:placeholder text:placeholder-type="text" text:description="line.state">&lt;line.state&gt;</text:placeholder></text:p>
</table:table-cell>
</table:table-row>
<text:soft-page-break/>
<table:table-row table:style-name="Tabla1.4">
<table:table-cell table:style-name="Tabla1.A4" table:number-columns-spanned="5" office:value-type="string">
<text:p text:style-name="P104"><text:placeholder text:placeholder-type="text">&lt;/for&gt;</text:placeholder></text:p>

View File

@ -39,6 +39,25 @@
<page string="Corrective" id="corrective">
<field name="maintenance_lines"/>
</page>
<page string="Enviromental Conditions" id="enviromental_conditions_calibration">
<group col="4" colspan="4" id="conditions">
<label name="temperature_min"/>
<field name="temperature_min"/>
<newline/>
<label name="temperature_max"/>
<field name="temperature_max"/>
<label name="temperature_uom"/>
<field name="temperature_uom"/>
<newline/>
<label name="moisture_min"/>
<field name="moisture_min"/>
<newline/>
<label name="moisture_max"/>
<field name="moisture_max"/>
<label name="moisture_uom"/>
<field name="moisture_uom"/>
</group>
</page>
<page string="Calibration" id="calibration">
<label name="patterns_equipments"/>
<field name="patterns_equipments"/>