update to 4.0
This commit is contained in:
parent
765082f2d0
commit
8eba1b2195
18
__init__.py
18
__init__.py
|
@ -1,17 +1,17 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
from trytond.pool import Pool
|
||||
from .drawing import *
|
||||
from .bom import *
|
||||
from .production import *
|
||||
from . import drawing
|
||||
from . import bom
|
||||
from . import production
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
Drawing,
|
||||
DrawingPosition,
|
||||
BOM,
|
||||
BOMDrawingLine,
|
||||
Production,
|
||||
ProductionDrawingLine,
|
||||
drawing.Drawing,
|
||||
drawing.DrawingPosition,
|
||||
bom.BOM,
|
||||
bom.BOMDrawingLine,
|
||||
production.Production,
|
||||
production.ProductionDrawingLine,
|
||||
module='production_drawing', type_='model')
|
||||
|
|
2
bom.xml
2
bom.xml
|
@ -45,13 +45,11 @@
|
|||
</record>
|
||||
<record model="ir.ui.view" id="bom_view_form">
|
||||
<field name="model">production.bom</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit" ref="production.bom_view_form"/>
|
||||
<field name="name">bom_form</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="bom_view_list">
|
||||
<field name="model">production.bom</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit" ref="production.bom_view_list"/>
|
||||
<field name="name">bom_list</field>
|
||||
</record>
|
||||
|
|
|
@ -25,13 +25,11 @@ class Production:
|
|||
cls.bom.on_change.add('drawing_lines')
|
||||
|
||||
def on_change_bom(self):
|
||||
res = super(Production, self).on_change_bom()
|
||||
res['drawing'] = self.on_change_with_drawing()
|
||||
super(Production, self).on_change_bom()
|
||||
self.drawing = (self.bom.drawing.id if self.bom and self.bom.drawing
|
||||
else None)
|
||||
res['drawing_image'] = self.on_change_with_drawing_image()
|
||||
res['drawing_lines'] = self.on_change_with_drawing_lines()
|
||||
return res
|
||||
self.on_change_with_drawing_image()
|
||||
self.on_change_with_drawing_lines()
|
||||
|
||||
@fields.depends('drawing')
|
||||
def on_change_with_drawing_lines(self):
|
||||
|
@ -66,8 +64,8 @@ class Production:
|
|||
production.drawing_lines = []
|
||||
for line in production.bom.drawing_lines:
|
||||
production.drawing_lines.append(Line(
|
||||
position = line.position,
|
||||
product = line.product,
|
||||
position=line.position,
|
||||
product=line.product,
|
||||
))
|
||||
return production
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
|
||||
<record model="ir.ui.view" id="production_view_form">
|
||||
<field name="model">production</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit" ref="production.production_view_form"/>
|
||||
<field name="name">production_form</field>
|
||||
</record>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=3.4.0
|
||||
version=4.0
|
||||
depends:
|
||||
production
|
||||
extras_depend:
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<field name="drawing_lines" colspan="4" yexpand="1"/>
|
||||
</group>
|
||||
<group col="1" id="drawing_image" yexpand="1">
|
||||
<field name="drawing_image" widget="image" img_height="300" img_width="200"/>
|
||||
<field name="drawing_image" widget="image"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<field name="positions" colspan="4" yexpand="1"/>
|
||||
</group>
|
||||
<group col="1" id="image" yexpand="1">
|
||||
<field name="image" widget="image" img_height="300" img_width="200"/>
|
||||
<field name="image" widget="image"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
|
|
|
@ -10,7 +10,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="drawing_lines" colspan="4" yexpand="1"/>
|
||||
</group>
|
||||
<group col="1" id="drawing_image" yexpand="1">
|
||||
<field name="drawing_image" widget="image" img_height="300" img_width="200"/>
|
||||
<field name="drawing_image" widget="image"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
|
|
Loading…
Reference in New Issue