update to 4.0

This commit is contained in:
?ngel ?lvarez 2017-08-25 12:01:35 +02:00
parent 765082f2d0
commit 8eba1b2195
8 changed files with 18 additions and 23 deletions

View File

@ -1,17 +1,17 @@
# The COPYRIGHT file at the top level of this repository contains the full # The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms. # copyright notices and license terms.
from trytond.pool import Pool from trytond.pool import Pool
from .drawing import * from . import drawing
from .bom import * from . import bom
from .production import * from . import production
def register(): def register():
Pool.register( Pool.register(
Drawing, drawing.Drawing,
DrawingPosition, drawing.DrawingPosition,
BOM, bom.BOM,
BOMDrawingLine, bom.BOMDrawingLine,
Production, production.Production,
ProductionDrawingLine, production.ProductionDrawingLine,
module='production_drawing', type_='model') module='production_drawing', type_='model')

View File

@ -45,13 +45,11 @@
</record> </record>
<record model="ir.ui.view" id="bom_view_form"> <record model="ir.ui.view" id="bom_view_form">
<field name="model">production.bom</field> <field name="model">production.bom</field>
<field name="type">form</field>
<field name="inherit" ref="production.bom_view_form"/> <field name="inherit" ref="production.bom_view_form"/>
<field name="name">bom_form</field> <field name="name">bom_form</field>
</record> </record>
<record model="ir.ui.view" id="bom_view_list"> <record model="ir.ui.view" id="bom_view_list">
<field name="model">production.bom</field> <field name="model">production.bom</field>
<field name="type">tree</field>
<field name="inherit" ref="production.bom_view_list"/> <field name="inherit" ref="production.bom_view_list"/>
<field name="name">bom_list</field> <field name="name">bom_list</field>
</record> </record>

View File

@ -25,13 +25,11 @@ class Production:
cls.bom.on_change.add('drawing_lines') cls.bom.on_change.add('drawing_lines')
def on_change_bom(self): def on_change_bom(self):
res = super(Production, self).on_change_bom() super(Production, self).on_change_bom()
res['drawing'] = self.on_change_with_drawing()
self.drawing = (self.bom.drawing.id if self.bom and self.bom.drawing self.drawing = (self.bom.drawing.id if self.bom and self.bom.drawing
else None) else None)
res['drawing_image'] = self.on_change_with_drawing_image() self.on_change_with_drawing_image()
res['drawing_lines'] = self.on_change_with_drawing_lines() self.on_change_with_drawing_lines()
return res
@fields.depends('drawing') @fields.depends('drawing')
def on_change_with_drawing_lines(self): def on_change_with_drawing_lines(self):
@ -66,8 +64,8 @@ class Production:
production.drawing_lines = [] production.drawing_lines = []
for line in production.bom.drawing_lines: for line in production.bom.drawing_lines:
production.drawing_lines.append(Line( production.drawing_lines.append(Line(
position = line.position, position=line.position,
product = line.product, product=line.product,
)) ))
return production return production

View File

@ -43,7 +43,6 @@
<record model="ir.ui.view" id="production_view_form"> <record model="ir.ui.view" id="production_view_form">
<field name="model">production</field> <field name="model">production</field>
<field name="type">form</field>
<field name="inherit" ref="production.production_view_form"/> <field name="inherit" ref="production.production_view_form"/>
<field name="name">production_form</field> <field name="name">production_form</field>
</record> </record>

View File

@ -1,5 +1,5 @@
[tryton] [tryton]
version=3.4.0 version=4.0
depends: depends:
production production
extras_depend: extras_depend:

View File

@ -12,7 +12,7 @@
<field name="drawing_lines" colspan="4" yexpand="1"/> <field name="drawing_lines" colspan="4" yexpand="1"/>
</group> </group>
<group col="1" id="drawing_image" yexpand="1"> <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> </group>
</page> </page>
</xpath> </xpath>

View File

@ -11,7 +11,7 @@
<field name="positions" colspan="4" yexpand="1"/> <field name="positions" colspan="4" yexpand="1"/>
</group> </group>
<group col="1" id="image" yexpand="1"> <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>
</group> </group>
</form> </form>

View File

@ -10,7 +10,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="drawing_lines" colspan="4" yexpand="1"/> <field name="drawing_lines" colspan="4" yexpand="1"/>
</group> </group>
<group col="1" id="drawing_image" yexpand="1"> <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> </group>
</page> </page>
</xpath> </xpath>