diff --git a/maintenance.py b/maintenance.py
index 11e5d42..3b49cb0 100644
--- a/maintenance.py
+++ b/maintenance.py
@@ -216,6 +216,8 @@ class Maintenance(Workflow, ModelSQL, ModelView):
service_maintenance = fields.Many2One('optical_equipment_maintenance.service', "Maintenance Service",
ondelete='CASCADE', select=True,
+ domain=[('state', 'in', ['in_progress']),
+ ('propietary', '=', Eval('propietary'))],
states=_states)
code = fields.Char(
"Code", select=True,states={'readonly': True })
@@ -258,8 +260,7 @@ class Maintenance(Workflow, ModelSQL, ModelView):
states={'readonly': Eval('state') == 'finished',
'required': Eval('equipment_calibrate')})
calibration_total = fields.One2Many('optical_equipment.maintenance.calibration', 'maintenance', "Calibration Total",
- states={'readonly': Eval('state') == 'finished',
- 'required': Eval('equipment_calibrate')})
+ states={'readonly': Eval('state') == 'finished'})
maintenance_lines = fields.One2Many('optical_equipment.maintenance.line', 'maintenance', 'Lines')
description_activity = fields.Char('Activity')
next_maintenance = fields.Function(fields.Date('Next Maintenance'), 'get_next_maintenance')
diff --git a/product.py b/product.py
index 2feaa50..57258db 100644
--- a/product.py
+++ b/product.py
@@ -156,7 +156,7 @@ class Template(metaclass=PoolMeta):
#### calibration parameters
use_pattern = fields.Selection([
- ('No Aplíca', ""),
+ ('', ""),
('ojo_esquematico', "Ojo esquematico"),
('lente_prueba', "Lente de Prueba"),
('pesas_calibration', "Pesas de Calibración"),
@@ -296,8 +296,8 @@ class Template(metaclass=PoolMeta):
return False
@staticmethod
- def default_refurbish():
- return False
+ def default_use_pattern():
+ return ''
@staticmethod
def default_refurbish():
@@ -338,12 +338,50 @@ class Template(metaclass=PoolMeta):
if self.electrical_equipment:
self.voltageAC = 0
self.voltageDC = 0
- self.frequency = 0
+ self.frequency = 0
+
+ @classmethod
+ def copy(cls, templates, default=None):
+ if default is None:
+ default = {}
+ else:
+ default = default.copy()
+ default.setdefault('code', None)
+ default.setdefault('images', None)
+ return super().copy(templates, default=default)
+
-
class Product(metaclass=PoolMeta):
__name__ = 'product.product'
+ @classmethod
+ def copy(cls, products, default=None):
+ if default is None:
+ default = {}
+ else:
+ default = default.copy()
+
+ default.setdefault('suffix_code', None)
+ default.setdefault('code', None)
+ default.setdefault('poduct', None)
+ default.setdefault('images', None)
+ return super().copy(products, default=default)
+
+
+class Image(metaclass=PoolMeta):
+ __name__ = 'product.image'
+
+ @classmethod
+ def copy(cls, images, default=None):
+ if default is None:
+ default = {}
+ else:
+ default = default.copy()
+ default.setdefault('template', None)
+ default.setdefault('product', None)
+ return super().copy(images, default=default)
+
+
class Pattern(ModelSQL, ModelView):
"Pattern K of equipment"
@@ -352,3 +390,4 @@ class Pattern(ModelSQL, ModelView):
product = fields.Many2One('product.template', "Template", ondelete='CASCADE')
pattern = fields.Float("Value Pattern")
+
diff --git a/purchase.xml b/purchase.xml
index 29974ee..4c930d0 100644
--- a/purchase.xml
+++ b/purchase.xml
@@ -34,8 +34,6 @@ this repository contains the full copyright notices and license terms. -->
form_print
purchase.purchase,-1
-
-
-
+
diff --git a/report/Purchase.fodt b/report/Purchase.fodt
index 278e100..e572122 100644
--- a/report/Purchase.fodt
+++ b/report/Purchase.fodt
@@ -1,28 +1,28 @@
- LibreOffice/7.3.7.2$Linux_X86_64 LibreOffice_project/30$Build-22008-06-07T15:28:222009-01-10T16:03:321PT0S
+ LibreOffice/7.3.7.2$Linux_X86_64 LibreOffice_project/30$Build-22008-06-07T15:28:222009-01-10T16:03:321PT0S
- 17187
+ 38336
0
- 25652
- 11811
+ 20048
+ 8733
true
false
view2
- 7357
- 18429
+ 1711
+ 4852
0
- 17187
- 25650
- 28997
+ 38336
+ 20047
+ 47068
0
0
false
- 190
+ 170
false
false
false
@@ -88,7 +88,7 @@
true
true
- 4532859
+ 4897608
true
false
@@ -136,7 +136,9 @@
-
+
+
+
@@ -144,6 +146,7 @@
+
@@ -153,7 +156,7 @@
-
+
@@ -296,6 +299,17 @@
+
+ $
+
+
+
+
+ -
+ $
+
+
+
@@ -314,10 +328,10 @@
-
+
-
+
@@ -570,101 +584,105 @@
-
+
+
+
+
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
-
+
-
+
-
+
-
+
-
-
-
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -746,7 +764,7 @@
-
+
iVBORw0KGgoAAAANSUhEUgAAATsAAABFCAYAAAA1g0HCAAAAAXNSR0IArs4c6QAAADhlWElm
TU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAABO6ADAAQAAAABAAAARQAA
AACTFYNyAABAAElEQVR4Aey9B3xc13XuuwAMeu+VBECwV5FiJ0VRpKhmVVvFRXYcO4mdn/1y
@@ -1229,48 +1247,48 @@
- <choose test="">
- <when test="purchase.state == 'draft'">
- COMPRA EN ESTADO BORRADOR
- </when>
- <when test="purchase.state == 'quotation'">
- COMPRA N°: <purchase.full_number>
- </when>
- <otherwise test="">
- ORDEN DE COMPRA N°: <purchase.full_number>
- </otherwise>
- </choose>
+ <choose test="">
+ <when test="purchase.state == 'draft'">
+ COMPRA EN ESTADO BORRADOR
+ </when>
+ <when test="purchase.state == 'quotation'">
+ COMPRA N°: <purchase.full_number>
+ </when>
+ <otherwise test="">
+ ORDEN DE COMPRA N°: <purchase.full_number>
+ </otherwise>
+ </choose>
-
+
- Fecha: <format_date(purchase.purchase_date or today, purchase.party.lang)>
- NIT: 901091201-1
- Regimen Común
- Actividad Economica 4690
- CARRERA 16 No 52-85 PISO 4
- Tel: 7163487-3000931 BOGOTA
+ Fecha: <format_date(purchase.purchase_date or today, purchase.party.lang)>
+ NIT: 901091201-1
+ Regimen Común
+ Actividad Economica 4690
+ CARRERA 16 No 52-85 PISO 4
+ Tel: 7163487-3000931 BOGOTA
- <replace text:p="set_lang(purchase.party.lang)">
- <replace text:p="purchase.set_lang(purchase.party.lang)">
- <for each="line in purchase.report_address.splitlines()">
- <line>
- </for>
- <if test="purchase.party.tax_identifier">
- <purchase.party.tax_identifier.type_string>: <purchase.party.tax_identifier.code>
- </if>
+ <replace text:p="set_lang(purchase.party.lang)">
+ <replace text:p="purchase.set_lang(purchase.party.lang)">
+ <for each="line in purchase.report_address.splitlines()">
+ <line>
+ </for>
+ <if test="purchase.party.tax_identifier">
+ <purchase.party.tax_identifier.type_string>: <purchase.party.tax_identifier.code>
+ </if>
-
- Descripción: <purchase.description>
+
+ Descripción: <purchase.description>
@@ -1281,19 +1299,19 @@
- Descripción
+ Descripción
- Cantidad
+ Cantidad
- Precio u/n
+ Precio u/n
- Impuestos
+ Impuestos
- Total
+ Total
@@ -1326,19 +1344,9 @@
- <choose>
- <when test="line.product_supplier">
- <line.product_supplier.rec_name>
- </when>
- <when test="line.product">
- <line.product.rec_name>
- </when>
- </choose>
- <if test="line.description">
- <for each="description in line.description.split('\n')">
- <description>
- </for>
- </if>
+ <if test="line.product">
+ <line.product.rec_name>
+ </if>
<format_number_symbol(line.quantity, purchase.party.lang, line.unit, digits=line.unit.digits) if line.unit else format_number(line.quantity, purchase.party.lang)>
@@ -1355,9 +1363,10 @@
<format_currency(line.amount, purchase.party.lang, purchase.currency)>
+
- </when>
+ </when>
@@ -1477,7 +1486,7 @@
-
+
@@ -1485,38 +1494,38 @@
- Total (Sin impuesto):
+ Total (Sin impuesto):
- <format_currency(purchase.untaxed_amount, purchase.party.lang, purchase.currency)>
+ <format_currency(purchase.untaxed_amount, purchase.party.lang, purchase.currency)>
- Impuestos:
+ Impuestos:
- <format_currency(purchase.tax_amount, purchase.party.lang, purchase.currency)>
+ <format_currency(purchase.tax_amount, purchase.party.lang, purchase.currency)>
- Total:
+ Total:
- <format_currency(purchase.total_amount, purchase.party.lang, purchase.currency)>
+ <format_currency(purchase.total_amount, purchase.party.lang, purchase.currency)>
-
+
- <for each="comment in (purchase.comment or '').split('\n')">
- <comment>
- </for>
- </for>
-
+ <for each="comment in (purchase.comment or '').split('\n')">
+ <comment>
+ </for>
+ </for>
+
\ No newline at end of file