[tryton-commits] changeset in modules/sale:4.4 Lock records when processing

2019-02-06 Thread Cédric Krier
changeset 6e1719d56c06 in modules/sale:4.4
details: https://hg.tryton.org/modules/sale?cmd=changeset;node=6e1719d56c06
description:
Lock records when processing

issue8012
review60511002
(grafted from 22b74ed3f637140b6c06c225f14d15d0251f6c0a)
diffstat:

 sale.py |  20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r 254551e8aeb0 -r 6e1719d56c06 sale.py
--- a/sale.py   Thu Jul 05 12:00:41 2018 +0200
+++ b/sale.py   Wed Feb 06 22:51:18 2019 +0100
@@ -922,6 +922,7 @@
 def process(cls, sales):
 done = []
 process = []
+cls.__lock(sales)
 for sale in sales:
 if sale.state not in ('confirmed', 'processing', 'done'):
 continue
@@ -942,6 +943,25 @@
 if done:
 cls.do(done)
 
+@classmethod
+def __lock(cls, records):
+from trytond.tools import grouped_slice, reduce_ids
+from sql import Literal, For
+transaction = Transaction()
+database = transaction.database
+connection = transaction.connection
+table = cls.__table__()
+
+if database.has_select_for():
+for sub_records in grouped_slice(records):
+where = reduce_ids(table.id, sub_records)
+query = table.select(
+Literal(1), where=where, for_=For('UPDATE', nowait=True))
+with connection.cursor() as cursor:
+cursor.execute(*query)
+else:
+database.lock(connection, cls._table)
+
 
 class SaleIgnoredInvoice(ModelSQL):
 'Sale - Ignored Invoice'



[tryton-commits] changeset in modules/purchase:4.4 Lock records when processing

2019-02-06 Thread Cédric Krier
changeset a91d134fa7e2 in modules/purchase:4.4
details: https://hg.tryton.org/modules/purchase?cmd=changeset;node=a91d134fa7e2
description:
Lock records when processing

issue8012
review60511002
(grafted from fbf01ede212f025da32d4fa8bacc32eac34eaec7)
diffstat:

 purchase.py |  20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r d89192ddc63d -r a91d134fa7e2 purchase.py
--- a/purchase.py   Thu Jul 05 12:11:12 2018 +0200
+++ b/purchase.py   Wed Feb 06 22:51:18 2019 +0100
@@ -817,6 +817,7 @@
 @ModelView.button
 def process(cls, purchases):
 process, done = [], []
+cls.__lock(purchases)
 for purchase in purchases:
 purchase.create_invoice()
 purchase.set_invoice_state()
@@ -837,6 +838,25 @@
 if done:
 cls.do(done)
 
+@classmethod
+def __lock(cls, records):
+from trytond.tools import grouped_slice, reduce_ids
+from sql import Literal, For
+transaction = Transaction()
+database = transaction.database
+connection = transaction.connection
+table = cls.__table__()
+
+if database.has_select_for():
+for sub_records in grouped_slice(records):
+where = reduce_ids(table.id, sub_records)
+query = table.select(
+Literal(1), where=where, for_=For('UPDATE', nowait=True))
+with connection.cursor() as cursor:
+cursor.execute(*query)
+else:
+database.lock(connection, cls._table)
+
 
 class PurchaseIgnoredInvoice(ModelSQL):
 'Purchase - Ignored Invoice'



[tryton-commits] changeset in modules/sale:5.0 Lock records when processing

2019-02-06 Thread Cédric Krier
changeset 22b74ed3f637 in modules/sale:5.0
details: https://hg.tryton.org/modules/sale?cmd=changeset;node=22b74ed3f637
description:
Lock records when processing

issue8012
review60511002
diffstat:

 sale.py |  20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r 713359779b71 -r 22b74ed3f637 sale.py
--- a/sale.py   Sat Jan 26 01:12:03 2019 +0100
+++ b/sale.py   Wed Feb 06 22:51:18 2019 +0100
@@ -878,6 +878,7 @@
 def process(cls, sales):
 done = []
 process = []
+cls.__lock(sales)
 for sale in sales:
 if sale.state not in ('confirmed', 'processing', 'done'):
 continue
@@ -899,6 +900,25 @@
 cls.do(done)
 
 @classmethod
+def __lock(cls, records):
+from trytond.tools import grouped_slice, reduce_ids
+from sql import Literal, For
+transaction = Transaction()
+database = transaction.database
+connection = transaction.connection
+table = cls.__table__()
+
+if database.has_select_for():
+for sub_records in grouped_slice(records):
+where = reduce_ids(table.id, sub_records)
+query = table.select(
+Literal(1), where=where, for_=For('UPDATE', nowait=True))
+with connection.cursor() as cursor:
+cursor.execute(*query)
+else:
+database.lock(connection, cls._table)
+
+@classmethod
 @ModelView.button_action('sale.wizard_modify_header')
 def modify_header(cls, sales):
 pass



[tryton-commits] changeset in modules/sale:4.6 Lock records when processing

2019-02-06 Thread Cédric Krier
changeset 2e8f09d1b5e4 in modules/sale:4.6
details: https://hg.tryton.org/modules/sale?cmd=changeset;node=2e8f09d1b5e4
description:
Lock records when processing

