diff --git a/__init__.py b/__init__.py
index f73f9dd..5ac017e 100644
--- a/__init__.py
+++ b/__init__.py
@@ -10,6 +10,7 @@ def register():
product.Template,
product.Product,
product.Pattern,
+ purchase.Configuration,
purchase.Purchase,
purchase.Line,
equipment.OpticalEquipment,
diff --git a/move.py b/move.py
index 1b557b2..62cd6b0 100644
--- a/move.py
+++ b/move.py
@@ -68,8 +68,8 @@ class ShipmentOut(metaclass=PoolMeta):
super(ShipmentOut, cls).__setup__()
cls._buttons.update({
'maintenance_initial': {
- 'invisible': (If(Eval('service_maintenance_initial') == True, True))
- | (If(Eval('sale_type') != 'equipments', True))},
+ 'invisible': ((Eval('service_maintenance_initial',True))
+ | (Eval('sale_type').in_(['maintenance', 'replaces'])))},
'assign_wizard': {
'invisible': ((Eval('state') != 'waiting')
| (Eval('warehouse_storage') == Eval('warehouse_output'))) |
diff --git a/purchase.py b/purchase.py
index cc4a4b4..332c470 100644
--- a/purchase.py
+++ b/purchase.py
@@ -12,6 +12,7 @@ from .exceptions import (
from trytond.transaction import Transaction
+
class Purchase(metaclass=PoolMeta):
__name__ = 'purchase.purchase'
diff --git a/purchase.xml b/purchase.xml
index 4a9bd36..29974ee 100644
--- a/purchase.xml
+++ b/purchase.xml
@@ -13,6 +13,11 @@ this repository contains the full copyright notices and license terms. -->
purchase_form
+
+ purchase.configuration
+
+ configuration_form
+
create_equipments
Create Equipments
@@ -30,5 +35,7 @@ this repository contains the full copyright notices and license terms. -->
purchase.purchase,-1
+
+
diff --git a/report/Purchase.fodt b/report/Purchase.fodt
index 781e9ea..278e100 100644
--- a/report/Purchase.fodt
+++ b/report/Purchase.fodt
@@ -1,28 +1,28 @@
- LibreOffice/7.3.6.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
- 0
+ 17187
0
- 27437
- 10952
+ 25652
+ 11811
true
false
view2
- 4133
- 4852
+ 7357
+ 18429
0
- 0
- 27436
- 10950
+ 17187
+ 25650
+ 28997
0
0
false
- 130
+ 190
false
false
false
@@ -88,7 +88,7 @@
true
true
- 4405812
+ 4532859
true
false
@@ -143,6 +143,7 @@
+
@@ -151,14 +152,14 @@
-
-
+
+
-
+
@@ -171,18 +172,18 @@
-
+
-
+
-
+
@@ -206,16 +207,16 @@
-
-
+
+
-
-
+
+
@@ -223,8 +224,8 @@
-
-
+
+
@@ -233,20 +234,24 @@
-
+
-
+
-
+
+
+
+
+
@@ -254,229 +259,229 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -527,19 +532,19 @@
-
+
-
+
-
+
-
+
@@ -558,30 +563,30 @@
-
+
-
+
-
+
-
+
-
+
-
+
@@ -607,7 +612,7 @@
-
+
@@ -618,7 +623,7 @@
-
+
@@ -636,12 +641,30 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -657,26 +680,32 @@
+
+
+
+
+
+
-
+
-
-
-
+
+
+
-
-
+
+
-
+
-
+
@@ -717,7 +746,7 @@
-
+
iVBORw0KGgoAAAANSUhEUgAAATsAAABFCAYAAAA1g0HCAAAAAXNSR0IArs4c6QAAADhlWElm
TU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAABO6ADAAQAAAABAAAARQAA
AACTFYNyAABAAElEQVR4Aey9B3xc13XuuwAMeu+VBECwV5FiJ0VRpKhmVVvFRXYcO4mdn/1y
@@ -1200,17 +1229,17 @@
- <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>
@@ -1241,6 +1270,7 @@
+ Descripción: <purchase.description>
@@ -1306,12 +1336,12 @@
</choose>
<if test="line.description">
<for each="description in line.description.split('\n')">
- <description>
- </for>
+ <description>
+ </for>
</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)>
+ <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)>
<format_currency(line.unit_price, purchase.party.lang, purchase.currency, digits=line.__class__.unit_price.digits[1])>
diff --git a/sale.py b/sale.py
index 56b69d9..6a6df1b 100644
--- a/sale.py
+++ b/sale.py
@@ -108,7 +108,19 @@ class Sale(metaclass=PoolMeta):
values.update(dict(key))
return Shipment(**values)
-
+
+ @classmethod
+ @ModelView.button
+ @Workflow.transition('quotation')
+ def quote(cls, sales):
+ pool = Pool()
+ AdvancePaymentCondition = pool.get('sale.advance_payment.condition')
+ super(Sale, cls).quote(sales)
+
+ for sale in sales:
+ sale.set_advance_payment_term()
+ cls.save(sales)
+
@classmethod
@ModelView.button
@Workflow.transition('confirmed')