mirror of
https://github.com/Kalenis/kalenislims.git
synced 2023-12-14 07:13:04 +01:00
lims_industry: Component: show Plant and Party
This commit is contained in:
parent
23faac959b
commit
be95881f11
4 changed files with 20 additions and 0 deletions
|
@ -210,6 +210,8 @@ class Component(ModelSQL, ModelView):
|
||||||
internal_id = fields.Char('Internal ID Code')
|
internal_id = fields.Char('Internal ID Code')
|
||||||
customer_description = fields.Char('Customer description')
|
customer_description = fields.Char('Customer description')
|
||||||
year_manufacturing = fields.Integer('Year of manufacturing')
|
year_manufacturing = fields.Integer('Year of manufacturing')
|
||||||
|
plant = fields.Function(fields.Many2One('lims.plant', 'Plant'),
|
||||||
|
'get_plant', searcher='search_plant')
|
||||||
party = fields.Function(fields.Many2One('party.party', 'Party'),
|
party = fields.Function(fields.Many2One('party.party', 'Party'),
|
||||||
'get_party', searcher='search_party')
|
'get_party', searcher='search_party')
|
||||||
|
|
||||||
|
@ -227,6 +229,14 @@ class Component(ModelSQL, ModelView):
|
||||||
res += ' - ' + self.model
|
res += ' - ' + self.model
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
def get_plant(self, name):
|
||||||
|
if self.equipment:
|
||||||
|
return self.equipment.plant.id
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def search_plant(cls, name, clause):
|
||||||
|
return [('equipment.plant',) + tuple(clause[1:])]
|
||||||
|
|
||||||
def get_party(self, name):
|
def get_party(self, name):
|
||||||
if self.equipment:
|
if self.equipment:
|
||||||
return self.equipment.plant.party.id
|
return self.equipment.plant.party.id
|
||||||
|
|
|
@ -70,6 +70,10 @@ msgctxt "field:lims.component,party:"
|
||||||
msgid "Party"
|
msgid "Party"
|
||||||
msgstr "Tercero"
|
msgstr "Tercero"
|
||||||
|
|
||||||
|
msgctxt "field:lims.component,plant:"
|
||||||
|
msgid "Plant"
|
||||||
|
msgstr "Planta"
|
||||||
|
|
||||||
msgctxt "field:lims.component,power:"
|
msgctxt "field:lims.component,power:"
|
||||||
msgid "Power"
|
msgid "Power"
|
||||||
msgstr "Potencia"
|
msgstr "Potencia"
|
||||||
|
|
|
@ -4,6 +4,10 @@
|
||||||
<field name="type"/>
|
<field name="type"/>
|
||||||
<label name="equipment"/>
|
<label name="equipment"/>
|
||||||
<field name="equipment"/>
|
<field name="equipment"/>
|
||||||
|
<label name="plant"/>
|
||||||
|
<field name="plant"/>
|
||||||
|
<label name="party"/>
|
||||||
|
<field name="party"/>
|
||||||
<label name="brand"/>
|
<label name="brand"/>
|
||||||
<field name="brand"/>
|
<field name="brand"/>
|
||||||
<label name="model"/>
|
<label name="model"/>
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
<field name="model"/>
|
<field name="model"/>
|
||||||
<field name="serial_number"/>
|
<field name="serial_number"/>
|
||||||
<field name="internal_id"/>
|
<field name="internal_id"/>
|
||||||
|
<field name="plant" expand="1"/>
|
||||||
|
<field name="party" expand="1"/>
|
||||||
<field name="customer_description"/>
|
<field name="customer_description"/>
|
||||||
<field name="capacity"/>
|
<field name="capacity"/>
|
||||||
<field name="power"/>
|
<field name="power"/>
|
||||||
|
|
Loading…
Reference in a new issue