issue8012
review60511002
(grafted from 22b74ed3f637140b6c06c225f14d15d0251f6c0a)
diffstat:

 sale.py |  20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r f0091bf1ad3f -r 2e8f09d1b5e4 sale.py
--- a/sale.py   Thu Jul 05 11:59:01 2018 +0200
+++ b/sale.py   Wed Feb 06 22:51:18 2019 +0100
@@ -930,6 +930,7 @@
 def process(cls, sales):
 done = []
 process = []
+cls.__lock(sales)
 for sale in sales:
 if sale.state not in ('confirmed', 'processing', 'done'):
 continue
@@ -950,6 +951,25 @@
 if done:
 cls.do(done)
 
+@classmethod
+def __lock(cls, records):
+from trytond.tools import grouped_slice, reduce_ids
+from sql import Literal, For
+transaction = Transaction()
+database = transaction.database
+connection = transaction.connection
+table = cls.__table__()
+
+if database.has_select_for():
+for sub_records in grouped_slice(records):
+where = reduce_ids(table.id, sub_records)
+query = table.select(
+Literal(1), where=where, for_=For('UPDATE', nowait=True))
+with connection.cursor() as cursor:
+cursor.execute(*query)
+else:
+database.lock(connection, cls._table)
+
 
 class SaleIgnoredInvoice(ModelSQL):
 'Sale - Ignored Invoice'



[tryton-commits] changeset in modules/sale:4.8 Lock records when processing

2019-02-06 Thread Cédric Krier
changeset b117c30f2292 in modules/sale:4.8
details: https://hg.tryton.org/modules/sale?cmd=changeset;node=b117c30f2292
description:
Lock records when processing

issue8012
review60511002
(grafted from 22b74ed3f637140b6c06c225f14d15d0251f6c0a)
diffstat:

 sale.py |  20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r 656db55c90c0 -r b117c30f2292 sale.py
--- a/sale.py   Sat Jan 26 01:12:51 2019 +0100
+++ b/sale.py   Wed Feb 06 22:51:18 2019 +0100
@@ -950,6 +950,7 @@
 def process(cls, sales):
 done = []
 process = []
+cls.__lock(sales)
 for sale in sales:
 if sale.state not in ('confirmed', 'processing', 'done'):
 continue
@@ -971,6 +972,25 @@
 cls.do(done)
 
 @classmethod
+def __lock(cls, records):
+from trytond.tools import grouped_slice, reduce_ids
+from sql import Literal, For
+transaction = Transaction()
+database = transaction.database
+connection = transaction.connection
+table = cls.__table__()
+
+if database.has_select_for():
+for sub_records in grouped_slice(records):
+where = reduce_ids(table.id, sub_records)
+query = table.select(
+Literal(1), where=where, for_=For('UPDATE', nowait=True))
+with connection.cursor() as cursor:
+cursor.execute(*query)
+else:
+database.lock(connection, cls._table)
+
+@classmethod
 @ModelView.button_action('sale.wizard_modify_header')
 def modify_header(cls, sales):
 pass



[tryton-commits] changeset in modules/purchase:4.6 Lock records when processing

2019-02-06 Thread Cédric Krier
changeset 1b8662862eec in modules/purchase:4.6
details: https://hg.tryton.org/modules/purchase?cmd=changeset;node=1b8662862eec
description:
Lock records when processing

issue8012
review60511002
(grafted from fbf01ede212f025da32d4fa8bacc32eac34eaec7)
diffstat:

 purchase.py |  20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r 44708caa51f4 -r 1b8662862eec purchase.py
--- a/purchase.py   Thu Jul 05 12:08:56 2018 +0200
+++ b/purchase.py   Wed Feb 06 22:51:18 2019 +0100
@@ -835,6 +835,7 @@
 @ModelView.button
 def process(cls, purchases):
 process, done = [], []
+cls.__lock(purchases)
 for purchase in purchases:
 purchase.create_invoice()
 purchase.set_invoice_state()
@@ -855,6 +856,25 @@
 if done:
 cls.do(done)
 
+@classmethod
+def __lock(cls, records):
+from trytond.tools import grouped_slice, reduce_ids
+from sql import Literal, For
+transaction = Transaction()
+database = transaction.database
+connection = transaction.connection
+table = cls.__table__()
+
+if database.has_select_for():
+for sub_records in grouped_slice(records):
+where = reduce_ids(table.id, sub_records)
+query = table.select(
+Literal(1), where=where, for_=For('UPDATE', nowait=True))
+with connection.cursor() as cursor:
+cursor.execute(*query)
+else:
+database.lock(connection, cls._table)
+
 
 class PurchaseIgnoredInvoice(ModelSQL):
 'Purchase - Ignored Invoice'



[tryton-commits] changeset in modules/account_payment_stripe:4.8 Lock records whe...

2019-02-06 Thread Cédric Krier
changeset 3cb9a88ff443 in modules/account_payment_stripe:4.8
details: 
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=3cb9a88ff443
description:
Lock records when processing

issue8012
review60511002
(grafted from d404a49a74d2d906ce2b2d3bf14978b5d5c51427)
diffstat:

 payment.py |  21 +
 1 files changed, 21 insertions(+), 0 deletions(-)

