diff --git a/__init__.py b/__init__.py
index c849a77..57b6124 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1,7 +1,9 @@
from trytond.pool import Pool
from . import product
+from . import sale
def register():
Pool.register(
product.Template,
+ sale.SaleLine,
module='optical_equipment', type_='model')
diff --git a/product.py b/product.py
index 0af0210..172f604 100644
--- a/product.py
+++ b/product.py
@@ -23,7 +23,7 @@ _MAIN_TECNOLOGY = [('mecanico', 'Mecánico'),
('hidraulico', 'Hidraulico'),
('neumatico', 'Neumatico')]
-_MACHINE_TYPE = [('mobiliario_optico', 'Mobiliario óptico'),
+_EQUIPMENT_TYPE = [('mobiliario_optico', 'Mobiliario óptico'),
('refraccion', 'Refracción'),
('medico', 'Medicion'),
('accesorios', 'Accesorios')]
@@ -33,8 +33,8 @@ class Template(metaclass=PoolMeta):
'Template'
__name__ = 'product.template'
- machine = fields.Boolean('It is machine')
- machine_type = fields.Selection(_MACHINE_TYPE, 'Machine type')
+ equipment = fields.Boolean('It is equipment')
+ equipment_type = fields.Selection(_EQUIPMENT_TYPE, 'Equipment type')
risk = fields.Selection(_RISK, 'Type risk')
use = fields.Selection(_USE, 'Use')
biomedical_class = fields.Selection(_BIOMEDICAL_CLASS,
@@ -42,26 +42,10 @@ class Template(metaclass=PoolMeta):
main_tecnology = fields.Selection(_MAIN_TECNOLOGY,
'Main tecnology')
calibration = fields.Boolean("Apply calibration")
- observation = fields.Text(size=None)
- mark_category = fields.Many2One('product.category', 'Mark')
- model_category = fields.Many2One('product.category', "Model",
- domain=[Eval('parent')])
- reference = fields.Char("Reference", size=None, required=True)
- origin_country = fields.Many2One('country.country',"Origin Country")
- software_version = fields.Char(
- "Origin country", size=None, required=True)
- useful_life = fields.Char(
- "Useful life", size=None, required=True)
- warranty = fields.Char(
- "Warranty", size=None, required=True)
- serial = fields.Char(
- "Serial", size=None, required=True)
- health_register = fields.Char(
- "Serial", size=None, required=True)
- refurbish = fields.Boolean('Refurbish')
+ observation = fields.Text('Observation')
@staticmethod
- def default_machine():
+ def default_equipment():
return False
@staticmethod
@@ -97,6 +81,6 @@ class Template(metaclass=PoolMeta):
def view_attributes(cls):
return super(Template, cls).view_attributes() + [
('//page[@id="features"]', 'states', {
- 'invisible': ~Eval('machine'),
+ 'invisible': ~Eval('equipment'),
})]
diff --git a/sale.py b/sale.py
index 58e2921..384e286 100644
--- a/sale.py
+++ b/sale.py
@@ -1,6 +1,24 @@
+from trytond.pool import Pool, PoolMeta
from trytond.model import ModelView, ModelSQL
+from trytond.model import fields
class SaleLine(ModelSQL, ModelView, metaclass=PoolMeta):
'SaleLine'
__name__ = 'sale.line'
+
+ mark_category = fields.Many2One('product.category', 'Mark')
+ model_category = fields.Many2One('product.category', "Model")
+ reference = fields.Char("Reference", size=None, required=True)
+ origin_country = fields.Many2One('country.country',"Origin Country")
+ software_version = fields.Char(
+ "Origin country", size=None, required=True)
+ useful_life = fields.Char(
+ "Useful life", size=None, required=True)
+ warranty = fields.Char(
+ "Warranty", size=None, required=True)
+ serial = fields.Char(
+ "Serial", size=None, required=True)
+ health_register = fields.Char(
+ "Serial", size=None, required=True)
+ refurbish = fields.Boolean('Refurbish')
diff --git a/sale.xml b/sale.xml
new file mode 100644
index 0000000..2e63451
--- /dev/null
+++ b/sale.xml
@@ -0,0 +1,9 @@
+
+
+
+
+ sale.line
+
+ sale_line_form
+
+
diff --git a/tryton.cfg b/tryton.cfg
index 0d5c9de..55c6d6b 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -3,6 +3,8 @@ version=6.0
depends:
ir
product
+ sale
country
xml:
- product.xml
\ No newline at end of file
+ product.xml
+ sale.xml
\ No newline at end of file
diff --git a/view/sale_line_form.xml b/view/sale_line_form.xml
new file mode 100644
index 0000000..2f35b76
--- /dev/null
+++ b/view/sale_line_form.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/view/template_form.xml b/view/template_form.xml
index 3215d4b..5d08c15 100644
--- a/view/template_form.xml
+++ b/view/template_form.xml
@@ -3,11 +3,15 @@
this repository contains the full copyright notices and license terms. -->
-
-
+
+
+
+
+
+
@@ -16,6 +20,8 @@ this repository contains the full copyright notices and license terms. -->
+
+