add fields conservation and section

This commit is contained in:
wilson gomez 2021-10-22 14:18:43 -05:00
parent 8971250f22
commit a774127df1
10 changed files with 145 additions and 0 deletions

View File

@ -7,6 +7,7 @@ from . import service_order
from . import party
from . import invoice
from . import api_log
from . import product
def register():
@ -23,6 +24,9 @@ def register():
invoice.InvoiceLine,
api_log.ApiLog,
service_order.CreateInvoiceStart,
product.Section,
product.Conservation,
product.Template,
module='laboratory', type_='model')
Pool.register(
service_order.CreateInvoice,

22
product.py Normal file
View File

@ -0,0 +1,22 @@
# 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, ModelSQL, ModelView
from trytond.pool import PoolMeta
class Section(ModelSQL, ModelView):
'Product Section'
__name__ = 'product.section'
name = fields.Char('Name')
class Conservation(ModelSQL, ModelView):
'Product Conservation'
__name__ = 'product.conservation'
name = fields.Char('Name')
class Template(metaclass=PoolMeta):
__name__ = 'product.template'
section = fields.Many2One('product.section', 'Section')
conservation = fields.Many2One('product.conservation', 'Conservation')

70
product.xml Normal file
View File

@ -0,0 +1,70 @@
<?xml version="1.0"?>
<!-- This file is part product_barcode module for Tryton.
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<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>
<record model="ir.ui.view" id="section_view_tree">
<field name="model">product.section</field>
<field name="type">tree</field>
<field name="priority">10</field>
<field name="name">section_tree</field>
</record>
<record model="ir.ui.view" id="section_view_form">
<field name="model">product.section</field>
<field name="type">form</field>
<field name="name">section_form</field>
</record>
<record model="ir.action.act_window" id="act_section_tree">
<field name="name">section</field>
<field name="res_model">product.section</field>
</record>
<record model="ir.action.act_window.view" id="act_section_tree_view1">
<field name="sequence" eval="1"/>
<field name="view" ref="section_view_tree"/>
<field name="act_window" ref="act_section_tree"/>
</record>
<record model="ir.action.act_window.view" id="act_section_tree_view2">
<field name="sequence" eval="2"/>
<field name="view" ref="section_view_form"/>
<field name="act_window" ref="act_section_tree"/>
</record>
<menuitem parent="product.menu_configuration" sequence="90"
action="act_section_tree" id="menu_section_tree"/>
<record model="ir.ui.view" id="conservation_view_tree">
<field name="model">product.conservation</field>
<field name="type">tree</field>
<field name="priority">10</field>
<field name="name">conservation_tree</field>
</record>
<record model="ir.ui.view" id="conservation_view_form">
<field name="model">product.conservation</field>
<field name="type">form</field>
<field name="name">conservation_form</field>
</record>
<record model="ir.action.act_window" id="act_conservation_tree">
<field name="name">conservation</field>
<field name="res_model">product.conservation</field>
</record>
<record model="ir.action.act_window.view" id="act_conservation_tree_view1">
<field name="sequence" eval="1"/>
<field name="view" ref="conservation_view_tree"/>
<field name="act_window" ref="act_conservation_tree"/>
</record>
<record model="ir.action.act_window.view" id="act_conservation_tree_view2">
<field name="sequence" eval="2"/>
<field name="view" ref="conservation_view_form"/>
<field name="act_window" ref="act_conservation_tree"/>
</record>
<menuitem parent="product.menu_configuration" sequence="90"
action="act_conservation_tree" id="menu_conservation_tree"/>
</data>
</tryton>

View File

@ -13,3 +13,4 @@ xml:
service_order.xml
invoice.xml
api_log.xml
product.xml

View File

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form>
<label name="name"/>
<field name="name"/>
</form>

View File

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="name"/>
</tree>

7
view/section_form.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form>
<label name="name"/>
<field name="name"/>
</form>

6
view/section_tree.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="name"/>
</tree>

12
view/template_form.xml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="/form/field[@name='active']"
position="after">
<label name="section"/>
<field name="section"/>
<label name="conservation"/>
<field name="conservation"/>
</xpath>
</data>

10
view/template_tree.xml Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="/tree/field[@name='name']"
position="after">
<field name="section"/>
<field name="conservation"/>
</xpath>
</data>