diffs (45 lines):

diff -r 20a3fad82b75 -r 3cb9a88ff443 payment.py
--- a/payment.pySat Jan 26 01:12:50 2019 +0100
+++ b/payment.pyWed Feb 06 22:51:18 2019 +0100
@@ -375,6 +375,7 @@
 ('stripe_charge_id', '=', None),
 ])
 for payment in payments:
+cls.__lock([payment])
 try:
 charge = stripe.Charge.create(**payment._charge_parameters())
 except (stripe.error.RateLimitError,
@@ -437,6 +438,7 @@
 or payment.stripe_captured
 or payment.state != 'processing'):
 continue
+cls.__lock([payment])
 try:
 charge = stripe.Charge.retrieve(
 payment.stripe_charge_id,
@@ -474,6 +476,25 @@
 'idempotency_key': idempotency_key,
 }
 
+@classmethod
+def __lock(cls, records):
+from trytond.tools import grouped_slice, reduce_ids
+from sql import Literal, For
+transaction = Transaction()
+database = transaction.database
+connection = transaction.connection
+table = cls.__table__()
+
+if database.has_select_for():
+for sub_records in grouped_slice(records):
+where = reduce_ids(table.id, sub_records)
+query = table.select(
+Literal(1), where=where, for_=For('UPDATE', nowait=True))
+with connection.cursor() as cursor:
+cursor.execute(*query)
+else:
+database.lock(connection, cls._table)
+
 
 class Account(ModelSQL, ModelView):
 "Stripe Account"



[tryton-commits] changeset in modules/account_payment_stripe:4.6 Lock records whe...

2019-02-06 Thread Cédric Krier
changeset e7f0e72148f6 in modules/account_payment_stripe:4.6
details: 
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=e7f0e72148f6
description:
Lock records when processing

issue8012
review60511002
(grafted from d404a49a74d2d906ce2b2d3bf14978b5d5c51427)
diffstat:

 payment.py |  21 +
 1 files changed, 21 insertions(+), 0 deletions(-)

diffs (45 lines):

diff -r e811095d3911 -r e7f0e72148f6 payment.py
--- a/payment.pyFri Jan 05 00:06:03 2018 +0100
+++ b/payment.pyWed Feb 06 22:51:18 2019 +0100
@@ -313,6 +313,7 @@
 ('stripe_charge_id', '=', None),
 ])
 for payment in payments:
+cls.__lock([payment])
 try:
 charge = stripe.Charge.create(**payment._charge_parameters())
 except (stripe.error.RateLimitError,
@@ -372,6 +373,7 @@
 or payment.stripe_captured
 or payment.state != 'processing'):
 continue
+cls.__lock([payment])
 try:
 charge = stripe.Charge.retrieve(
 payment.stripe_charge_id,
@@ -405,6 +407,25 @@
 'amount': self.stripe_amount,
 }
 
+@classmethod
+def __lock(cls, records):
+from trytond.tools import grouped_slice, reduce_ids
+from sql import Literal, For
+transaction = Transaction()
+database = transaction.database
+connection = transaction.connection
+table = cls.__table__()
+
+if database.has_select_for():
+for sub_records in grouped_slice(records):
+where = reduce_ids(table.id, sub_records)
+query = table.select(
+Literal(1), where=where, for_=For('UPDATE', nowait=True))
+with connection.cursor() as cursor:
+cursor.execute(*query)
+else:
+database.lock(connection, cls._table)
+
 
 class Account(ModelSQL, ModelView):
 "Stripe Account"



[tryton-commits] changeset in modules/purchase:4.8 Lock records when processing

2019-02-06 Thread Cédric Krier
changeset 1e965a04bfa7 in modules/purchase:4.8
details: https://hg.tryton.org/modules/purchase?cmd=changeset;node=1e965a04bfa7
description:
Lock records when processing

issue8012
review60511002
(grafted from fbf01ede212f025da32d4fa8bacc32eac34eaec7)
diffstat:

 purchase.py |  20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r d0eaeccfac17 -r 1e965a04bfa7 purchase.py
--- a/purchase.py   Sat Jan 26 01:12:51 2019 +0100
+++ b/purchase.py   Wed Feb 06 22:51:18 2019 +0100
@@ -881,6 +881,7 @@
 @ModelView.button
 def process(cls, purchases):
 process, done = [], []
+cls.__lock(purchases)
 for purchase in purchases:
 purchase.create_invoice()
 purchase.set_invoice_state()
@@ -902,6 +903,25 @@
 cls.do(done)
 
 @classmethod
+def __lock(cls, records):
+from trytond.tools import grouped_slice, reduce_ids
+from sql import Literal, For
+transaction = Transaction()
+database = transaction.database
+connection = transaction.connection
+table = cls.__table__()
+
+if database.has_select_for():
+for sub_records in grouped_slice(records):
+where = reduce_ids(table.id, sub_records)
+query = table.select(
+Literal(1), where=where, for_=For('UPDATE', nowait=True))
+with connection.cursor() as cursor:
+cursor.execute(*query)
+else:
+database.lock(connection, cls._table)
+
+@classmethod
 @ModelView.button_action('purchase.wizard_modify_header')
 def modify_header(cls, purchases):
 pass



[tryton-commits] changeset in modules/purchase:5.0 Lock records when processing

2019-02-06 Thread Cédric Krier
changeset fbf01ede212f in modules/purchase:5.0
details: https://hg.tryton.org/modules/purchase?cmd=changeset;node=fbf01ede212f
description:
Lock records when processing

issue8012
review60511002
diffstat:

 purchase.py |  20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r 517473403e77 -r fbf01ede212f purchase.py
--- a/purchase.py   Sat Jan 26 01:12:03 2019 +0100
+++ b/purchase.py   Wed Feb 06 22:51:18 2019 +0100
@@ -846,6 +846,7 @@
 @ModelView.button
 def process(cls, purchases):
 process, done = [], []
+cls.__lock(purchases)
 for purchase in purchases:
 purchase.create_invoice()
 purchase.set_invoice_state()
@@ -867,6 +868,25 @@
 cls.do(done)
 
 @classmethod
+def __lock(cls, records):
+from trytond.tools import grouped_slice, reduce_ids
+from sql import Literal, For
+transaction = Transaction()
+database = transaction.database
+connection = transaction.connection
+table = cls.__table__()
+
+if database.has_select_for():
+for sub_records in grouped_slice(records):
+where = reduce_ids(table.id, sub_records)
+query = table.select(
+Literal(1), where=where, for_=For('UPDATE', nowait=True))
+with connection.cursor() as cursor:
+cursor.execute(*query)
+else:
+database.lock(connection, cls._table)
+
+@classmethod
 @ModelView.button_action('purchase.wizard_modify_header')
 def modify_header(cls, purchases):
 pass



[tryton-commits] changeset in modules/account_payment_stripe:4.4 Lock records whe...

2019-02-06 Thread Cédric Krier
changeset ed977ed34b94 in modules/account_payment_stripe:4.4
details: 
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=ed977ed34b94
description:
Lock records when processing

issue8012
review60511002
(grafted from d404a49a74d2d906ce2b2d3bf14978b5d5c51427)
diffstat:

 payment.py |  20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r 4e1ee61cf359 -r ed977ed34b94 payment.py
--- a/payment.pyFri Jan 05 00:06:49 2018 +0100
+++ b/payment.pyWed Feb 06 22:51:18 2019 +0100
@@ -192,6 +192,7 @@
 ('stripe_charge_id', '=', None),
 ])
 for payment in payments:
+cls.__lock([payment])
 try:
 charge = stripe.Charge.create(**payment._charge_parameters())
 except (stripe.error.RateLimitError,
@@ -235,6 +236,25 @@
 'idempotency_key': self.stripe_checkout_id,
 }
 
+@classmethod
+def __lock(cls, records):
+from trytond.tools import grouped_slice, reduce_ids
+from sql import Literal, For
+transaction = Transaction()
+database = transaction.database
+connection = transaction.connection
+table = cls.__table__()
+
+if database.has_select_for():
+for sub_records in grouped_slice(records):
+where = reduce_ids(table.id, sub_records)
+query = table.select(
+Literal(1), where=where, for_=For('UPDATE', nowait=True))
+with connection.cursor() as cursor:
+cursor.execute(*query)
+else:
+database.lock(connection, cls._table)
+
 
 class Account(ModelSQL, ModelView):
 "Stripe Account"



[tryton-commits] changeset in modules/account_payment_stripe:5.0 Lock records whe...

2019-02-06 Thread Cédric Krier
changeset d404a49a74d2 in modules/account_payment_stripe:5.0
details: 
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=d404a49a74d2
description:
Lock records when processing

issue8012
review60511002
diffstat:

 payment.py |  21 +
 1 files changed, 21 insertions(+), 0 deletions(-)

diffs (45 lines):

diff -r 742094666053 -r d404a49a74d2 payment.py
--- a/payment.pySat Jan 26 01:12:03 2019 +0100
+++ b/payment.pyWed Feb 06 22:51:18 2019 +0100
@@ -370,6 +370,7 @@
 ('stripe_charge_id', '=', None),
 ])
 for payment in payments:
+cls.__lock([payment])
 try:
 charge = stripe.Charge.create(**payment._charge_parameters())
 except (stripe.error.RateLimitError,
@@ -432,6 +433,7 @@
 or payment.stripe_captured
 or payment.state != 'processing'):
 continue
+cls.__lock([payment])
 try:
 charge = stripe.Charge.retrieve(
 payment.stripe_charge_id,
@@ -469,6 +471,25 @@
 'idempotency_key': idempotency_key,
 }
 
+@classmethod
+def __lock(cls, records):
+from trytond.tools import grouped_slice, reduce_ids
+from sql import Literal, For
+transaction = Transaction()
+database = transaction.database
+connection = transaction.connection
+table = cls.__table__()
+
+if database.has_select_for():
+for sub_records in grouped_slice(records):
+where = reduce_ids(table.id, sub_records)
+query = table.select(
+Literal(1), where=where, for_=For('UPDATE', nowait=True))
+with connection.cursor() as cursor:
+cursor.execute(*query)
+else:
+database.lock(connection, cls._table)
+
 
 class Account(ModelSQL, ModelView):
 "Stripe Account"



[tryton-commits] changeset in modules/timesheet:default Rename informations to in...

2019-02-06 Thread David Harper
changeset 060be9237513 in modules/timesheet:default
details: https://hg.tryton.org/modules/timesheet?cmd=changeset;node=060be9237513
description:
Rename informations to information

issue7926
review54491002
diffstat:

 doc/index.rst |  8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (18 lines):

diff -r dbfd505c0f9d -r 060be9237513 doc/index.rst
--- a/doc/index.rst Sat Jan 26 01:10:48 2019 +0100
+++ b/doc/index.rst Wed Feb 06 22:34:13 2019 +0100
@@ -21,10 +21,10 @@
 Timesheet Line
 **
 
-A timesheet line express the fact that one employee spend a part of
-his/her time on a specific work at a given date. An optional
-Description field allow to give some extra informations about what
-have been done.
+A timesheet line expresses the fact that one employee spends part of
+their time doing specific work on a given date. An optional
+Description field allows extra information to be recorded about what
+has been done.
 
 .. toctree::
 :maxdepth: 1



[tryton-commits] changeset in tryton:default Rename informations to information

2019-02-06 Thread David Harper
changeset 997b02013a53 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=997b02013a53
description:
Rename informations to information

issue7926
review54491002
diffstat:

 doc/glossary.rst |  2 +-
 tryton/gui/window/dblogin.py |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r c63256a6bb95 -r 997b02013a53 doc/glossary.rst
--- a/doc/glossary.rst  Tue Feb 05 19:24:07 2019 +0100
+++ b/doc/glossary.rst  Wed Feb 06 22:34:13 2019 +0100
@@ -144,7 +144,7 @@
 
Widgets
   A *Widget* is a visual element of a graphical user interface (GUI). Some
-  *Widgets* solely show informations, others allow manipulation from user
+  *Widgets* solely show information, others allow manipulation from user
   side. Example *Widgets* are buttons, check-boxes, entry-boxes, selection
   lists, tables, lists, trees, ...
 
diff -r c63256a6bb95 -r 997b02013a53 tryton/gui/window/dblogin.py
--- a/tryton/gui/window/dblogin.py  Tue Feb 05 19:24:07 2019 +0100
+++ b/tryton/gui/window/dblogin.py  Wed Feb 06 22:34:13 2019 +0100
@@ -489,7 +489,7 @@
 label_username.set_mnemonic_widget(self.entry_login)
 self.table_main.attach(label_username, 0, 1, 6, 7, xoptions=gtk.FILL)
 
-# Profile informations
+# Profile information
 self.profile_cfg = os.path.join(get_config_dir(), 'profiles.cfg')
 self.profiles = configparser.ConfigParser()
 if not os.path.exists(self.profile_cfg):



[tryton-commits] changeset in modules/account_statement_ofx:default Rename inform...

2019-02-06 Thread David Harper
changeset 2910fa74847f in modules/account_statement_ofx:default
details: 
https://hg.tryton.org/modules/account_statement_ofx?cmd=changeset;node=2910fa74847f
description:
Rename informations to information

issue7926
review54491002
diffstat:

 CHANGELOG|   4 +++-
 account.py   |  10 +-
 tests/scenario_account_statement_ofx.rst |   2 +-
 3 files changed, 9 insertions(+), 7 deletions(-)

diffs (54 lines):

diff -r 832228533c6f -r 2910fa74847f CHANGELOG
--- a/CHANGELOG Sat Jan 26 01:10:47 2019 +0100
+++ b/CHANGELOG Wed Feb 06 22:34:13 2019 +0100
@@ -1,5 +1,7 @@
+* Rename StatementImport method ofx_informations to ofx_information
+
 Version 5.0.0 - 2018-10-01
 * Bug fixes (see mercurial logs for details)
 
 Version 4.8.0 - 2018-04-23
-* Initial release
\ No newline at end of file
+* Initial release
diff -r 832228533c6f -r 2910fa74847f account.py
--- a/account.pySat Jan 26 01:10:47 2019 +0100
+++ b/account.pyWed Feb 06 22:34:13 2019 +0100
@@ -72,7 +72,7 @@
 origin.amount = transaction.amount
 origin.party = self.ofx_party(ofx_account, transaction)
 origin.description = transaction.memo
-origin.informations = self.ofx_informations(ofx_account, transaction)
+origin.information = self.ofx_information(ofx_account, transaction)
 return [origin]
 
 def ofx_party(self, ofx_account, transaction):
@@ -86,8 +86,8 @@
 party, = parties
 return party
 
-def ofx_informations(self, ofx_account, transaction):
-informations = {}
+def ofx_information(self, ofx_account, transaction):
+information = {}
 for name in [
 'checknum',
 'mcc',
@@ -96,5 +96,5 @@
 ]:
 value = getattr(transaction, name)
 if value:
-informations['ofx_' + name] = value
-return informations
+information['ofx_' + name] = value
+return information
diff -r 832228533c6f -r 2910fa74847f tests/scenario_account_statement_ofx.rst
--- a/tests/scenario_account_statement_ofx.rst  Sat Jan 26 01:10:47 2019 +0100
+++ b/tests/scenario_account_statement_ofx.rst  Wed Feb 06 22:34:13 2019 +0100
@@ -115,5 +115,5 @@
 True
 >>> origin.description
 'COMMUNICATION'
->>> origin.informations['ofx_type']
+>>> origin.information['ofx_type']
 'credit'



[tryton-commits] changeset in modules/account_statement_coda:default Rename infor...

2019-02-06 Thread David Harper
changeset 0ce2bd3c in modules/account_statement_coda:default
details: 
https://hg.tryton.org/modules/account_statement_coda?cmd=changeset;node=0ce2bd3c
description:
Rename informations to information

issue7926
review54491002
diffstat:

 CHANGELOG |   2 ++
 account.py|  12 ++--
 tests/scenario_account_statement_coda.rst |   2 +-
 3 files changed, 9 insertions(+), 7 deletions(-)

diffs (52 lines):

diff -r adc5f53d7d67 -r 0ce2bd3c CHANGELOG
--- a/CHANGELOG Sat Jan 26 01:10:47 2019 +0100
+++ b/CHANGELOG Wed Feb 06 22:34:13 2019 +0100
@@ -1,3 +1,5 @@
+* Rename coda_informations to coda_information
+
 Version 5.0.0 - 2018-10-01
 * Bug fixes (see mercurial logs for details)
 * Remove support for Python 2.7
diff -r adc5f53d7d67 -r 0ce2bd3c account.py
--- a/account.pySat Jan 26 01:10:47 2019 +0100
+++ b/account.pyWed Feb 06 22:34:13 2019 +0100
@@ -75,7 +75,7 @@
 origin.party = self.coda_party(coda_statement, move)
 # TODO select account using transaction codes
 origin.description = move.communication
-origin.informations = self.coda_informations(coda_statement, move)
+origin.information = self.coda_information(coda_statement, move)
 return [origin]
 
 def coda_party(self, coda_statement, move):
@@ -93,8 +93,8 @@
 if number.account.owners:
 return number.account.owners[0]
 
-def coda_informations(self, coda_statement, move):
-informations = {}
+def coda_information(self, coda_statement, move):
+information = {}
 for name in [
 'bank_reference',
 'customer_reference',
@@ -109,6 +109,6 @@
 'transaction_category']:
 value = getattr(move, name)
 if value:
-informations['coda_' + name] = value
-# TODO add move informations
-return informations
+information['coda_' + name] = value
+# TODO add move information
+return information
diff -r adc5f53d7d67 -r 0ce2bd3c tests/scenario_account_statement_coda.rst
--- a/tests/scenario_account_statement_coda.rst Sat Jan 26 01:10:47 2019 +0100
+++ b/tests/scenario_account_statement_coda.rst Wed Feb 06 22:34:13 2019 +0100
@@ -116,5 +116,5 @@
 Decimal('100')
 >>> origin.description
 'COMMUNICATION'
->>> origin.informations['coda_bank_reference']
+>>> origin.information['coda_bank_reference']
 'REF BANK '



[tryton-commits] changeset in modules/stock_package_shipping_dpd:default Rename i...

2019-02-06 Thread David Harper
changeset 669900ddaa96 in modules/stock_package_shipping_dpd:default
details: 
https://hg.tryton.org/modules/stock_package_shipping_dpd?cmd=changeset;node=669900ddaa96
description:
Rename informations to information

issue7926
review54491002
diffstat:

 view/dpd_credential_form.xml |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (13 lines):

diff -r 06d68d541366 -r 669900ddaa96 view/dpd_credential_form.xml
--- a/view/dpd_credential_form.xml  Sat Jan 26 01:10:48 2019 +0100
+++ b/view/dpd_credential_form.xml  Wed Feb 06 22:34:13 2019 +0100
@@ -6,8 +6,7 @@
 
 
 
-
+
 
 
 



[tryton-commits] changeset in modules/stock_package_shipping_ups:default Rename i...

2019-02-06 Thread David Harper
changeset f98467b78dbd in modules/stock_package_shipping_ups:default
details: 
https://hg.tryton.org/modules/stock_package_shipping_ups?cmd=changeset;node=f98467b78dbd
description:
Rename informations to information

issue7926
review54491002
diffstat:

 view/ups_credential_form.xml |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (13 lines):

diff -r f973fcc462c7 -r f98467b78dbd view/ups_credential_form.xml
--- a/view/ups_credential_form.xml  Sat Jan 26 01:10:48 2019 +0100
+++ b/view/ups_credential_form.xml  Wed Feb 06 22:34:13 2019 +0100
@@ -6,8 +6,7 @@
 
 
 
-
+
 
 
 



[tryton-commits] changeset in modules/account_statement:default Rename informatio...

2019-02-06 Thread David Harper
changeset 584793391809 in modules/account_statement:default
details: 
https://hg.tryton.org/modules/account_statement?cmd=changeset;node=584793391809
description:
Rename informations to information

issue7926
review54491002
diffstat:

 CHANGELOG  |   2 ++
 statement.py   |  13 +++--
 view/statement_origin_form.xml |   2 +-
 3 files changed, 14 insertions(+), 3 deletions(-)

diffs (43 lines):

diff -r 38674f99dfd1 -r 584793391809 CHANGELOG
--- a/CHANGELOG Wed Jan 30 11:58:45 2019 +0100
+++ b/CHANGELOG Wed Feb 06 22:34:13 2019 +0100
@@ -1,3 +1,5 @@
+* Rename Origin field informations to information
+
 Version 5.0.0 - 2018-10-01
 * Bug fixes (see mercurial logs for details)
 * Use single account for statement journal
diff -r 38674f99dfd1 -r 584793391809 statement.py
--- a/statement.py  Wed Jan 30 11:58:45 2019 +0100
+++ b/statement.py  Wed Feb 06 22:34:13 2019 +0100
@@ -1008,8 +1008,17 @@
 digits=(16, Eval('_parent_statement', {})
 .get('currency_digits', 2))),
 'on_change_with_pending_amount', searcher='search_pending_amount')
-informations = fields.Dict(
-'account.statement.origin.information', "Informations", readonly=True)
+information = fields.Dict(
+'account.statement.origin.information', "Information", readonly=True)
+
+@classmethod
+def __register__(cls, module_name):
+table = cls.__table_handler__(module_name)
+
+# Migration from 5.0: rename informations into information
+table.column_rename('informations', 'information')
+
+super(Origin, cls).__register__(module_name)
 
 @fields.depends('statement')
 def on_change_with_statement_id(self, name=None):
diff -r 38674f99dfd1 -r 584793391809 view/statement_origin_form.xml
--- a/view/statement_origin_form.xmlWed Jan 30 11:58:45 2019 +0100
+++ b/view/statement_origin_form.xmlWed Feb 06 22:34:13 2019 +0100
@@ -20,6 +20,6 @@
 
 
 
-
+
 
 



[tryton-commits] changeset in modules/account_statement_aeb43:default Rename info...

2019-02-06 Thread David Harper
changeset 8f388a8060e8 in modules/account_statement_aeb43:default
details: 
https://hg.tryton.org/modules/account_statement_aeb43?cmd=changeset;node=8f388a8060e8
description:
Rename informations to information

issue7926
review54491002
diffstat:

 CHANGELOG  |  4 +++-
 statement.py   |  4 ++--
 tests/scenario_account_statement_aeb43.rst |  6 +++---
 3 files changed, 8 insertions(+), 6 deletions(-)

diffs (42 lines):

diff -r 5166f2d5e3bc -r 8f388a8060e8 CHANGELOG
--- a/CHANGELOG Sat Jan 26 01:10:47 2019 +0100
+++ b/CHANGELOG Wed Feb 06 22:34:13 2019 +0100
@@ -1,2 +1,4 @@
+* Rename aeb43_informations to aeb43_information
+
 Version 5.0.0 - 2018-10-01
-* Initial release
\ No newline at end of file
+* Initial release
diff -r 5166f2d5e3bc -r 8f388a8060e8 statement.py
--- a/statement.py  Sat Jan 26 01:10:47 2019 +0100
+++ b/statement.py  Wed Feb 06 22:34:13 2019 +0100
@@ -88,10 +88,10 @@
 if item.item2:
 descriptions.append(item.item2)
 origin.description = ''.join(descriptions)
-origin.informations = self.aeb43_informations(statement, transaction)
+origin.information = self.aeb43_information(statement, transaction)
 return [origin]
 
-def aeb43_informations(self, statement, transaction):
+def aeb43_information(self, statement, transaction):
 return {
 'aeb43_operation_date': transaction.transactionDate,
 'aeb43_record_type': transaction.sharedItem,
diff -r 5166f2d5e3bc -r 8f388a8060e8 tests/scenario_account_statement_aeb43.rst
--- a/tests/scenario_account_statement_aeb43.rstSat Jan 26 01:10:47 
2019 +0100
+++ b/tests/scenario_account_statement_aeb43.rstWed Feb 06 22:34:13 
2019 +0100
@@ -113,9 +113,9 @@
 Decimal('-10.98')
 >>> origin.description
 'COMPRA TARG 55403014 DNH*MICHAEL SCOTT'
->>> origin.informations['aeb43_record_type']
+>>> origin.information['aeb43_record_type']
 '12'
->>> origin.informations['aeb43_first_reference']
+>>> origin.information['aeb43_first_reference']
 ''
->>> origin.informations['aeb43_second_reference']
+>>> origin.information['aeb43_second_reference']
 '5540014387733014'



[tryton-commits] changeset in modules/account_es:default Update model 303 to new ...

2019-02-06 Thread Sergi Almacellas Abellana
changeset f552c1e2a74a in modules/account_es:default
details: 
https://hg.tryton.org/modules/account_es?cmd=changeset;node=f552c1e2a74a
description:
Update model 303 to new format

issue8021
review68421002
diffstat:

 CHANGELOG |  2 ++
 aeat303.txt   |  2 +-
 tests/303.txt |  2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 48befb8936b8 -r f552c1e2a74a CHANGELOG
--- a/CHANGELOG Sat Jan 26 01:10:47 2019 +0100
+++ b/CHANGELOG Wed Feb 06 16:42:45 2019 +0100
@@ -1,3 +1,5 @@
+* Update model 303 to new format
+
 Version 5.0.0 - 2018-10-01
 * Bug fixes (see mercurial logs for details)
 * Allow to export tax reports as file
diff -r 48befb8936b8 -r f552c1e2a74a aeat303.txt
--- a/aeat303.txt   Sat Jan 26 01:10:47 2019 +0100
+++ b/aeat303.txt   Wed Feb 06 16:42:45 2019 +0100
@@ -1,1 +1,1 @@
-${justify('', 300)} 
${declaration_type}${company.party.tax_identifier.code[2:]}${justify(company.rec_name.upper(),
 80)}${year}${period}2322 
${format_decimal(amounts['01'])}${format_percentage(amounts['02'])}${format_decimal(amounts['03'])}${format_decimal(amounts['04'])}${format_percentage(amounts['05'])}${format_decimal(amounts['06'])}${format_decimal(amounts['07'])}${format_percentage(amounts['08'])}${format_decimal(amounts['09'])}${format_decimal(amounts['10'])}${format_decimal(amounts['11'])}${format_decimal(amounts['12'])}${format_decimal(amounts['13'])}${format_decimal(amounts['14'])}${format_decimal(amounts['15'])}${format_decimal(amounts['16'])}${format_percentage(amounts['017'])}${format_decimal(amounts['18'])}${format_decimal(amounts['19'])}${format_percentage(amounts['20'])}${format_decimal(amounts['21'])}${format_decimal(amounts['22'])}${format_percentage(amounts['23'])}${format_decimal(amounts['24'])}${format_decimal(amounts['25'],
 True)}${format_decimal(amounts['26'], True)}${format_decimal(amounts['27'], 
True)}${format_decimal(amounts['28'])}${format_decimal(amounts['29'])}${format_decimal(amounts['30'])}${format_decimal(amounts['31'])}${format_decimal(amounts['32'])}${format_decimal(amounts['33'])}${format_decimal(amounts['34'])}${format_decimal(amounts['35'])}${format_decimal(amounts['36'])}${format_decimal(amounts['37'])}${format_decimal(amounts['38'])}${format_decimal(amounts['39'])}${format_decimal(amounts['40'],
 True)}${format_decimal(amounts['41'], True)}${format_decimal(amounts['42'], 
True)}${format_decimal(amounts['43'], True)}${format_decimal(amounts['44'], 
True)}${format_decimal(amounts['45'], True)}${format_decimal(amounts['46'], 
True)}022${justify('', 
592)}${format_decimal(amounts['59'])}${format_decimal(amounts['60'])}${format_decimal(amounts['61'])}${format_decimal(amounts['62'])}${format_decimal(amounts['63'])}${format_decimal(amounts['74'])}${format_decimal(amounts['75'])}${format_decimal(amounts['76'])}${format_decimal(amounts['64'],
 True)}${format_percentage(amounts['65'])}${format_decimal(amounts['66'], 
True)}${format_decimal(amounts['77'])}${format_decimal(amounts['67'])}${format_decimal(amounts['68'],
 True)}${format_decimal(amounts['69'], True)}${format_decimal(amounts['70'], 
True)}${format_decimal(amounts['71'], True)}${justify('', 60)}0000  
  00 
${format_decimal(amounts['80'])}${format_decimal(amounts['81'])}${format_decimal(amounts['93'])}${format_decimal(amounts['83'])}${format_decimal(amounts['84'])}${format_decimal(amounts['85'])}${format_decimal(amounts['86'])}${format_decimal(amounts['79'])}${format_decimal(amounts['88'])}0${format_percentage(amounts['89'])}${format_percentage(amounts['90'])}${format_percentage(amounts['91'])}${format_percentage(amounts['92'])}${format_decimal(amounts['94'])}${format_decimal(amounts['95'])}${format_decimal(amounts['96'])}${format_decimal(amounts['97'])}${format_decimal(amounts['98'])}${format_decimal(amounts['99'])}${justify('',
 468)}
+${justify('', 300)} 
${declaration_type}${company.party.tax_identifier.code[2:]}${justify(company.rec_name.upper(),
 80)}${year}${period}2322 
${format_decimal(amounts['01'])}${format_percentage(amounts['02'])}${format_decimal(amounts['03'])}${format_decimal(amounts['04'])}${format_percentage(amounts['05'])}${format_decimal(amounts['06'])}${format_decimal(amounts['07'])}${format_percentage(amounts['08'])}${format_decimal(amounts['09'])}${format_decimal(amounts['10'])}${format_decimal(amounts['11'])}${format_decimal(amounts['12'])}${format_decimal(amounts['13'])}${format_decimal(amounts['14'])}${format_decimal(amounts['15'])}${format_decimal(amounts['16'])}${format_percentage(amounts['017'])}${format_decimal(amounts['18'])}${format_decimal(amounts['19'])}${format_percentage(amounts['20'])}${format_decimal(amounts['21'])}${format_decimal(amounts['22'])}${format_percentage(amounts['23'])}${format_decimal(amounts['24'])}${format_decimal(amounts['25'],
 True)}${format_decimal(amounts['26'], True)}${format_decimal(amounts['27'], 
True)}${format_decimal(amounts['28'])}${format_decimal(amounts['2