[tryton-commits] changeset in weblate:default Translated using Weblate (Dutch)

2022-02-07 Thread EdbO
changeset 103253794440 in weblate:default
details: https://hg.tryton.org/weblate?cmd=changeset&node=103253794440
description:
Translated using Weblate (Dutch)

Currently translated at 100.0% (1086 of 1086 strings)

Translation: Tryton/account
Translate-URL: https://translate.tryton.org/projects/tryton/account/nl/
diffstat:

 modules/account/locale/nl.po |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r ca7641fdb841 -r 103253794440 modules/account/locale/nl.po
--- a/modules/account/locale/nl.po  Wed Feb 02 16:15:40 2022 +
+++ b/modules/account/locale/nl.po  Mon Feb 07 19:47:10 2022 +
@@ -1,7 +1,7 @@
 #
 msgid ""
 msgstr ""
-"PO-Revision-Date: 2022-02-03 16:14+\n"
+"PO-Revision-Date: 2022-02-07 20:02+\n"
 "Last-Translator: EdbO \n"
 "Language: nl\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -3441,7 +3441,7 @@
 
 msgctxt "model:ir.model.button,string:period_close_button"
 msgid "Close"
-msgstr "Sluiten"
+msgstr "Afsluiten"
 
 msgctxt "model:ir.model.button,string:period_lock_button"
 msgid "Lock"



[tryton-commits] changeset in weblate:default Translated using Weblate (Dutch)

2022-02-07 Thread EdbO
changeset bf502e261fb8 in weblate:default
details: https://hg.tryton.org/weblate?cmd=changeset&node=bf502e261fb8
description:
Translated using Weblate (Dutch)

Currently translated at 100.0% (10 of 10 strings)

Translation: Tryton/account_invoice_stock
Translate-URL: 
https://translate.tryton.org/projects/tryton/account_invoice_stock/nl/
diffstat:

 modules/account_invoice_stock/locale/nl.po |  18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (62 lines):

diff -r 103253794440 -r bf502e261fb8 modules/account_invoice_stock/locale/nl.po
--- a/modules/account_invoice_stock/locale/nl.poMon Feb 07 19:47:10 
2022 +
+++ b/modules/account_invoice_stock/locale/nl.poMon Feb 07 19:54:11 
2022 +
@@ -1,13 +1,13 @@
 #
 msgid ""
 msgstr ""
-"PO-Revision-Date: 2021-08-23 20:33+\n"
-"Last-Translator: Bert Defoor \n"
+"PO-Revision-Date: 2022-02-07 20:02+\n"
+"Last-Translator: EdbO \n"
 "Language: nl\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 4.8\n"
+"X-Generator: Weblate 4.10.1\n"
 
 msgctxt "field:account.invoice.line,correction:"
 msgid "Correction"
@@ -15,7 +15,7 @@
 
 msgctxt "field:account.invoice.line,stock_moves:"
 msgid "Stock Moves"
-msgstr "Voorraadbeweging"
+msgstr "Voorraad beweging"
 
 msgctxt "field:account.invoice.line,warehouse:"
 msgid "Warehouse"
@@ -23,19 +23,19 @@
 
 msgctxt "field:account.invoice.line-stock.move,invoice_line:"
 msgid "Invoice Line"
-msgstr "Factuurregel"
+msgstr "Factuur regel"
 
 msgctxt "field:account.invoice.line-stock.move,stock_move:"
 msgid "Stock Move"
-msgstr "Voorraadbeweging"
+msgstr "Voorraad beweging"
 
 msgctxt "field:stock.move,invoice_lines:"
 msgid "Invoice Lines"
-msgstr "Factuurregels"
+msgstr "Factuur regels"
 
 msgctxt "field:stock.move,invoice_types:"
 msgid "Invoice Types"
-msgstr "Factuurtypes"
+msgstr "Factuur soorten"
 
 msgctxt "help:account.invoice.line,correction:"
 msgid "Check to correct price of already posted invoice."
@@ -43,7 +43,7 @@
 
 msgctxt "model:account.invoice.line-stock.move,name:"
 msgid "Invoice Line - Stock Move"
-msgstr "Factuurregel - voorraadbeweging"
+msgstr "Factuur regel - voorraad beweging"
 
 msgctxt "view:account.invoice.line:"
 msgid "Stock"



[tryton-commits] changeset in weblate:default Translated using Weblate (Dutch)

2022-02-07 Thread EdbO
changeset a9b596bd80d3 in weblate:default
details: https://hg.tryton.org/weblate?cmd=changeset&node=a9b596bd80d3
description:
Translated using Weblate (Dutch)

Currently translated at 100.0% (53 of 53 strings)

Translation: Tryton/currency
Translate-URL: https://translate.tryton.org/projects/tryton/currency/nl/
diffstat:

 modules/currency/locale/nl.po |  12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (57 lines):

diff -r bf502e261fb8 -r a9b596bd80d3 modules/currency/locale/nl.po
--- a/modules/currency/locale/nl.po Mon Feb 07 19:54:11 2022 +
+++ b/modules/currency/locale/nl.po Mon Feb 07 13:47:53 2022 +
@@ -1,7 +1,7 @@
 #
 msgid ""
 msgstr ""
-"PO-Revision-Date: 2022-01-24 16:55+\n"
+"PO-Revision-Date: 2022-02-07 20:02+\n"
 "Last-Translator: EdbO \n"
 "Language: nl\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -51,7 +51,7 @@
 
 msgctxt "field:currency.currency,digits:"
 msgid "Digits"
-msgstr "Cijfers"
+msgstr "Decimalen"
 
 msgctxt "field:currency.currency,name:"
 msgid "Name"
@@ -111,7 +111,7 @@
 
 msgctxt "help:currency.currency,digits:"
 msgid "The number of digits to display after the decimal separator."
-msgstr "Het aantal cijfers dat moet worden weergegeven na het decimaalteken."
+msgstr "Het aantal decimalen dat moet worden weergegeven na het decimaalteken."
 
 msgctxt "help:currency.currency,name:"
 msgid "The main identifier of the currency."
@@ -164,7 +164,7 @@
 
 msgctxt "model:ir.action,name:act_cron_form"
 msgid "Scheduled Rate Updates"
-msgstr "Geplande koers updates"
+msgstr "Geplande wisselkoers updates"
 
 msgctxt "model:ir.action,name:act_currency_form"
 msgid "Currencies"
@@ -189,7 +189,7 @@
 
 msgctxt "model:ir.ui.menu,name:menu_cron_form"
 msgid "Scheduled Rate Updates"
-msgstr "Geplande tariefupdates"
+msgstr "Geplande wisselkoers updates"
 
 msgctxt "model:ir.ui.menu,name:menu_currency"
 msgid "Currency"
@@ -217,7 +217,7 @@
 
 msgctxt "selection:ir.cron,method:"
 msgid "Update Currency Rates"
-msgstr "Valutakoersen bijwerken"
+msgstr "Valuta wisselkoersen bijwerken"
 
 msgctxt "view:currency.currency:"
 msgid "Rates"



[tryton-commits] changeset in weblate:default Translated using Weblate (Dutch)

2022-02-07 Thread EdbO
changeset 2572020c5055 in weblate:default
details: https://hg.tryton.org/weblate?cmd=changeset&node=2572020c5055
description:
Translated using Weblate (Dutch)

Currently translated at 100.0% (790 of 790 strings)

Translation: Tryton/stock
Translate-URL: https://translate.tryton.org/projects/tryton/stock/nl/
diffstat:

 modules/stock/locale/nl.po |  781 ++--
 1 files changed, 389 insertions(+), 392 deletions(-)

diffs (2650 lines):

diff -r a9b596bd80d3 -r 2572020c5055 modules/stock/locale/nl.po
--- a/modules/stock/locale/nl.poMon Feb 07 13:47:53 2022 +
+++ b/modules/stock/locale/nl.poMon Feb 07 19:47:09 2022 +
@@ -1,7 +1,7 @@
 #
 msgid ""
 msgstr ""
-"PO-Revision-Date: 2022-01-31 15:15+\n"
+"PO-Revision-Date: 2022-02-07 20:02+\n"
 "Last-Translator: EdbO \n"
 "Language: nl\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -11,7 +11,7 @@
 
 msgctxt "field:party.address,delivery:"
 msgid "Delivery"
-msgstr "Levering(leveradres)"
+msgstr "Levering"
 
 msgctxt "field:party.contact_mechanism,delivery:"
 msgid "Delivery"
@@ -23,11 +23,11 @@
 
 msgctxt "field:party.party,locations:"
 msgid "Locations"
-msgstr "locaties"
+msgstr "Locaties"
 
 msgctxt "field:party.party,supplier_location:"
 msgid "Supplier Location"
-msgstr "Locatie van leverancier"
+msgstr "Leverancier locatie"
 
 msgctxt "field:party.party.location,customer_location:"
 msgid "Customer Location"
@@ -39,15 +39,15 @@
 
 msgctxt "field:party.party.location,supplier_location:"
 msgid "Supplier Location"
-msgstr "Locatie van leverancier"
+msgstr "Leverancier locatie"
 
 msgctxt "field:product.by_location.context,forecast_date:"
 msgid "At Date"
-msgstr "Op datum van"
+msgstr "Op datum"
 
 msgctxt "field:product.by_location.context,stock_date_end:"
 msgid "At Date"
-msgstr "Op datum van"
+msgstr "Op datum"
 
 msgctxt "field:product.cost_price.revision,company:"
 msgid "Company"
@@ -111,35 +111,35 @@
 
 msgctxt "field:stock.configuration,inventory_sequence:"
 msgid "Inventory Sequence"
-msgstr "voorraad volgorde"
+msgstr "Voorraad reeks"
 
 msgctxt "field:stock.configuration,shipment_in_return_sequence:"
 msgid "Supplier Return Shipment Sequence"
-msgstr "Leverancier Retourzending Volgorde"
+msgstr "Leverancier retourzending reeks"
 
 msgctxt "field:stock.configuration,shipment_in_sequence:"
 msgid "Supplier Shipment Sequence"
-msgstr "Leveranciersverzending Volgorde"
+msgstr "Leveranciers zending reeks"
 
 msgctxt "field:stock.configuration,shipment_internal_sequence:"
 msgid "Internal Shipment Sequence"
-msgstr "Interne verzendvolgorde"
+msgstr "Interne zending reeks"
 
 msgctxt "field:stock.configuration,shipment_internal_transit:"
 msgid "Internal Shipment Transit"
-msgstr "Interne verzending Transit"
+msgstr "Interne zending doorvoer"
 
 msgctxt "field:stock.configuration,shipment_out_return_sequence:"
 msgid "Customer Return Shipment Sequence"
-msgstr "Klant Retourzending Volgorde"
+msgstr "Klant retourzending reeks"
 
 msgctxt "field:stock.configuration,shipment_out_sequence:"
 msgid "Customer Shipment Sequence"
-msgstr "Klantverzending Volgorde"
+msgstr "Klant zending reeks"
 
 msgctxt "field:stock.configuration.location,shipment_internal_transit:"
 msgid "Internal Shipment Transit"
-msgstr "Interne verzending Transit"
+msgstr "Interne zending doorvoer"
 
 msgctxt "field:stock.configuration.sequence,company:"
 msgid "Company"
@@ -147,27 +147,27 @@
 
 msgctxt "field:stock.configuration.sequence,inventory_sequence:"
 msgid "Inventory Sequence"
-msgstr "voorraad volgorde"
+msgstr "Voorraad reeks"
 
 msgctxt "field:stock.configuration.sequence,shipment_in_return_sequence:"
 msgid "Supplier Return Shipment Sequence"
-msgstr "Leverancier Retourzending Volgorde"
+msgstr "Leverancier retourzending reeks"
 
 msgctxt "field:stock.configuration.sequence,shipment_in_sequence:"
 msgid "Supplier Shipment Sequence"
-msgstr "Leveranciersverzending Volgorde"
+msgstr "Leveranciers zending reeks"
 
 msgctxt "field:stock.configuration.sequence,shipment_internal_sequence:"
 msgid "Internal Shipment Sequence"
-msgstr "Interne verzendvolgorde"
+msgstr "Interne zending reeks"
 
 msgctxt "field:stock.configuration.sequence,shipment_out_return_sequence:"
 msgid "Customer Return Shipment Sequence"
-msgstr "Klant Retourzending Volgorde"
+msgstr "Klant retourzending reeks"
 
 msgctxt "field:stock.configuration.sequence,shipment_out_sequence:"
 msgid "Customer Shipment Sequence"
-msgstr "Klantverzending Volgorde"
+msgstr "Klant zending reeks"
 
 msgctxt "field:stock.inventory,company:"
 msgid "Company"
@@ -179,7 +179,7 @@
 
 msgctxt "field:stock.inventory,empty_quantity:"
 msgid "Empty Quantity"
-msgstr "Leeg hoeveelheid"
+msgstr "Lege hoeveelheid"
 
 msgctxt "field:stock.inventory,lines:"
 msgid "Lines"
@@ -187,7 +187,7 @@
 
 msgctxt "field:stock.inventory,location:"
 msgid "Location"
-msgstr "Plaats"
+msgstr "Locatie"
 
 msgctxt "field:stock.inventory,number:"
 msgid "Num

[tryton-commits] changeset in weblate:default Translated using Weblate (Dutch)

2022-02-07 Thread EdbO
changeset b271b7205f12 in weblate:default
details: https://hg.tryton.org/weblate?cmd=changeset&node=b271b7205f12
description:
Translated using Weblate (Dutch)

Currently translated at 100.0% (91 of 91 strings)

Translation: Tryton/stock_lot
Translate-URL: 
https://translate.tryton.org/projects/tryton/stock_lot/nl/
diffstat:

 modules/stock_lot/locale/nl.po |  10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (34 lines):

diff -r 2572020c5055 -r b271b7205f12 modules/stock_lot/locale/nl.po
--- a/modules/stock_lot/locale/nl.poMon Feb 07 19:47:09 2022 +
+++ b/modules/stock_lot/locale/nl.poMon Feb 07 19:47:07 2022 +
@@ -1,13 +1,13 @@
 #
 msgid ""
 msgstr ""
-"PO-Revision-Date: 2021-10-27 09:15+\n"
-"Last-Translator: Bert Defoor \n"
+"PO-Revision-Date: 2022-02-07 20:02+\n"
+"Last-Translator: EdbO \n"
 "Language: nl\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 4.8.1\n"
+"X-Generator: Weblate 4.10.1\n"
 
 msgctxt "field:product.configuration,default_lot_sequence:"
 msgid "Default Lot Sequence"
@@ -232,11 +232,11 @@
 
 msgctxt "model:ir.action,name:act_location_quantity_list"
 msgid "Locations List Quantity"
-msgstr "Hoeveelheidslijst per locatie"
+msgstr "Lijst met hoeveelheden per locatie"
 
 msgctxt "model:ir.action,name:act_location_quantity_tree"
 msgid "Locations Tree Quantity"
-msgstr "boomstructuur hoeveelheden per locatie"
+msgstr "Boomstructuur met hoeveelheden per locatie"
 
 msgctxt "model:ir.action,name:act_lot_form"
 msgid "Lots"



[tryton-commits] changeset in weblate:default Translated using Weblate (Dutch)

2022-02-07 Thread EdbO
changeset b0c2f3e98b28 in weblate:default
details: https://hg.tryton.org/weblate?cmd=changeset&node=b0c2f3e98b28
description:
Translated using Weblate (Dutch)

Currently translated at 100.0% (60 of 60 strings)

Translation: Tryton/attendance
Translate-URL: 
https://translate.tryton.org/projects/tryton/attendance/nl/
diffstat:

 modules/attendance/locale/nl.po |  8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r b271b7205f12 -r b0c2f3e98b28 modules/attendance/locale/nl.po
--- a/modules/attendance/locale/nl.po   Mon Feb 07 19:47:07 2022 +
+++ b/modules/attendance/locale/nl.po   Mon Feb 07 19:47:10 2022 +
@@ -3,15 +3,15 @@
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2020-07-12 11:11+\n"
-"PO-Revision-Date: 2021-04-29 10:04+\n"
-"Last-Translator: Bert Defoor \n"
+"PO-Revision-Date: 2022-02-07 20:02+\n"
+"Last-Translator: EdbO \n"
 "Language-Team: LANGUAGE \n"
 "Language: nl\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 4.6\n"
+"X-Generator: Weblate 4.10.1\n"
 
 msgctxt "field:attendance.line,at:"
 msgid "At"
@@ -170,7 +170,7 @@
 
 msgctxt "model:ir.model.button,string:period_close_button"
 msgid "Close"
-msgstr "Sluiten"
+msgstr "Afsluiten"
 
 msgctxt "model:ir.model.button,string:period_draft_button"
 msgid "Draft"



[tryton-commits] changeset in modules/party:default Add autonomous city as subdiv...

2022-02-07 Thread Adrià Tarroja Caubet
changeset d7d4e042710e in modules/party:default
details: https://hg.tryton.org/modules/party?cmd=changeset&node=d7d4e042710e
description:
Add autonomous city as subdivision type for Spain

issue11201
review389911002
diffstat:

 CHANGELOG   |  1 +
 address.xml |  2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 5052018efd6f -r d7d4e042710e CHANGELOG
--- a/CHANGELOG Thu Feb 03 23:13:26 2022 +0100
+++ b/CHANGELOG Mon Feb 07 22:55:08 2022 +0100
@@ -1,3 +1,4 @@
+* Add autonomous city as subdivision type for Spain
 * Add support for Python 3.10
 * Remove support for Python 3.6
 * Use all street lines in record name of address
diff -r 5052018efd6f -r d7d4e042710e address.xml
--- a/address.xml   Thu Feb 03 23:13:26 2022 +0100
+++ b/address.xml   Mon Feb 07 22:55:08 2022 +0100
@@ -683,7 +683,7 @@
 
 
 ES
-
+
 
 
 



[tryton-commits] changeset in modules/web_shop_shopify:default Ignore subdivision...

2022-02-07 Thread Adrià Tarroja Caubet
changeset 240c671c6be7 in modules/web_shop_shopify:default
details: 
https://hg.tryton.org/modules/web_shop_shopify?cmd=changeset&node=240c671c6be7
description:
Ignore subdivision with non valid type

issue11201
review381901002
diffstat:

 party.py |  13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r d1c9880969da -r 240c671c6be7 party.py
--- a/party.py  Thu Feb 03 22:45:21 2022 +0100
+++ b/party.py  Mon Feb 07 22:41:11 2022 +0100
@@ -59,6 +59,7 @@
 pool = Pool()
 Country = pool.get('country.country')
 Subdivision = pool.get('country.subdivision')
+SubdivisionType = pool.get('party.address.subdivision_type')
 
 values = {}
 values['party_name'] = remove_forbidden_chars(address.name or '')
@@ -75,10 +76,14 @@
 if address.province_code:
 subdivision_code = '-'.join(
 [address.country_code, address.province_code])
-subdivisions = Subdivision.search([
-('country', '=', country.id),
-('code', 'like', subdivision_code + '%'),
-], limit=1)
+subdivision_domain = [
+('country', '=', country.id),
+('code', 'like', subdivision_code + '%'),
+]
+types = SubdivisionType.get_types(country)
+if types:
+subdivision_domain.append(('type', 'in', types))
+subdivisions = Subdivision.search(subdivision_domain, limit=1)
 if subdivisions:
 subdivision, = subdivisions
 values['subdivision'] = subdivision.id



[tryton-commits] changeset in modules/account:6.2 Compute deferral balance by cum...

2022-02-07 Thread Cédric Krier
changeset 756754b57ae9 in modules/account:6.2
details: https://hg.tryton.org/modules/account?cmd=changeset&node=756754b57ae9
description:
Compute deferral balance by cumulating children account

issue11057
review376391002
(grafted from 5457ef491963844c12b1459550260718356bfffd)
diffstat:

 account.py |  35 +--
 1 files changed, 33 insertions(+), 2 deletions(-)

diffs (45 lines):

diff -r 79b5f612238a -r 756754b57ae9 account.py
--- a/account.pyTue Feb 01 18:31:58 2022 +0100
+++ b/account.pyThu Feb 03 22:20:43 2022 +0100
@@ -1498,8 +1498,39 @@
 def default_amount_second_currency(cls):
 return Decimal(0)
 
-def get_balance(self, name):
-return self.debit - self.credit
+@classmethod
+def get_balance(cls, deferrals, name):
+pool = Pool()
+Account = pool.get('account.account')
+cursor = Transaction().connection.cursor()
+
+table = cls.__table__()
+table_child = cls.__table__()
+account = Account.__table__()
+account_child = Account.__table__()
+balances = defaultdict(Decimal)
+
+for sub_deferrals in grouped_slice(deferrals):
+red_sql = reduce_ids(table.id, [d.id for d in sub_deferrals])
+cursor.execute(*table
+.join(account, condition=table.account == account.id)
+.join(account_child,
+condition=(account_child.left >= account.left)
+& (account_child.right <= account.right))
+.join(table_child,
+condition=(table_child.account == account_child.id)
+& (table_child.fiscalyear == table.fiscalyear))
+.select(
+table.id,
+Sum(table_child.debit - table_child.credit),
+where=red_sql,
+group_by=table.id))
+balances.update(dict(cursor))
+
+for id_, balance in balances.items():
+if not isinstance(balance, Decimal):
+balances[id_] = Decimal(str(balance))
+return balances
 
 def get_currency(self, name):
 return self.account.currency.id



[tryton-commits] changeset in modules/account:6.0 Compute deferral balance by cum...

2022-02-07 Thread Cédric Krier
changeset 5b9ee9781a0f in modules/account:6.0
details: https://hg.tryton.org/modules/account?cmd=changeset&node=5b9ee9781a0f
description:
Compute deferral balance by cumulating children account

issue11057
review376391002
(grafted from 5457ef491963844c12b1459550260718356bfffd)
diffstat:

 account.py |  35 +--
 1 files changed, 33 insertions(+), 2 deletions(-)

diffs (45 lines):

diff -r a8677cff3ac8 -r 5b9ee9781a0f account.py
--- a/account.pyTue Feb 01 18:32:23 2022 +0100
+++ b/account.pyThu Feb 03 22:20:43 2022 +0100
@@ -1552,8 +1552,39 @@
 def default_amount_second_currency(cls):
 return Decimal(0)
 
-def get_balance(self, name):
-return self.debit - self.credit
+@classmethod
+def get_balance(cls, deferrals, name):
+pool = Pool()
+Account = pool.get('account.account')
+cursor = Transaction().connection.cursor()
+
+table = cls.__table__()
+table_child = cls.__table__()
+account = Account.__table__()
+account_child = Account.__table__()
+balances = defaultdict(Decimal)
+
+for sub_deferrals in grouped_slice(deferrals):
+red_sql = reduce_ids(table.id, [d.id for d in sub_deferrals])
+cursor.execute(*table
+.join(account, condition=table.account == account.id)
+.join(account_child,
+condition=(account_child.left >= account.left)
+& (account_child.right <= account.right))
+.join(table_child,
+condition=(table_child.account == account_child.id)
+& (table_child.fiscalyear == table.fiscalyear))
+.select(
+table.id,
+Sum(table_child.debit - table_child.credit),
+where=red_sql,
+group_by=table.id))
+balances.update(dict(cursor))
+
+for id_, balance in balances.items():
+if not isinstance(balance, Decimal):
+balances[id_] = Decimal(str(balance))
+return balances
 
 def get_currency(self, name):
 return self.account.currency.id



[tryton-commits] changeset in modules/account:5.0 Compute deferral balance by cum...

2022-02-07 Thread Cédric Krier
changeset 226b2fb53672 in modules/account:5.0
details: https://hg.tryton.org/modules/account?cmd=changeset&node=226b2fb53672
description:
Compute deferral balance by cumulating children account

issue11057
review376391002
(grafted from 5457ef491963844c12b1459550260718356bfffd)
diffstat:

 account.py |  35 +--
 1 files changed, 33 insertions(+), 2 deletions(-)

diffs (45 lines):

diff -r 3a6589264869 -r 226b2fb53672 account.py
--- a/account.pyTue Feb 01 18:32:49 2022 +0100
+++ b/account.pyThu Feb 03 22:20:43 2022 +0100
@@ -1183,8 +1183,39 @@
 def default_amount_second_currency(cls):
 return Decimal(0)
 
-def get_balance(self, name):
-return self.debit - self.credit
+@classmethod
+def get_balance(cls, deferrals, name):
+pool = Pool()
+Account = pool.get('account.account')
+cursor = Transaction().connection.cursor()
+
+table = cls.__table__()
+table_child = cls.__table__()
+account = Account.__table__()
+account_child = Account.__table__()
+balances = defaultdict(Decimal)
+
+for sub_deferrals in grouped_slice(deferrals):
+red_sql = reduce_ids(table.id, [d.id for d in sub_deferrals])
+cursor.execute(*table
+.join(account, condition=table.account == account.id)
+.join(account_child,
+condition=(account_child.left >= account.left)
+& (account_child.right <= account.right))
+.join(table_child,
+condition=(table_child.account == account_child.id)
+& (table_child.fiscalyear == table.fiscalyear))
+.select(
+table.id,
+Sum(table_child.debit - table_child.credit),
+where=red_sql,
+group_by=table.id))
+balances.update(dict(cursor))
+
+for id_, balance in balances.items():
+if not isinstance(balance, Decimal):
+balances[id_] = Decimal(str(balance))
+return balances
 
 def get_currency(self, name):
 return self.account.currency.id



[tryton-commits] changeset in modules/account:6.2 Use select to True on create_date

2022-02-07 Thread Cédric Krier
changeset 1e9ea72fc08c in modules/account:6.2
details: https://hg.tryton.org/modules/account?cmd=changeset&node=1e9ea72fc08c
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from 84e07157a0fc32fca47ff6fb52c8d7253cb6384d)
diffstat:

 move.py |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r 756754b57ae9 -r 1e9ea72fc08c move.py
--- a/move.py   Thu Feb 03 22:20:43 2022 +0100
+++ b/move.py   Thu Feb 03 22:29:08 2022 +0100
@@ -89,6 +89,7 @@
 @classmethod
 def __setup__(cls):
 super(Move, cls).__setup__()
+cls.create_date.select = True
 cls._check_modify_exclude = ['lines']
 cls._order.insert(0, ('date', 'DESC'))
 cls._order.insert(1, ('number', 'DESC'))
@@ -130,9 +131,6 @@
 table = cls.__table_handler__(module_name)
 table.index_action(['journal', 'period'], 'add')
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 @classmethod
 def order_post_number(cls, tables):
 table, _ = tables[None]



[tryton-commits] changeset in modules/account:6.0 Use select to True on create_date

2022-02-07 Thread Cédric Krier
changeset 983576012164 in modules/account:6.0
details: https://hg.tryton.org/modules/account?cmd=changeset&node=983576012164
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from 84e07157a0fc32fca47ff6fb52c8d7253cb6384d)
diffstat:

 move.py |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r 5b9ee9781a0f -r 983576012164 move.py
--- a/move.py   Thu Feb 03 22:20:43 2022 +0100
+++ b/move.py   Thu Feb 03 22:29:08 2022 +0100
@@ -87,6 +87,7 @@
 @classmethod
 def __setup__(cls):
 super(Move, cls).__setup__()
+cls.create_date.select = True
 cls._check_modify_exclude = ['lines']
 cls._order.insert(0, ('date', 'DESC'))
 cls._order.insert(1, ('number', 'DESC'))
@@ -128,9 +129,6 @@
 table = cls.__table_handler__(module_name)
 table.index_action(['journal', 'period'], 'add')
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 @classmethod
 def order_post_number(cls, tables):
 table, _ = tables[None]



[tryton-commits] changeset in modules/account:5.0 Use select to True on create_date

2022-02-07 Thread Cédric Krier
changeset 433d54abecde in modules/account:5.0
details: https://hg.tryton.org/modules/account?cmd=changeset&node=433d54abecde
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from 84e07157a0fc32fca47ff6fb52c8d7253cb6384d)
diffstat:

 move.py |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r 226b2fb53672 -r 433d54abecde move.py
--- a/move.py   Thu Feb 03 22:20:43 2022 +0100
+++ b/move.py   Thu Feb 03 22:29:08 2022 +0100
@@ -82,6 +82,7 @@
 @classmethod
 def __setup__(cls):
 super(Move, cls).__setup__()
+cls.create_date.select = True
 cls._check_modify_exclude = []
 cls._order.insert(0, ('date', 'DESC'))
 cls._order.insert(1, ('number', 'DESC'))
@@ -136,9 +137,6 @@
 table = cls.__table_handler__(module_name)
 table.index_action(['journal', 'period'], 'add')
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 @classmethod
 def order_post_number(cls, tables):
 table, _ = tables[None]



[tryton-commits] changeset in modules/account_invoice:6.2 Warn all past payment t...

2022-02-07 Thread Adrià Tarroja Caubet
changeset ca52edd2cc02 in modules/account_invoice:6.2
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset&node=ca52edd2cc02
description:
Warn all past payment terms at the same time

issue11058
review376221002
(grafted from 02be5467be12c4fabc75e31f3977faabe8155259)
diffstat:

 invoice.py |  22 --
 1 files changed, 12 insertions(+), 10 deletions(-)

diffs (37 lines):

diff -r 810106ec8a65 -r ca52edd2cc02 invoice.py
--- a/invoice.pyWed Feb 02 23:35:20 2022 +0100
+++ b/invoice.pyTue Jan 25 23:30:35 2022 +0100
@@ -1019,21 +1019,23 @@
 remainder_total_currency = self.total_amount.copy_sign(total)
 else:
 remainder_total_currency = 0
+past_payment_term_dates = []
 for date, amount in term_lines:
-if self.type == 'out' and date < today:
-lang = Lang.get()
-warning_key = Warning.format('invoice_payment_term', [self])
-if Warning.check(warning_key):
-raise InvoicePaymentTermDateWarning(warning_key,
-gettext('account_invoice'
-'.msg_invoice_payment_term_date_past',
-invoice=self.rec_name,
-date=lang.strftime(date)))
-
 line = self._get_move_line(date, amount)
 if line.amount_second_currency:
 remainder_total_currency += line.amount_second_currency
 move_lines.append(line)
+if self.type == 'out' and date < today:
+past_payment_term_dates.append(date)
+if any(past_payment_term_dates):
+lang = Lang.get()
+warning_key = Warning.format('invoice_payment_term', [self])
+if Warning.check(warning_key):
+raise InvoicePaymentTermDateWarning(warning_key,
+gettext('account_invoice'
+'.msg_invoice_payment_term_date_past',
+invoice=self.rec_name,
+date=lang.strftime(min(past_payment_term_dates
 if not self.currency.is_zero(remainder_total_currency):
 move_lines[-1].amount_second_currency -= \
 remainder_total_currency



[tryton-commits] changeset in modules/account_invoice:6.0 Warn all past payment t...

2022-02-07 Thread Adrià Tarroja Caubet
changeset 28f7a05bf0f8 in modules/account_invoice:6.0
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset&node=28f7a05bf0f8
description:
Warn all past payment terms at the same time

issue11058
review376221002
(grafted from 02be5467be12c4fabc75e31f3977faabe8155259)
diffstat:

 invoice.py |  22 --
 1 files changed, 12 insertions(+), 10 deletions(-)

diffs (37 lines):

diff -r 1d5b48634551 -r 28f7a05bf0f8 invoice.py
--- a/invoice.pyFri Nov 05 00:18:37 2021 +0100
+++ b/invoice.pyTue Jan 25 23:30:35 2022 +0100
@@ -996,21 +996,23 @@
 remainder_total_currency = self.total_amount.copy_sign(total)
 else:
 remainder_total_currency = 0
+past_payment_term_dates = []
 for date, amount in term_lines:
-if self.type == 'out' and date < today:
-lang = Lang.get()
-warning_key = 'invoice_payment_term_%d' % self.id
-if Warning.check(warning_key):
-raise InvoicePaymentTermDateWarning(warning_key,
-gettext('account_invoice'
-'.msg_invoice_payment_term_date_past',
-invoice=self.rec_name,
-date=lang.strftime(date)))
-
 line = self._get_move_line(date, amount)
 if line.amount_second_currency:
 remainder_total_currency += line.amount_second_currency
 move_lines.append(line)
+if self.type == 'out' and date < today:
+past_payment_term_dates.append(date)
+if any(past_payment_term_dates):
+lang = Lang.get()
+warning_key = 'invoice_payment_term_%d' % self.id
+if Warning.check(warning_key):
+raise InvoicePaymentTermDateWarning(warning_key,
+gettext('account_invoice'
+'.msg_invoice_payment_term_date_past',
+invoice=self.rec_name,
+date=lang.strftime(min(past_payment_term_dates
 if not self.currency.is_zero(remainder_total_currency):
 move_lines[-1].amount_second_currency -= \
 remainder_total_currency



[tryton-commits] changeset in modules/account_invoice:6.2 Prevent using the same ...

2022-02-07 Thread Cédric Krier
changeset 01b9a0d65df8 in modules/account_invoice:6.2
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset&node=01b9a0d65df8
description:
Prevent using the same account on tax than invoice

The total computation relies on the invoice account to be only used for 
the
term lines.

issue11151
review366571002
(grafted from c06071662b824c75bc30ce5ee0af1bf3a4748478)
diffstat:

 invoice.py |  14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diffs (24 lines):

diff -r ca52edd2cc02 -r 01b9a0d65df8 invoice.py
--- a/invoice.pyTue Jan 25 23:30:35 2022 +0100
+++ b/invoice.pySun Jan 30 01:19:23 2022 +0100
@@ -2693,6 +2693,20 @@
 invoice=invoice.rec_name))
 return super(InvoiceTax, cls).create(vlist)
 
+@classmethod
+def validate(cls, taxes):
+super().validate(taxes)
+for tax in taxes:
+tax.check_same_account()
+
+def check_same_account(self):
+if self.account == self.invoice.account:
+raise InvoiceTaxValidationError(
+gettext('account_invoice.msg_invoice_same_account_line',
+account=self.account.rec_name,
+invoice=self.invoice.rec_name,
+line=self.rec_name))
+
 def get_move_lines(self):
 '''
 Return a list of move lines instances for invoice tax



[tryton-commits] changeset in modules/account_invoice:6.0 Prevent using the same ...

2022-02-07 Thread Cédric Krier
changeset a877caf351d0 in modules/account_invoice:6.0
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset&node=a877caf351d0
description:
Prevent using the same account on tax than invoice

The total computation relies on the invoice account to be only used for 
the
term lines.

issue11151
review366571002
(grafted from c06071662b824c75bc30ce5ee0af1bf3a4748478)
diffstat:

 invoice.py |  14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diffs (24 lines):

diff -r 28f7a05bf0f8 -r a877caf351d0 invoice.py
--- a/invoice.pyTue Jan 25 23:30:35 2022 +0100
+++ b/invoice.pySun Jan 30 01:19:23 2022 +0100
@@ -2637,6 +2637,20 @@
 invoice=invoice.rec_name))
 return super(InvoiceTax, cls).create(vlist)
 
+@classmethod
+def validate(cls, taxes):
+super().validate(taxes)
+for tax in taxes:
+tax.check_same_account()
+
+def check_same_account(self):
+if self.account == self.invoice.account:
+raise InvoiceTaxValidationError(
+gettext('account_invoice.msg_invoice_same_account_line',
+account=self.account.rec_name,
+invoice=self.invoice.rec_name,
+line=self.rec_name))
+
 def get_move_lines(self):
 '''
 Return a list of move lines instances for invoice tax



[tryton-commits] changeset in modules/account_invoice:6.2 Convert report into byt...

2022-02-07 Thread Cédric Krier
changeset 59a2c5a5f428 in modules/account_invoice:6.2
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset&node=59a2c5a5f428
description:
Convert report into bytes before storing

If the invoice report has a text output, we must encode it as utf-8 
before
storing it.
And we do not need to convert to bytes the data read because Binary 
field is
already doing that.

issue10937
review376581002
(grafted from a22984e8d5324c2ee018fa9b91e89bb5cefefd4c)
diffstat:

 invoice.py |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r 01b9a0d65df8 -r 59a2c5a5f428 invoice.py
--- a/invoice.pySun Jan 30 01:19:23 2022 +0100
+++ b/invoice.pyThu Feb 03 22:25:56 2022 +0100
@@ -2836,7 +2836,7 @@
 if invoice.invoice_report_cache:
 return (
 invoice.invoice_report_format,
-bytes(invoice.invoice_report_cache))
+invoice.invoice_report_cache)
 else:
 result = super()._execute(records, header, data, action)
 # If the invoice is posted or paid and the report not saved in
@@ -2844,6 +2844,8 @@
 # now in invoice_report_cache
 if invoice.state in {'posted', 'paid'} and invoice.type == 'out':
 format_, data = result
+if isinstance(data, str):
+data = bytes(data, 'utf-8')
 invoice.invoice_report_format = format_
 invoice.invoice_report_cache = \
 Invoice.invoice_report_cache.cast(data)



[tryton-commits] changeset in modules/account_invoice:6.0 Convert report into byt...

2022-02-07 Thread Cédric Krier
changeset 79aec7c017d8 in modules/account_invoice:6.0
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset&node=79aec7c017d8
description:
Convert report into bytes before storing

If the invoice report has a text output, we must encode it as utf-8 
before
storing it.
And we do not need to convert to bytes the data read because Binary 
field is
already doing that.

issue10937
review376581002
(grafted from a22984e8d5324c2ee018fa9b91e89bb5cefefd4c)
diffstat:

 invoice.py |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r a877caf351d0 -r 79aec7c017d8 invoice.py
--- a/invoice.pySun Jan 30 01:19:23 2022 +0100
+++ b/invoice.pyThu Feb 03 22:25:56 2022 +0100
@@ -2769,7 +2769,7 @@
 if invoice.invoice_report_cache:
 return (
 invoice.invoice_report_format,
-bytes(invoice.invoice_report_cache))
+invoice.invoice_report_cache)
 else:
 result = super()._execute(records, header, data, action)
 # If the invoice is posted or paid and the report not saved in
@@ -2777,6 +2777,8 @@
 # now in invoice_report_cache
 if invoice.state in {'posted', 'paid'} and invoice.type == 'out':
 format_, data = result
+if isinstance(data, str):
+data = bytes(data, 'utf-8')
 invoice.invoice_report_format = format_
 invoice.invoice_report_cache = \
 Invoice.invoice_report_cache.cast(data)



[tryton-commits] changeset in modules/account_invoice:5.0 Convert report into byt...

2022-02-07 Thread Cédric Krier
changeset b548a46aeded in modules/account_invoice:5.0
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset&node=b548a46aeded
description:
Convert report into bytes before storing

If the invoice report has a text output, we must encode it as utf-8 
before
storing it.
And we do not need to convert to bytes the data read because Binary 
field is
already doing that.

issue10937
review376581002
(grafted from a22984e8d5324c2ee018fa9b91e89bb5cefefd4c)
diffstat:

 invoice.py |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r 7571bb17249d -r b548a46aeded invoice.py
--- a/invoice.pyFri Nov 05 00:19:15 2021 +0100
+++ b/invoice.pyThu Feb 03 22:25:56 2022 +0100
@@ -2425,7 +2425,7 @@
 if invoice.invoice_report_cache:
 return (
 invoice.invoice_report_format,
-bytes(invoice.invoice_report_cache))
+invoice.invoice_report_cache)
 else:
 result = super(InvoiceReport, cls)._execute(records, data, action)
 # If the invoice is posted or paid and the report not saved in
@@ -2433,6 +2433,8 @@
 # now in invoice_report_cache
 if invoice.state in {'posted', 'paid'} and invoice.type == 'out':
 format_, data = result
+if isinstance(data, str):
+data = bytes(data, 'utf-8')
 invoice.invoice_report_format = format_
 invoice.invoice_report_cache = \
 Invoice.invoice_report_cache.cast(data)



[tryton-commits] changeset in modules/account_invoice:6.2 Use select to True on c...

2022-02-07 Thread Cédric Krier
changeset b7722aac2028 in modules/account_invoice:6.2
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset&node=b7722aac2028
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from 0621a612c34f8f227f82b142e4f263e985613bf3)
diffstat:

 invoice.py |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r 59a2c5a5f428 -r b7722aac2028 invoice.py
--- a/invoice.pyThu Feb 03 22:25:56 2022 +0100
+++ b/invoice.pyThu Feb 03 22:29:08 2022 +0100
@@ -266,6 +266,7 @@
 @classmethod
 def __setup__(cls):
 super(Invoice, cls).__setup__()
+cls.create_date.select = True
 cls._check_modify_exclude = {
 'state', 'payment_lines', 'move', 'cancel_move',
 'additional_moves', 'invoice_report_cache',
@@ -410,9 +411,6 @@
 # Migration from 4.0: Drop not null on payment_term
 table.not_null_action('payment_term', 'remove')
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],



[tryton-commits] changeset in modules/account_invoice:6.0 Use select to True on c...

2022-02-07 Thread Cédric Krier
changeset 608f39bc1c25 in modules/account_invoice:6.0
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset&node=608f39bc1c25
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from 0621a612c34f8f227f82b142e4f263e985613bf3)
diffstat:

 invoice.py |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r 79aec7c017d8 -r 608f39bc1c25 invoice.py
--- a/invoice.pyThu Feb 03 22:25:56 2022 +0100
+++ b/invoice.pyThu Feb 03 22:29:08 2022 +0100
@@ -257,6 +257,7 @@
 @classmethod
 def __setup__(cls):
 super(Invoice, cls).__setup__()
+cls.create_date.select = True
 cls._check_modify_exclude = {
 'state', 'payment_lines', 'move', 'cancel_move',
 'invoice_report_cache', 'invoice_report_format', 'lines'}
@@ -395,9 +396,6 @@
 # Migration from 4.0: Drop not null on payment_term
 table.not_null_action('payment_term', 'remove')
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],



[tryton-commits] changeset in modules/account_invoice_defer:6.2 Add company to on...

2022-02-07 Thread Raimon Esteve
changeset 338e0737113a in modules/account_invoice_defer:6.2
details: 
https://hg.tryton.org/modules/account_invoice_defer?cmd=changeset&node=338e0737113a
description:
Add company to on_change_invoice_line depends

issue11006
review374381002
(grafted from 0af0af5a339be1a1a9ef576888ebc782c3bf0455)
diffstat:

 account.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r a734f4884858 -r 338e0737113a account.py
--- a/account.pySat Jan 15 16:26:50 2022 +0100
+++ b/account.pyTue Jan 25 23:26:47 2022 +0100
@@ -164,7 +164,7 @@
 if journals:
 self.journal, = journals
 
-@fields.depends('invoice_line', 'start_date')
+@fields.depends('invoice_line', 'start_date', 'company')
 def on_change_invoice_line(self):
 pool = Pool()
 Currency = pool.get('currency.currency')
@@ -172,7 +172,7 @@
 if not self.start_date:
 self.start_date = self.invoice_line.invoice.invoice_date
 invoice = self.invoice_line.invoice
-if invoice.currency != self.company.currency:
+if self.company and invoice.currency != self.company.currency:
 with Transaction().set_context(date=invoice.currency_date):
 self.amount = Currency.compute(
 invoice.currency, self.invoice_line.amount,



[tryton-commits] changeset in modules/account_invoice:5.0 Use select to True on c...

2022-02-07 Thread Cédric Krier
changeset 485a7fd520d6 in modules/account_invoice:5.0
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset&node=485a7fd520d6
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from 0621a612c34f8f227f82b142e4f263e985613bf3)
diffstat:

 invoice.py |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r b548a46aeded -r 485a7fd520d6 invoice.py
--- a/invoice.pyThu Feb 03 22:25:56 2022 +0100
+++ b/invoice.pyThu Feb 03 22:29:08 2022 +0100
@@ -219,6 +219,7 @@
 @classmethod
 def __setup__(cls):
 super(Invoice, cls).__setup__()
+cls.create_date.select = True
 cls._check_modify_exclude = ['state', 'payment_lines', 'cancel_move',
 'invoice_report_cache', 'invoice_report_format']
 cls._order = [
@@ -374,9 +375,6 @@
 # Migration from 4.0: Drop not null on payment_term
 table.not_null_action('payment_term', 'remove')
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 @staticmethod
 def default_type():
 return Transaction().context.get('type', 'out')



[tryton-commits] changeset in modules/account_invoice_defer:6.0 Add company to on...

2022-02-07 Thread Raimon Esteve
changeset b467272bf61a in modules/account_invoice_defer:6.0
details: 
https://hg.tryton.org/modules/account_invoice_defer?cmd=changeset&node=b467272bf61a
description:
Add company to on_change_invoice_line depends

issue11006
review374381002
(grafted from 0af0af5a339be1a1a9ef576888ebc782c3bf0455)
diffstat:

 account.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r b09407e920e2 -r b467272bf61a account.py
--- a/account.pySat Jan 15 16:27:25 2022 +0100
+++ b/account.pyTue Jan 25 23:26:47 2022 +0100
@@ -164,7 +164,7 @@
 if journals:
 self.journal, = journals
 
-@fields.depends('invoice_line', 'start_date')
+@fields.depends('invoice_line', 'start_date', 'company')
 def on_change_invoice_line(self):
 pool = Pool()
 Currency = pool.get('currency.currency')
@@ -172,7 +172,7 @@
 if not self.start_date:
 self.start_date = self.invoice_line.invoice.invoice_date
 invoice = self.invoice_line.invoice
-if invoice.currency != self.company.currency:
+if self.company and invoice.currency != self.company.currency:
 with Transaction().set_context(date=invoice.currency_date):
 self.amount = Currency.compute(
 invoice.currency, self.invoice_line.amount,



[tryton-commits] changeset in modules/account_payment:6.2 Group processed payment...

2022-02-07 Thread Cédric Krier
changeset 5d461390ebd7 in modules/account_payment:6.2
details: 
https://hg.tryton.org/modules/account_payment?cmd=changeset&node=5d461390ebd7
description:
Group processed payments by company

issue11161
review385811009
(grafted from ff7d1bdb78cbbcb3f7bb6245acdae9438adbe8bb)
diffstat:

 payment.py |  6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (16 lines):

diff -r 3929f36408d1 -r 5d461390ebd7 payment.py
--- a/payment.pyTue Feb 01 18:30:48 2022 +0100
+++ b/payment.pySun Jan 30 01:21:05 2022 +0100
@@ -569,7 +569,11 @@
 process = StateAction('account_payment.act_payment_group_form')
 
 def _group_payment_key(self, payment):
-return (('journal', payment.journal.id), ('kind', payment.kind))
+return (
+('company', payment.company.id),
+('journal', payment.journal.id),
+('kind', payment.kind),
+)
 
 def _new_group(self, values):
 pool = Pool()



[tryton-commits] changeset in modules/account_payment:6.0 Group processed payment...

2022-02-07 Thread Cédric Krier
changeset e9c64e43f1de in modules/account_payment:6.0
details: 
https://hg.tryton.org/modules/account_payment?cmd=changeset&node=e9c64e43f1de
description:
Group processed payments by company

issue11161
review385811009
(grafted from ff7d1bdb78cbbcb3f7bb6245acdae9438adbe8bb)
diffstat:

 payment.py |  6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (16 lines):

diff -r 9df8d2abe1e1 -r e9c64e43f1de payment.py
--- a/payment.pyTue Feb 01 18:31:08 2022 +0100
+++ b/payment.pySun Jan 30 01:21:05 2022 +0100
@@ -539,7 +539,11 @@
 process = StateAction('account_payment.act_payment_group_form')
 
 def _group_payment_key(self, payment):
-return (('journal', payment.journal.id), ('kind', payment.kind))
+return (
+('company', payment.company.id),
+('journal', payment.journal.id),
+('kind', payment.kind),
+)
 
 def _new_group(self, values):
 pool = Pool()



[tryton-commits] changeset in modules/account_statement:6.2 Do no copy lines when...

2022-02-07 Thread Cédric Krier
changeset 0793f53092b5 in modules/account_statement:6.2
details: 
https://hg.tryton.org/modules/account_statement?cmd=changeset&node=0793f53092b5
description:
Do no copy lines when statement has origins

issue11182
review366631002
(grafted from 4a7701368f61ac6f49c54d2466e82e2786e05db5)
diffstat:

 statement.py|  20 
 tests/scenario_statement_origin.rst |   4 
 2 files changed, 24 insertions(+), 0 deletions(-)

diffs (48 lines):

diff -r 876730143ff2 -r 0793f53092b5 statement.py
--- a/statement.py  Tue Feb 01 18:29:33 2022 +0100
+++ b/statement.py  Sun Jan 30 13:16:08 2022 +0100
@@ -650,6 +650,20 @@
 def reconcile(cls, statements):
 pass
 
+@classmethod
+def copy(cls, statements, default=None):
+default = default.copy() if default is not None else {}
+new_statements = []
+for origins, sub_statements in groupby(
+statements, key=lambda s: bool(s.origins)):
+sub_statements = list(sub_statements)
+sub_default = default.copy()
+if origins:
+sub_default.setdefault('lines')
+new_statements.extend(super().copy(
+statements, default=sub_default))
+return new_statements
+
 
 def origin_mixin(_states, _depends):
 class Mixin:
@@ -1124,6 +1138,12 @@
 group_by=table.id))
 return [('id', 'in', query)]
 
+@classmethod
+def copy(cls, origins, default=None):
+default = default.copy() if default is not None else {}
+default.setdefault('lines')
+return super().copy(origins, default=default)
+
 
 del _states, _depends
 
diff -r 876730143ff2 -r 0793f53092b5 tests/scenario_statement_origin.rst
--- a/tests/scenario_statement_origin.rst   Tue Feb 01 18:29:33 2022 +0100
+++ b/tests/scenario_statement_origin.rst   Sun Jan 30 13:16:08 2022 +0100
@@ -114,3 +114,7 @@
 
 >>> report = Report('account.statement')
 >>> _ = report.execute([statement], {})
+
+Test copy statement::
+
+>>> _ = statement.duplicate()



[tryton-commits] changeset in modules/account_statement:6.0 Do no copy lines when...

2022-02-07 Thread Cédric Krier
changeset 2e6bd2c60344 in modules/account_statement:6.0
details: 
https://hg.tryton.org/modules/account_statement?cmd=changeset&node=2e6bd2c60344
description:
Do no copy lines when statement has origins

issue11182
review366631002
(grafted from 4a7701368f61ac6f49c54d2466e82e2786e05db5)
diffstat:

 statement.py|  20 
 tests/scenario_statement_origin.rst |   4 
 2 files changed, 24 insertions(+), 0 deletions(-)

diffs (48 lines):

diff -r 13cad262ac2d -r 2e6bd2c60344 statement.py
--- a/statement.py  Tue Feb 01 18:30:20 2022 +0100
+++ b/statement.py  Sun Jan 30 13:16:08 2022 +0100
@@ -668,6 +668,20 @@
 def reconcile(cls, statements):
 pass
 
+@classmethod
+def copy(cls, statements, default=None):
+default = default.copy() if default is not None else {}
+new_statements = []
+for origins, sub_statements in groupby(
+statements, key=lambda s: bool(s.origins)):
+sub_statements = list(sub_statements)
+sub_default = default.copy()
+if origins:
+sub_default.setdefault('lines')
+new_statements.extend(super().copy(
+statements, default=sub_default))
+return new_statements
+
 
 def origin_mixin(_states, _depends):
 class Mixin:
@@ -1158,6 +1172,12 @@
 group_by=table.id))
 return [('id', 'in', query)]
 
+@classmethod
+def copy(cls, origins, default=None):
+default = default.copy() if default is not None else {}
+default.setdefault('lines')
+return super().copy(origins, default=default)
+
 
 del _states, _depends
 
diff -r 13cad262ac2d -r 2e6bd2c60344 tests/scenario_statement_origin.rst
--- a/tests/scenario_statement_origin.rst   Tue Feb 01 18:30:20 2022 +0100
+++ b/tests/scenario_statement_origin.rst   Sun Jan 30 13:16:08 2022 +0100
@@ -114,3 +114,7 @@
 
 >>> report = Report('account.statement')
 >>> _ = report.execute([statement], {})
+
+Test copy statement::
+
+>>> _ = statement.duplicate()



[tryton-commits] changeset in modules/product_kit:6.0 Use planned shipping and de...

2022-02-07 Thread Cédric Krier
changeset b073e3b07d1c in modules/product_kit:6.0
details: 
https://hg.tryton.org/modules/product_kit?cmd=changeset&node=b073e3b07d1c
description:
Use planned shipping and delivery date for move planned date

issue11185
review364701002
(grafted from a9bc9a58f16c01e591636107bb934d9d31409c64)
diffstat:

 purchase.py |  12 +---
 sale.py |  12 +---
 2 files changed, 2 insertions(+), 22 deletions(-)

diffs (58 lines):

diff -r ab6d8621619c -r b073e3b07d1c purchase.py
--- a/purchase.py   Fri Oct 15 17:26:59 2021 +0200
+++ b/purchase.py   Sun Jan 30 13:14:44 2022 +0100
@@ -67,7 +67,6 @@
 from trytond.modules.purchase.exceptions import PartyLocationError
 pool = Pool()
 Move = pool.get('stock.move')
-Date = pool.get('ir.date')
 
 if (self.quantity >= 0) != (move_type == 'in'):
 return
@@ -98,16 +97,7 @@
 move.unit_price = round_price(
 self.line.unit_price * self.price_ratio)
 move.currency = self.line.purchase.currency
-if self.moves:
-# backorder can not be planned but shipping date could be used
-# if set in the future
-if (self.line.delivery_date
-and self.line.delivery_date > Date.today()):
-move.planned_date = self.line.shipping_date
-else:
-move.planned_date = None
-else:
-move.planned_date = self.line.delivery_date
+move.planned_date = self.line.planned_delivery_date
 move.origin = self
 return move
 
diff -r ab6d8621619c -r b073e3b07d1c sale.py
--- a/sale.py   Fri Oct 15 17:26:59 2021 +0200
+++ b/sale.py   Sun Jan 30 13:14:44 2022 +0100
@@ -68,7 +68,6 @@
 from trytond.modules.sale.exceptions import PartyLocationError
 pool = Pool()
 Move = pool.get('stock.move')
-Date = pool.get('ir.date')
 if (shipment_type == 'out') != (self.quantity >= 0):
 return
 
@@ -98,16 +97,7 @@
 move.unit_price = round_price(
 self.line.unit_price * self.price_ratio)
 move.currency = self.line.sale.currency
-if self.moves:
-# backorder can not be planned but shipping date could be used
-# if set in the future
-today = Date.today()
-if self.line.shipping_date and self.line.shipping_date > today:
-move.planned_date = self.line.shipping_date
-else:
-move.planned_date = today
-else:
-move.planned_date = self.line.shipping_date
+move.planned_date = self.line.planned_shipping_date
 move.origin = self
 return move
 



[tryton-commits] changeset in modules/product_kit:6.2 Use planned shipping and de...

2022-02-07 Thread Cédric Krier
changeset 04bbe9c43b2a in modules/product_kit:6.2
details: 
https://hg.tryton.org/modules/product_kit?cmd=changeset&node=04bbe9c43b2a
description:
Use planned shipping and delivery date for move planned date

issue11185
review364701002
(grafted from a9bc9a58f16c01e591636107bb934d9d31409c64)
diffstat:

 purchase.py |  12 +---
 sale.py |  12 +---
 2 files changed, 2 insertions(+), 22 deletions(-)

diffs (58 lines):

diff -r 0e7a211897bd -r 04bbe9c43b2a purchase.py
--- a/purchase.py   Mon Nov 01 17:30:33 2021 +0100
+++ b/purchase.py   Sun Jan 30 13:14:44 2022 +0100
@@ -72,7 +72,6 @@
 from trytond.modules.purchase.exceptions import PartyLocationError
 pool = Pool()
 Move = pool.get('stock.move')
-Date = pool.get('ir.date')
 
 if (self.quantity >= 0) != (move_type == 'in'):
 return
@@ -103,16 +102,7 @@
 move.unit_price = round_price(
 self.line.unit_price * self.price_ratio)
 move.currency = self.line.purchase.currency
-if self.moves:
-# backorder can not be planned but shipping date could be used
-# if set in the future
-if (self.line.delivery_date
-and self.line.delivery_date > Date.today()):
-move.planned_date = self.line.shipping_date
-else:
-move.planned_date = None
-else:
-move.planned_date = self.line.delivery_date
+move.planned_date = self.line.planned_delivery_date
 move.origin = self
 return move
 
diff -r 0e7a211897bd -r 04bbe9c43b2a sale.py
--- a/sale.py   Mon Nov 01 17:30:33 2021 +0100
+++ b/sale.py   Sun Jan 30 13:14:44 2022 +0100
@@ -74,7 +74,6 @@
 from trytond.modules.sale.exceptions import PartyLocationError
 pool = Pool()
 Move = pool.get('stock.move')
-Date = pool.get('ir.date')
 if (shipment_type == 'out') != (self.quantity >= 0):
 return
 
@@ -104,16 +103,7 @@
 move.unit_price = round_price(
 self.line.unit_price * self.price_ratio)
 move.currency = self.line.sale.currency
-if self.moves:
-# backorder can not be planned but shipping date could be used
-# if set in the future
-today = Date.today()
-if self.line.shipping_date and self.line.shipping_date > today:
-move.planned_date = self.line.shipping_date
-else:
-move.planned_date = today
-else:
-move.planned_date = self.line.shipping_date
+move.planned_date = self.line.planned_shipping_date
 move.origin = self
 return move
 



[tryton-commits] changeset in modules/purchase:6.2 Use select to True on create_date

2022-02-07 Thread Cédric Krier
changeset 75cb41081d90 in modules/purchase:6.2
details: https://hg.tryton.org/modules/purchase?cmd=changeset&node=75cb41081d90
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from b6547efd68b65333187775ad1a01416bee2e3043)
diffstat:

 purchase.py |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r 17e01ea414a1 -r 75cb41081d90 purchase.py
--- a/purchase.py   Mon Nov 01 17:20:59 2021 +0100
+++ b/purchase.py   Thu Feb 03 22:29:08 2022 +0100
@@ -240,6 +240,7 @@
 @classmethod
 def __setup__(cls):
 super(Purchase, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('purchase_date', 'DESC NULLS FIRST'),
 ('id', 'DESC'),
@@ -360,9 +361,6 @@
 values=['processing'],
 where=sql_table.id.in_(sub_query.select(sub_query.id
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],



[tryton-commits] changeset in modules/purchase:6.0 Use select to True on create_date

2022-02-07 Thread Cédric Krier
changeset 89c895b57661 in modules/purchase:6.0
details: https://hg.tryton.org/modules/purchase?cmd=changeset&node=89c895b57661
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from b6547efd68b65333187775ad1a01416bee2e3043)
diffstat:

 purchase.py |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r e5d67d7913cf -r 89c895b57661 purchase.py
--- a/purchase.py   Fri Nov 05 00:12:01 2021 +0100
+++ b/purchase.py   Thu Feb 03 22:29:08 2022 +0100
@@ -243,6 +243,7 @@
 @classmethod
 def __setup__(cls):
 super(Purchase, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('purchase_date', 'DESC NULLS FIRST'),
 ('id', 'DESC'),
@@ -363,9 +364,6 @@
 values=['processing'],
 where=sql_table.id.in_(sub_query.select(sub_query.id
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],



[tryton-commits] changeset in modules/purchase:5.0 Use select to True on create_date

2022-02-07 Thread Cédric Krier
changeset e5f86ebc54b1 in modules/purchase:5.0
details: https://hg.tryton.org/modules/purchase?cmd=changeset&node=e5f86ebc54b1
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from b6547efd68b65333187775ad1a01416bee2e3043)
diffstat:

 purchase.py |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r 15d932b58b29 -r e5f86ebc54b1 purchase.py
--- a/purchase.py   Fri Nov 05 00:12:40 2021 +0100
+++ b/purchase.py   Thu Feb 03 22:29:08 2022 +0100
@@ -193,6 +193,7 @@
 @classmethod
 def __setup__(cls):
 super(Purchase, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('purchase_date', 'DESC'),
 ('id', 'DESC'),
@@ -316,9 +317,6 @@
 values=['processing'],
 where=sql_table.id.in_(sub_query.select(sub_query.id
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 @classmethod
 def default_payment_term(cls):
 PaymentTerm = Pool().get('account.invoice.payment_term')



[tryton-commits] changeset in modules/purchase_price_list:6.2 Use purchase_uom in...

2022-02-07 Thread Juanjo Garcia
changeset e753cccab3aa in modules/purchase_price_list:6.2
details: 
https://hg.tryton.org/modules/purchase_price_list?cmd=changeset&node=e753cccab3aa
description:
Use purchase_uom instead of sale_uom

issue11200
review360841002
(grafted from aae404c4fd8c77882ac4173ace720615a8b6ba94)
diffstat:

 product.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r ff5fa986ac38 -r e753cccab3aa product.py
--- a/product.pyMon Nov 01 17:23:03 2021 +0100
+++ b/product.pyTue Feb 01 18:09:47 2022 +0100
@@ -25,7 +25,7 @@
 context_uom = UoM(context['uom'])
 if context.get('taxes'):
 taxes = Tax.browse(context.get('taxes'))
-uom = context_uom or self.sale_uom
+uom = context_uom or self.purchase_uom
 if uom.category != self.purchase_uom.category:
 uom = self.purchase_uom
 unit_price = price_list.compute(



[tryton-commits] changeset in modules/purchase_price_list:6.0 Use purchase_uom in...

2022-02-07 Thread Juanjo Garcia
changeset 1b46d1f65f5b in modules/purchase_price_list:6.0
details: 
https://hg.tryton.org/modules/purchase_price_list?cmd=changeset&node=1b46d1f65f5b
description:
Use purchase_uom instead of sale_uom

issue11200
review360841002
(grafted from aae404c4fd8c77882ac4173ace720615a8b6ba94)
diffstat:

 product.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 1fdf2d7e0510 -r 1b46d1f65f5b product.py
--- a/product.pyMon May 03 15:56:50 2021 +0200
+++ b/product.pyTue Feb 01 18:09:47 2022 +0100
@@ -25,7 +25,7 @@
 context_uom = UoM(context['uom'])
 if context.get('taxes'):
 taxes = Tax.browse(context.get('taxes'))
-uom = context_uom or self.sale_uom
+uom = context_uom or self.purchase_uom
 if uom.category != self.purchase_uom.category:
 uom = self.purchase_uom
 unit_price = price_list.compute(



[tryton-commits] changeset in modules/purchase_request_quotation:6.2 Split line d...

2022-02-07 Thread Adrià Tarroja Caubet
changeset cf29b1165b29 in modules/purchase_request_quotation:6.2
details: 
https://hg.tryton.org/modules/purchase_request_quotation?cmd=changeset&node=cf29b1165b29
description:
Split line description only if not None

issue11174
review397151006
(grafted from 8183563ea789ac1b01b965819feb16118bea22ec)
diffstat:

 quotation.fodt |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r a2aa1be46ee9 -r cf29b1165b29 quotation.fodt
--- a/quotation.fodtMon Nov 01 17:30:48 2021 +0100
+++ b/quotation.fodtTue Jan 25 10:01:02 2022 +0100
@@ -684,9 +684,11 @@
 
 
  
+  
   
   
   
+  
  
  
   



[tryton-commits] changeset in modules/purchase_request_quotation:6.0 Split line d...

2022-02-07 Thread Adrià Tarroja Caubet
changeset 51e7d0c28a45 in modules/purchase_request_quotation:6.0
details: 
https://hg.tryton.org/modules/purchase_request_quotation?cmd=changeset&node=51e7d0c28a45
description:
Split line description only if not None

issue11174
review397151006
(grafted from 8183563ea789ac1b01b965819feb16118bea22ec)
diffstat:

 quotation.fodt |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r 29e121493ee6 -r 51e7d0c28a45 quotation.fodt
--- a/quotation.fodtThu Sep 16 23:48:03 2021 +0200
+++ b/quotation.fodtTue Jan 25 10:01:02 2022 +0100
@@ -684,9 +684,11 @@
 
 
  
+  
   
   
   
+  
  
  
   <(format_number(quotation_line.quantity, 
quotation.supplier.lang, digits=quotation_line.unit_digits) + 
(quotation_line.unit and (' ' + quotation_line.unit.symbol) or 
'')) or ''>



[tryton-commits] changeset in modules/purchase_request_quotation:5.0 Split line d...

2022-02-07 Thread Adrià Tarroja Caubet
changeset c195d7b786aa in modules/purchase_request_quotation:5.0
details: 
https://hg.tryton.org/modules/purchase_request_quotation?cmd=changeset&node=c195d7b786aa
description:
Split line description only if not None

issue11174
review397151006
(grafted from 8183563ea789ac1b01b965819feb16118bea22ec)
diffstat:

 quotation.fodt |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r d687186309d0 -r c195d7b786aa quotation.fodt
--- a/quotation.fodtThu Jun 17 22:03:34 2021 +0200
+++ b/quotation.fodtTue Jan 25 10:01:02 2022 +0100
@@ -633,9 +633,11 @@
 
 
  
+  
   
   
   
+  
  
  
   <(format_number(quotation_line.quantity, 
quotation.supplier.lang, digits=quotation_line.unit_digits) + 
(quotation_line.unit and (' ' + quotation_line.unit.symbol) or 
'')) or ''>



[tryton-commits] changeset in modules/sale:6.2 Use select to True on create_date

2022-02-07 Thread Cédric Krier
changeset ba2aae64d521 in modules/sale:6.2
details: https://hg.tryton.org/modules/sale?cmd=changeset&node=ba2aae64d521
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from 4d2ae547c0a2512afea385dfeed074e524eb4c4b)
diffstat:

 sale.py |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r 56c3392669ae -r ba2aae64d521 sale.py
--- a/sale.py   Mon Nov 01 17:21:13 2021 +0100
+++ b/sale.py   Thu Feb 03 22:29:08 2022 +0100
@@ -271,6 +271,7 @@
 @classmethod
 def __setup__(cls):
 super(Sale, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('sale_date', 'DESC NULLS FIRST'),
 ('id', 'DESC'),
@@ -353,9 +354,6 @@
 # Migration from 4.0: Drop not null on payment_term
 table.not_null_action('payment_term', 'remove')
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],



[tryton-commits] changeset in modules/sale:6.0 Use select to True on create_date

2022-02-07 Thread Cédric Krier
changeset 84f0d27d92ae in modules/sale:6.0
details: https://hg.tryton.org/modules/sale?cmd=changeset&node=84f0d27d92ae
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from 4d2ae547c0a2512afea385dfeed074e524eb4c4b)
diffstat:

 sale.py |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r d7143945af14 -r 84f0d27d92ae sale.py
--- a/sale.py   Fri Nov 05 00:11:04 2021 +0100
+++ b/sale.py   Thu Feb 03 22:29:08 2022 +0100
@@ -282,6 +282,7 @@
 @classmethod
 def __setup__(cls):
 super(Sale, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('sale_date', 'DESC NULLS FIRST'),
 ('id', 'DESC'),
@@ -364,9 +365,6 @@
 # Migration from 4.0: Drop not null on payment_term
 table.not_null_action('payment_term', 'remove')
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],



[tryton-commits] changeset in modules/sale:5.0 Use select to True on create_date

2022-02-07 Thread Cédric Krier
changeset 6f2b8fb24202 in modules/sale:5.0
details: https://hg.tryton.org/modules/sale?cmd=changeset&node=6f2b8fb24202
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from 4d2ae547c0a2512afea385dfeed074e524eb4c4b)
diffstat:

 sale.py |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r ef2991edac90 -r 6f2b8fb24202 sale.py
--- a/sale.py   Fri Nov 05 00:11:40 2021 +0100
+++ b/sale.py   Thu Feb 03 22:29:08 2022 +0100
@@ -218,6 +218,7 @@
 @classmethod
 def __setup__(cls):
 super(Sale, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('sale_date', 'DESC'),
 ('id', 'DESC'),
@@ -306,8 +307,6 @@
 # Migration from 4.0: Drop not null on payment_term
 table.not_null_action('payment_term', 'remove')
 
-# Add index on create_date
-table.index_action('create_date', action='add')
 
 @classmethod
 def default_payment_term(cls):



[tryton-commits] changeset in modules/sale_product_customer:6.2 Do not read produ...

2022-02-07 Thread Sergi Almacellas Abellana
changeset 9a68a255a5bb in modules/sale_product_customer:6.2
details: 
https://hg.tryton.org/modules/sale_product_customer?cmd=changeset&node=9a68a255a5bb
description:
Do not read product customers's data when product is empty

issue11172
review381761002
(grafted from 922662632fbd17304288b526bba97e463fd73254)
diffstat:

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

diffs (12 lines):

diff -r 138373a82c5b -r 9a68a255a5bb sale.py
--- a/sale.py   Mon Nov 01 17:31:28 2021 +0100
+++ b/sale.py   Mon Jan 24 17:21:33 2022 +0100
@@ -95,7 +95,7 @@
 super().on_change_product()
 except AttributeError:
 pass
-if not self.product and not self.line:
+if not self.product or not self.line:
 return
 product_customers = list(self.product.product_customer_used(
 **self.line._get_product_customer_pattern()))



[tryton-commits] changeset in modules/sale_product_customer:6.0 Do not read produ...

2022-02-07 Thread Sergi Almacellas Abellana
changeset 336ead1918af in modules/sale_product_customer:6.0
details: 
https://hg.tryton.org/modules/sale_product_customer?cmd=changeset&node=336ead1918af
description:
Do not read product customers's data when product is empty

issue11172
review381761002
(grafted from 922662632fbd17304288b526bba97e463fd73254)
diffstat:

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

diffs (12 lines):

diff -r be2c4c3d4664 -r 336ead1918af sale.py
--- a/sale.py   Mon May 03 16:05:05 2021 +0200
+++ b/sale.py   Mon Jan 24 17:21:33 2022 +0100
@@ -95,7 +95,7 @@
 super().on_change_product()
 except AttributeError:
 pass
-if not self.product and not self.line:
+if not self.product or not self.line:
 return
 product_customers = list(self.product.product_customer_used(
 **self.line._get_product_customer_pattern()))



[tryton-commits] changeset in modules/sale_shipment_cost:6.2 Add shipment cost al...

2022-02-07 Thread Cédric Krier
changeset aabc24daa5fe in modules/sale_shipment_cost:6.2
details: 
https://hg.tryton.org/modules/sale_shipment_cost?cmd=changeset&node=aabc24daa5fe
description:
Add shipment cost also for kit

issue11178
review374791002
(grafted from 8693733aa9bd90ba353cc739098cdbd63c97e7fb)
diffstat:

 sale.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r d18beb1b150e -r aabc24daa5fe sale.py
--- a/sale.py   Mon Nov 01 17:31:55 2021 +0100
+++ b/sale.py   Thu Feb 03 22:23:02 2022 +0100
@@ -222,12 +222,12 @@
 pool = Pool()
 Date = pool.get('ir.date')
 Currency = pool.get('currency.currency')
-Move = pool.get('stock.move')
+Line = pool.get('sale.line')
 stockable = any(
 line.quantity >= 0 for line in self.lines
 if line.type == 'line'
 and line.product
-and line.product.type in Move.get_product_types())
+and line.product.type in Line.get_move_product_types())
 if self.carrier and stockable:
 with Transaction().set_context(self._get_carrier_context()):
 cost, currency_id = self.carrier.get_sale_price()



[tryton-commits] changeset in modules/sale_shipment_cost:6.0 Add shipment cost al...

2022-02-07 Thread Cédric Krier
changeset 1cbf19fb0f7d in modules/sale_shipment_cost:6.0
details: 
https://hg.tryton.org/modules/sale_shipment_cost?cmd=changeset&node=1cbf19fb0f7d
description:
Add shipment cost also for kit

issue11178
review374791002
(grafted from 8693733aa9bd90ba353cc739098cdbd63c97e7fb)
diffstat:

 sale.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r d3fc7358c2d5 -r 1cbf19fb0f7d sale.py
--- a/sale.py   Fri Oct 15 17:24:21 2021 +0200
+++ b/sale.py   Thu Feb 03 22:23:02 2022 +0100
@@ -212,12 +212,12 @@
 pool = Pool()
 Date = pool.get('ir.date')
 Currency = pool.get('currency.currency')
-Move = pool.get('stock.move')
+Line = pool.get('sale.line')
 stockable = any(
 line.quantity >= 0 for line in self.lines
 if line.type == 'line'
 and line.product
-and line.product.type in Move.get_product_types())
+and line.product.type in Line.get_move_product_types())
 if self.carrier and stockable:
 with Transaction().set_context(self._get_carrier_context()):
 cost, currency_id = self.carrier.get_sale_price()



[tryton-commits] changeset in modules/stock:6.0 Use select to True on create_date

2022-02-07 Thread Cédric Krier
changeset df0ab6c15d14 in modules/stock:6.0
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=df0ab6c15d14
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from c994fc728bf3ce1530eebf8fea14960960456d3c)
diffstat:

 inventory.py |   4 +---
 move.py  |   4 +---
 shipment.py  |  24 +---
 3 files changed, 7 insertions(+), 25 deletions(-)

diffs (139 lines):

diff -r 2aa46fa8284a -r df0ab6c15d14 inventory.py
--- a/inventory.py  Sat Jan 15 16:24:02 2022 +0100
+++ b/inventory.py  Thu Feb 03 22:29:08 2022 +0100
@@ -71,6 +71,7 @@
 @classmethod
 def __setup__(cls):
 super(Inventory, cls).__setup__()
+cls.create_date.select = True
 cls._order.insert(0, ('date', 'DESC'))
 cls._transitions |= set((
 ('draft', 'done'),
@@ -103,9 +104,6 @@
 table = cls.__table_handler__(module_name)
 sql_table = cls.__table__()
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 # Migration from 5.4: remove lost_found
 table.not_null_action('lost_found', 'remove')
 
diff -r 2aa46fa8284a -r df0ab6c15d14 move.py
--- a/move.py   Sat Jan 15 16:24:02 2022 +0100
+++ b/move.py   Thu Feb 03 22:29:08 2022 +0100
@@ -299,6 +299,7 @@
 @classmethod
 def __setup__(cls):
 super(Move, cls).__setup__()
+cls.create_date.select = True
 cls.product.domain = [
 If(Bool(Eval('product_uom_category'))
 & ~Eval('state').in_(['done', 'cancelled']),
@@ -367,9 +368,6 @@
 super(Move, cls).__register__(module_name)
 table = cls.__table_handler__(module_name)
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 # Index for period join in compute_quantities_query
 table.index_action([
 Coalesce(sql_table.effective_date,
diff -r 2aa46fa8284a -r df0ab6c15d14 shipment.py
--- a/shipment.py   Sat Jan 15 16:24:02 2022 +0100
+++ b/shipment.py   Thu Feb 03 22:29:08 2022 +0100
@@ -247,6 +247,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentIn, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('id', 'DESC'),
 ]
@@ -288,10 +289,6 @@
 
 super(ShipmentIn, cls).__register__(module_name)
 
-# Add index on create_date
-table = cls.__table_handler__(module_name)
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],
@@ -659,6 +656,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentInReturn, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('effective_date', 'ASC NULLS LAST'),
 ('id', 'ASC'),
@@ -718,10 +716,6 @@
 
 super(ShipmentInReturn, cls).__register__(module_name)
 
-# Add index on create_date
-table = cls.__table_handler__(module_name)
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],
@@ -1047,6 +1041,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentOut, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('effective_date', 'ASC NULLS LAST'),
 ('id', 'ASC'),
@@ -1137,9 +1132,6 @@
 
 super(ShipmentOut, cls).__register__(module_name)
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],
@@ -1694,6 +1686,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentOutReturn, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('effective_date', 'ASC NULLS LAST'),
 ('id', 'ASC'),
@@ -1737,10 +1730,6 @@
 
 super(ShipmentOutReturn, cls).__register__(module_name)
 
-# Add index on create_date
-table = cls.__table_handler__(module_name)
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],
@@ -2168,6 +2157,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentInternal, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('effective_date', 'ASC NULLS LAST'),
 ('id', '

[tryton-commits] changeset in modules/stock:6.2 Use select to True on create_date

2022-02-07 Thread Cédric Krier
changeset ed7fc174f8bf in modules/stock:6.2
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=ed7fc174f8bf
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from c994fc728bf3ce1530eebf8fea14960960456d3c)
diffstat:

 inventory.py |   4 +---
 move.py  |   4 +---
 shipment.py  |  24 +---
 3 files changed, 7 insertions(+), 25 deletions(-)

diffs (139 lines):

diff -r 2e48f4cfc86a -r ed7fc174f8bf inventory.py
--- a/inventory.py  Sat Jan 15 16:23:41 2022 +0100
+++ b/inventory.py  Thu Feb 03 22:29:08 2022 +0100
@@ -72,6 +72,7 @@
 @classmethod
 def __setup__(cls):
 super(Inventory, cls).__setup__()
+cls.create_date.select = True
 cls._order.insert(0, ('date', 'DESC'))
 cls._transitions |= set((
 ('draft', 'done'),
@@ -104,9 +105,6 @@
 table = cls.__table_handler__(module_name)
 sql_table = cls.__table__()
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 # Migration from 5.4: remove lost_found
 table.not_null_action('lost_found', 'remove')
 
diff -r 2e48f4cfc86a -r ed7fc174f8bf move.py
--- a/move.py   Sat Jan 15 16:23:41 2022 +0100
+++ b/move.py   Thu Feb 03 22:29:08 2022 +0100
@@ -297,6 +297,7 @@
 @classmethod
 def __setup__(cls):
 super(Move, cls).__setup__()
+cls.create_date.select = True
 cls.product.domain = [
 If(Bool(Eval('product_uom_category'))
 & ~Eval('state').in_(['done', 'cancelled']),
@@ -365,9 +366,6 @@
 super(Move, cls).__register__(module_name)
 table = cls.__table_handler__(module_name)
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 # Index for period join in compute_quantities_query
 table.index_action([
 Coalesce(sql_table.effective_date,
diff -r 2e48f4cfc86a -r ed7fc174f8bf shipment.py
--- a/shipment.py   Sat Jan 15 16:23:41 2022 +0100
+++ b/shipment.py   Thu Feb 03 22:29:08 2022 +0100
@@ -249,6 +249,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentIn, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('id', 'DESC'),
 ]
@@ -290,10 +291,6 @@
 
 super(ShipmentIn, cls).__register__(module_name)
 
-# Add index on create_date
-table = cls.__table_handler__(module_name)
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],
@@ -661,6 +658,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentInReturn, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('effective_date', 'ASC NULLS LAST'),
 ('id', 'ASC'),
@@ -720,10 +718,6 @@
 
 super(ShipmentInReturn, cls).__register__(module_name)
 
-# Add index on create_date
-table = cls.__table_handler__(module_name)
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],
@@ -1049,6 +1043,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentOut, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('effective_date', 'ASC NULLS LAST'),
 ('id', 'ASC'),
@@ -1139,9 +1134,6 @@
 
 super(ShipmentOut, cls).__register__(module_name)
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],
@@ -1702,6 +1694,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentOutReturn, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('effective_date', 'ASC NULLS LAST'),
 ('id', 'ASC'),
@@ -1745,10 +1738,6 @@
 
 super(ShipmentOutReturn, cls).__register__(module_name)
 
-# Add index on create_date
-table = cls.__table_handler__(module_name)
-table.index_action('create_date', action='add')
-
 # Migration from 5.6: rename state cancel to cancelled
 cursor.execute(*sql_table.update(
 [sql_table.state], ['cancelled'],
@@ -2176,6 +2165,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentInternal, cls).__setup__()
+cls.create_date.select = True
 cls._order = [
 ('effective_date', 'ASC NULLS LAST'),
 ('id', '

[tryton-commits] changeset in modules/stock:5.0 Use select to True on create_date

2022-02-07 Thread Cédric Krier
changeset c03bd9be5710 in modules/stock:5.0
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=c03bd9be5710
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from c994fc728bf3ce1530eebf8fea14960960456d3c)
diffstat:

 inventory.py |   4 +---
 move.py  |   4 +---
 shipment.py  |  24 +---
 3 files changed, 7 insertions(+), 25 deletions(-)

diffs (139 lines):

diff -r baca75c8e8f4 -r c03bd9be5710 inventory.py
--- a/inventory.py  Sat Jan 01 18:11:38 2022 +0100
+++ b/inventory.py  Thu Feb 03 22:29:08 2022 +0100
@@ -64,6 +64,7 @@
 @classmethod
 def __setup__(cls):
 super(Inventory, cls).__setup__()
+cls.create_date.select = True
 cls._order.insert(0, ('date', 'DESC'))
 cls._error_messages.update({
 'delete_cancel': ('Inventory "%s" must be canceled before '
@@ -100,9 +101,6 @@
 
 table = cls.__table_handler__(module_name)
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 @staticmethod
 def default_state():
 return 'draft'
diff -r baca75c8e8f4 -r c03bd9be5710 move.py
--- a/move.py   Sat Jan 01 18:11:38 2022 +0100
+++ b/move.py   Thu Feb 03 22:29:08 2022 +0100
@@ -246,6 +246,7 @@
 @classmethod
 def __setup__(cls):
 super(Move, cls).__setup__()
+cls.create_date.select = True
 cls._deny_modify_assigned = set(['product', 'uom', 'quantity',
 'from_location', 'to_location', 'company', 'currency'])
 cls._deny_modify_done_cancel = (cls._deny_modify_assigned |
@@ -321,9 +322,6 @@
 super(Move, cls).__register__(module_name)
 table = cls.__table_handler__(module_name)
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 # Index for period join in compute_quantities_query
 table.index_action([
 Coalesce(sql_table.effective_date,
diff -r baca75c8e8f4 -r c03bd9be5710 shipment.py
--- a/shipment.py   Sat Jan 01 18:11:38 2022 +0100
+++ b/shipment.py   Thu Feb 03 22:29:08 2022 +0100
@@ -171,6 +171,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentIn, cls).__setup__()
+cls.create_date.select = True
 cls._order[0] = ('id', 'DESC')
 cls._error_messages.update({
 'incoming_move_input_dest': ('Incoming Moves must have '
@@ -216,10 +217,6 @@
 
 super(ShipmentIn, cls).__register__(module_name)
 
-# Add index on create_date
-table = cls.__table_handler__(module_name)
-table.index_action('create_date', action='add')
-
 @staticmethod
 def default_planned_date():
 return Pool().get('ir.date').today()
@@ -554,6 +551,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentInReturn, cls).__setup__()
+cls.create_date.select = True
 cls._order[0] = ('id', 'DESC')
 cls._error_messages.update({
 'delete_cancel': ('Supplier Return Shipment "%s" must be '
@@ -612,10 +610,6 @@
 
 super(ShipmentInReturn, cls).__register__(module_name)
 
-# Add index on create_date
-table = cls.__table_handler__(module_name)
-table.index_action('create_date', action='add')
-
 @staticmethod
 def default_state():
 return 'draft'
@@ -889,6 +883,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentOut, cls).__setup__()
+cls.create_date.select = True
 cls._order[0] = ('id', 'DESC')
 cls._error_messages.update({
 'delete_cancel': ('Customer Shipment "%s" must be cancelled '
@@ -963,9 +958,6 @@
 
 super(ShipmentOut, cls).__register__(module_name)
 
-# Add index on create_date
-table.index_action('create_date', action='add')
-
 @staticmethod
 def default_state():
 return 'draft'
@@ -1451,6 +1443,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentOutReturn, cls).__setup__()
+cls.create_date.select = True
 cls._order[0] = ('id', 'DESC')
 cls._error_messages.update({
 'delete_cancel': ('Customer Return Shipment "%s" must be '
@@ -1493,10 +1486,6 @@
 
 super(ShipmentOutReturn, cls).__register__(module_name)
 
-# Add index on create_date
-table = cls.__table_handler__(module_name)
-table.index_action('create_date', action='add')
-
 @staticmethod
 def default_state():
 return 'draft'
@@ -1934,6 +1923,7 @@
 @classmethod
 def __setup__(cls):
 super(ShipmentInternal, cls).__setup__()
+cls.create_date.select = True
 cls._order[0] = ('id', 'DESC')
 cls._error_messages.update({
 'delete_cancel': ('Internal Shipment "%s" must be cance

[tryton-commits] changeset in modules/stock_forecast:6.2 Use select to True on cr...

2022-02-07 Thread Cédric Krier
changeset 2d7a46c86f20 in modules/stock_forecast:6.2
details: 
https://hg.tryton.org/modules/stock_forecast?cmd=changeset&node=2d7a46c86f20
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from bd11248e930f87db01bb070b6f0dd4ef28c407e8)
diffstat:

 forecast.py |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 9ccee85f0720 -r 2d7a46c86f20 forecast.py
--- a/forecast.py   Mon Nov 01 17:11:37 2021 +0100
+++ b/forecast.py   Thu Feb 03 22:29:08 2022 +0100
@@ -71,6 +71,7 @@
 @classmethod
 def __setup__(cls):
 super(Forecast, cls).__setup__()
+cls.create_date.select = True
 cls._order.insert(0, ('from_date', 'DESC'))
 cls._order.insert(1, ('warehouse', 'ASC'))
 cls._transitions |= set((
@@ -106,9 +107,7 @@
 
 super(Forecast, cls).__register__(module_name)
 
-# Add index on create_date
 table = cls.__table_handler__(module_name)
-table.index_action('create_date', action='add')
 
 # Migration from 5.0: remove check_from_to_date
 table.drop_constraint('check_from_to_date')



[tryton-commits] changeset in modules/stock_forecast:6.0 Use select to True on cr...

2022-02-07 Thread Cédric Krier
changeset c59d826f92f0 in modules/stock_forecast:6.0
details: 
https://hg.tryton.org/modules/stock_forecast?cmd=changeset&node=c59d826f92f0
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from bd11248e930f87db01bb070b6f0dd4ef28c407e8)
diffstat:

 forecast.py |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r fb24fdf552af -r c59d826f92f0 forecast.py
--- a/forecast.py   Mon May 03 15:45:17 2021 +0200
+++ b/forecast.py   Thu Feb 03 22:29:08 2022 +0100
@@ -71,6 +71,7 @@
 @classmethod
 def __setup__(cls):
 super(Forecast, cls).__setup__()
+cls.create_date.select = True
 cls._order.insert(0, ('from_date', 'DESC'))
 cls._order.insert(1, ('warehouse', 'ASC'))
 cls._transitions |= set((
@@ -106,9 +107,7 @@
 
 super(Forecast, cls).__register__(module_name)
 
-# Add index on create_date
 table = cls.__table_handler__(module_name)
-table.index_action('create_date', action='add')
 
 # Migration from 5.0: remove check_from_to_date
 table.drop_constraint('check_from_to_date')



[tryton-commits] changeset in modules/stock_forecast:5.0 Use select to True on cr...

2022-02-07 Thread Cédric Krier
changeset 710f24c7e676 in modules/stock_forecast:5.0
details: 
https://hg.tryton.org/modules/stock_forecast?cmd=changeset&node=710f24c7e676
description:
Use select to True on create_date

If the index is created only in __register__ then it is dropped before 
being
created again.

issue11197
review389881002
(grafted from bd11248e930f87db01bb070b6f0dd4ef28c407e8)
diffstat:

 forecast.py |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r ce4785a65eb0 -r 710f24c7e676 forecast.py
--- a/forecast.py   Thu Jun 17 22:09:19 2021 +0200
+++ b/forecast.py   Thu Feb 03 22:29:08 2022 +0100
@@ -65,6 +65,7 @@
 @classmethod
 def __setup__(cls):
 super(Forecast, cls).__setup__()
+cls.create_date.select = True
 t = cls.__table__()
 cls._sql_constraints += [
 ('check_from_to_date', Check(t, t.to_date >= t.from_date),
@@ -108,9 +109,7 @@
 def __register__(cls, module_name):
 super(Forecast, cls).__register__(module_name)
 
-# Add index on create_date
 table = cls.__table_handler__(module_name)
-table.index_action('create_date', action='add')
 
 @staticmethod
 def default_state():



[tryton-commits] changeset in modules/stock_package_shipping_sendcloud:6.2 Add pr...

2022-02-07 Thread Cédric Krier
changeset a387774c46d5 in modules/stock_package_shipping_sendcloud:6.2
details: 
https://hg.tryton.org/modules/stock_package_shipping_sendcloud?cmd=changeset&node=a387774c46d5
description:
Add printer suffix after testing if it is an index

issue11177
review366611002
(grafted from 2f2acdd5cce156129e8d2752b7459f36fa67c9e5)
diffstat:

 stock.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r f366e11f5e64 -r a387774c46d5 stock.py
--- a/stock.py  Mon Nov 01 17:39:00 2021 +0100
+++ b/stock.py  Sun Jan 30 13:13:12 2022 +0100
@@ -118,10 +118,10 @@
 format_ = shipment.carrier.sendcloud_format.split()
 label_url = parcel['label']
 for key in format_:
-key += '_printer'
 try:
 index = int(key)
 except ValueError:
+key += '_printer'
 label_url = label_url[key]
 else:
 label_url = label_url[index]



[tryton-commits] changeset in sao:6.0 Propagate changed status to parent on insta...

2022-02-07 Thread Nicolas Évrard
changeset 903aa15f4295 in sao:6.0
details: https://hg.tryton.org/sao?cmd=changeset&node=903aa15f4295
description:
Propagate changed status to parent on instance button activation

issue11145
review389711002
(grafted from a5bef51d82770d58474ef858eaf83ef263b47b72)
diffstat:

 src/screen.js |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r b32d70c3b117 -r 903aa15f4295 src/screen.js
--- a/src/screen.js Tue Feb 01 18:17:23 2022 +0100
+++ b/src/screen.js Thu Feb 03 16:03:18 2022 +0100
@@ -1976,6 +1976,7 @@
 return record.model.execute(attributes.name, [values],
 this.context).then(function(changes) {
 record.set_on_change(changes);
+record.group.changed();
 record.group.root_group.screens.forEach(
 function(screen) {
 screen.display();



[tryton-commits] changeset in sao:5.0 Propagate changed status to parent on insta...

2022-02-07 Thread Nicolas Évrard
changeset 28e326b81486 in sao:5.0
details: https://hg.tryton.org/sao?cmd=changeset&node=28e326b81486
description:
Propagate changed status to parent on instance button activation

issue11145
review389711002
(grafted from a5bef51d82770d58474ef858eaf83ef263b47b72)
diffstat:

 src/screen.js |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r 061509341eb4 -r 28e326b81486 src/screen.js
--- a/src/screen.js Sat Jan 15 16:10:33 2022 +0100
+++ b/src/screen.js Thu Feb 03 16:03:18 2022 +0100
@@ -1763,6 +1763,7 @@
 return record.model.execute(attributes.name, [values],
 this.context()).then(function(changes) {
 record.set_on_change(changes).then(function() {
+record.group.changed();
 record.group.root_group.screens.forEach(
 function(screen) {
 screen.display();



[tryton-commits] changeset in sao:6.2 Set button type to link buttons

2022-02-07 Thread Cédric Krier
changeset 3b915b706085 in sao:6.2
details: https://hg.tryton.org/sao?cmd=changeset&node=3b915b706085
description:
Set button type to link buttons

Otherwise they are triggered by the form of the dialog when using 
+Enter.

issue11193
review380271002
(grafted from 3aed6c2db5e3276977aa8a0d4178d9adce54306d)
diffstat:

 src/view/form.js |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r a5bef51d8277 -r 3b915b706085 src/view/form.js
--- a/src/view/form.js  Thu Feb 03 16:03:18 2022 +0100
+++ b/src/view/form.js  Thu Feb 03 22:27:19 2022 +0100
@@ -955,6 +955,7 @@
 this.el = jQuery('', {
 'class': this.class_ + ' btn btn-link',
 'name': attributes.name,
+'type': 'button',
 });
 if (attributes.icon) {
 var img = jQuery('', {



[tryton-commits] changeset in sao:6.0 Set button type to link buttons

2022-02-07 Thread Cédric Krier
changeset 5854fb8190cb in sao:6.0
details: https://hg.tryton.org/sao?cmd=changeset&node=5854fb8190cb
description:
Set button type to link buttons

Otherwise they are triggered by the form of the dialog when using 
+Enter.

issue11193
review380271002
(grafted from 3aed6c2db5e3276977aa8a0d4178d9adce54306d)
diffstat:

 src/view/form.js |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r 903aa15f4295 -r 5854fb8190cb src/view/form.js
--- a/src/view/form.js  Thu Feb 03 16:03:18 2022 +0100
+++ b/src/view/form.js  Thu Feb 03 22:27:19 2022 +0100
@@ -910,6 +910,7 @@
 this.el = jQuery('', {
 'class': this.class_ + ' btn btn-link',
 'name': attributes.name,
+'type': 'button',
 });
 if (attributes.icon) {
 var img = jQuery('', {



[tryton-commits] changeset in tryton:6.2 Delete selection when replacing keypad keys

2022-02-07 Thread Cédric Krier
changeset 77e8bde155b1 in tryton:6.2
details: https://hg.tryton.org/tryton?cmd=changeset&node=77e8bde155b1
description:
Delete selection when replacing keypad keys

issue2
review377911002
(grafted from f337cd27fb442d14d1a12928f27982fa6466739b)
diffstat:

 tryton/common/cellrendererfloat.py |  18 --
 tryton/common/number_entry.py  |   2 ++
 2 files changed, 14 insertions(+), 6 deletions(-)

diffs (46 lines):

diff -r 123adfc4f979 -r 77e8bde155b1 tryton/common/cellrendererfloat.py
--- a/tryton/common/cellrendererfloat.pyTue Feb 01 18:15:50 2022 +0100
+++ b/tryton/common/cellrendererfloat.pyTue Jan 11 23:05:35 2022 +0100
@@ -29,18 +29,24 @@
 for name in ('KP_Decimal', 'KP_Separator'):
 if event.keyval == Gdk.keyval_from_name(name):
 text = self.__decimal_point
-position = widget.props.cursor_position
-if self._can_insert_text(widget, text, position):
+try:
+start_pos, end_pos = widget.get_selection_bounds()
+except ValueError:
+start_pos = widget.props.cursor_position
+end_pos = None
+if self._can_insert_text(widget, text, start_pos, end_pos):
 buffer_ = widget.get_buffer()
-buffer_.insert_text(position, text, len(text))
+buffer_.delete_text(start_pos, end_pos - start_pos)
+buffer_.insert_text(start_pos, text, len(text))
 widget.set_position(
 widget.props.cursor_position + len(text))
 return True
 
-def _can_insert_text(self, entry, new_text, position):
+def _can_insert_text(self, entry, new_text, start_pos, end_pos=None):
 value = entry.get_text()
-position = entry.get_position()
-new_value = value[:position] + new_text + value[position:]
+if end_pos is None:
+end_pos = start_pos
+new_value = value[:start_pos] + new_text + value[end_pos:]
 if new_value not in {'-', self.__decimal_point, self.__thousands_sep}:
 try:
 value = locale.atof(new_value)
diff -r 123adfc4f979 -r 77e8bde155b1 tryton/common/number_entry.py
--- a/tryton/common/number_entry.py Tue Feb 01 18:15:50 2022 +0100
+++ b/tryton/common/number_entry.py Tue Jan 11 23:05:35 2022 +0100
@@ -73,6 +73,8 @@
 for name in ['KP_Decimal', 'KP_Separator']:
 if event.keyval == Gdk.keyval_from_name(name):
 text = self.__decimal_point
+if self.get_selection_bounds():
+self.delete_text(*self.get_selection_bounds())
 self.do_insert_text(
 text, len(text), self.props.cursor_position)
 self.set_position(self.props.cursor_position + len(text))



[tryton-commits] changeset in tryton:6.2 Use position from get_position

2022-02-07 Thread Cédric Krier
changeset 866d82d87a4c in tryton:6.2
details: https://hg.tryton.org/tryton?cmd=changeset&node=866d82d87a4c
description:
Use position from get_position

The position received by insert-text callback is always 0.

issue11163
review384171002
(grafted from d2e7bfbe73385dd9ed774dea433a5ced053a397d)
diffstat:

 tryton/common/cellrendererfloat.py   |  5 ++---
 tryton/common/cellrendererinteger.py |  2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 77e8bde155b1 -r 866d82d87a4c tryton/common/cellrendererfloat.py
--- a/tryton/common/cellrendererfloat.pyTue Jan 11 23:05:35 2022 +0100
+++ b/tryton/common/cellrendererfloat.pySat Jan 22 21:16:11 2022 +0100
@@ -32,14 +32,13 @@
 try:
 start_pos, end_pos = widget.get_selection_bounds()
 except ValueError:
-start_pos = widget.props.cursor_position
+start_pos = widget.get_position()
 end_pos = None
 if self._can_insert_text(widget, text, start_pos, end_pos):
 buffer_ = widget.get_buffer()
 buffer_.delete_text(start_pos, end_pos - start_pos)
 buffer_.insert_text(start_pos, text, len(text))
-widget.set_position(
-widget.props.cursor_position + len(text))
+widget.set_position(widget.get_position() + len(text))
 return True
 
 def _can_insert_text(self, entry, new_text, start_pos, end_pos=None):
diff -r 77e8bde155b1 -r 866d82d87a4c tryton/common/cellrendererinteger.py
--- a/tryton/common/cellrendererinteger.py  Tue Jan 11 23:05:35 2022 +0100
+++ b/tryton/common/cellrendererinteger.py  Sat Jan 22 21:16:11 2022 +0100
@@ -16,7 +16,6 @@
 
 def _can_insert_text(self, entry, new_text, position):
 value = entry.get_text()
-position = entry.get_position()
 new_value = value[:position] + new_text + value[position:]
 if new_value != '-':
 try:
@@ -26,6 +25,7 @@
 return True
 
 def sig_insert_text(self, entry, new_text, new_text_length, position):
+position = entry.get_position()
 if not self._can_insert_text(entry, new_text, position):
 entry.stop_emission_by_name('insert-text')
 



[tryton-commits] changeset in tryton:6.0 Delete selection when replacing keypad keys

2022-02-07 Thread Cédric Krier
changeset 320042a07dba in tryton:6.0
details: https://hg.tryton.org/tryton?cmd=changeset&node=320042a07dba
description:
Delete selection when replacing keypad keys

issue2
review377911002
(grafted from f337cd27fb442d14d1a12928f27982fa6466739b)
diffstat:

 tryton/common/cellrendererfloat.py |  18 --
 tryton/common/number_entry.py  |   2 ++
 2 files changed, 14 insertions(+), 6 deletions(-)

diffs (46 lines):

diff -r 28425a93c811 -r 320042a07dba tryton/common/cellrendererfloat.py
--- a/tryton/common/cellrendererfloat.pyTue Feb 01 18:16:12 2022 +0100
+++ b/tryton/common/cellrendererfloat.pyTue Jan 11 23:05:35 2022 +0100
@@ -29,18 +29,24 @@
 for name in ('KP_Decimal', 'KP_Separator'):
 if event.keyval == Gdk.keyval_from_name(name):
 text = self.__decimal_point
-position = widget.props.cursor_position
-if self._can_insert_text(widget, text, position):
+try:
+start_pos, end_pos = widget.get_selection_bounds()
+except ValueError:
+start_pos = widget.props.cursor_position
+end_pos = None
+if self._can_insert_text(widget, text, start_pos, end_pos):
 buffer_ = widget.get_buffer()
-buffer_.insert_text(position, text, len(text))
+buffer_.delete_text(start_pos, end_pos - start_pos)
+buffer_.insert_text(start_pos, text, len(text))
 widget.set_position(
 widget.props.cursor_position + len(text))
 return True
 
-def _can_insert_text(self, entry, new_text, position):
+def _can_insert_text(self, entry, new_text, start_pos, end_pos=None):
 value = entry.get_text()
-position = entry.get_position()
-new_value = value[:position] + new_text + value[position:]
+if end_pos is None:
+end_pos = start_pos
+new_value = value[:start_pos] + new_text + value[end_pos:]
 if new_value not in {'-', self.__decimal_point, self.__thousands_sep}:
 try:
 value = locale.atof(new_value)
diff -r 28425a93c811 -r 320042a07dba tryton/common/number_entry.py
--- a/tryton/common/number_entry.py Tue Feb 01 18:16:12 2022 +0100
+++ b/tryton/common/number_entry.py Tue Jan 11 23:05:35 2022 +0100
@@ -65,6 +65,8 @@
 for name in ['KP_Decimal', 'KP_Separator']:
 if event.keyval == Gdk.keyval_from_name(name):
 text = self.__decimal_point
+if self.get_selection_bounds():
+self.delete_text(*self.get_selection_bounds())
 self.do_insert_text(
 text, len(text), self.props.cursor_position)
 self.set_position(self.props.cursor_position + len(text))



[tryton-commits] changeset in tryton:6.0 Use position from get_position

2022-02-07 Thread Cédric Krier
changeset c5b72f374a82 in tryton:6.0
details: https://hg.tryton.org/tryton?cmd=changeset&node=c5b72f374a82
description:
Use position from get_position

The position received by insert-text callback is always 0.

issue11163
review384171002
(grafted from d2e7bfbe73385dd9ed774dea433a5ced053a397d)
diffstat:

 tryton/common/cellrendererfloat.py   |  5 ++---
 tryton/common/cellrendererinteger.py |  2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 320042a07dba -r c5b72f374a82 tryton/common/cellrendererfloat.py
--- a/tryton/common/cellrendererfloat.pyTue Jan 11 23:05:35 2022 +0100
+++ b/tryton/common/cellrendererfloat.pySat Jan 22 21:16:11 2022 +0100
@@ -32,14 +32,13 @@
 try:
 start_pos, end_pos = widget.get_selection_bounds()
 except ValueError:
-start_pos = widget.props.cursor_position
+start_pos = widget.get_position()
 end_pos = None
 if self._can_insert_text(widget, text, start_pos, end_pos):
 buffer_ = widget.get_buffer()
 buffer_.delete_text(start_pos, end_pos - start_pos)
 buffer_.insert_text(start_pos, text, len(text))
-widget.set_position(
-widget.props.cursor_position + len(text))
+widget.set_position(widget.get_position() + len(text))
 return True
 
 def _can_insert_text(self, entry, new_text, start_pos, end_pos=None):
diff -r 320042a07dba -r c5b72f374a82 tryton/common/cellrendererinteger.py
--- a/tryton/common/cellrendererinteger.py  Tue Jan 11 23:05:35 2022 +0100
+++ b/tryton/common/cellrendererinteger.py  Sat Jan 22 21:16:11 2022 +0100
@@ -16,7 +16,6 @@
 
 def _can_insert_text(self, entry, new_text, position):
 value = entry.get_text()
-position = entry.get_position()
 new_value = value[:position] + new_text + value[position:]
 if new_value != '-':
 try:
@@ -26,6 +25,7 @@
 return True
 
 def sig_insert_text(self, entry, new_text, new_text_length, position):
+position = entry.get_position()
 if not self._can_insert_text(entry, new_text, position):
 entry.stop_emission_by_name('insert-text')
 



[tryton-commits] changeset in tryton:6.2 Set encoding to version subprocess for f...

2022-02-07 Thread Cédric Krier
changeset 66cd792c8785 in tryton:6.2
details: https://hg.tryton.org/tryton?cmd=changeset&node=66cd792c8785
description:
Set encoding to version subprocess for freezing

issue11207
review376661002
(grafted from cf4a8197a4938a2e4fb884902cf06c0568c486ef)
diffstat:

 setup-freeze.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r 866d82d87a4c -r 66cd792c8785 setup-freeze.py
--- a/setup-freeze.py   Sat Jan 22 21:16:11 2022 +0100
+++ b/setup-freeze.py   Thu Feb 03 22:30:14 2022 +0100
@@ -118,7 +118,8 @@
 (ssl_paths.openssl_capath, os.path.join('etc', 'ssl', 'certs')))
 
 version = Popen(
-'python setup.py --version', stdout=PIPE, shell=True).stdout.read()
+'python setup.py --version', stdout=PIPE, shell=True, encoding='utf-8'
+).stdout.read()
 version = version.strip()
 
 setup(name='tryton',



[tryton-commits] changeset in tryton:5.0 Set encoding to version subprocess for f...

2022-02-07 Thread Cédric Krier
changeset c7336d357d68 in tryton:5.0
details: https://hg.tryton.org/tryton?cmd=changeset&node=c7336d357d68
description:
Set encoding to version subprocess for freezing

issue11207
review376661002
(grafted from cf4a8197a4938a2e4fb884902cf06c0568c486ef)
diffstat:

 setup-freeze.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r cd7d79f1f0c0 -r c7336d357d68 setup-freeze.py
--- a/setup-freeze.py   Sat Jan 15 16:03:25 2022 +0100
+++ b/setup-freeze.py   Thu Feb 03 22:30:14 2022 +0100
@@ -114,7 +114,8 @@
 (ssl_paths.openssl_capath, os.path.join('etc', 'ssl', 'certs')))
 
 version = Popen(
-'python setup.py --version', stdout=PIPE, shell=True).stdout.read()
+'python setup.py --version', stdout=PIPE, shell=True, encoding='utf-8'
+).stdout.read()
 version = version.strip()
 
 setup(name='tryton',



[tryton-commits] changeset in trytond:6.2 Always convert report when output forma...

2022-02-07 Thread Cédric Krier
changeset e64334161692 in trytond:6.2
details: https://hg.tryton.org/trytond?cmd=changeset&node=e64334161692
description:
Always convert report when output format is different from input

issue11183
review387811002
(grafted from 2bbc59e018bc055448f8aad503e72598cd2fa105)
diffstat:

 trytond/report/report.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 49c661bc3aa1 -r e64334161692 trytond/report/report.py
--- a/trytond/report/report.py  Tue Feb 01 18:14:26 2022 +0100
+++ b/trytond/report/report.py  Thu Feb 03 22:24:34 2022 +0100
@@ -356,7 +356,7 @@
 and output_format == 'pdf'):
 return output_format, weasyprint.HTML(string=data).write_pdf()
 
-if output_format in MIMETYPES:
+if input_format == output_format and output_format in MIMETYPES:
 return output_format, data
 
 dtemp = tempfile.mkdtemp(prefix='trytond_')



[tryton-commits] changeset in trytond:6.0 Always convert report when output forma...

2022-02-07 Thread Cédric Krier
changeset fa20ba963d98 in trytond:6.0
details: https://hg.tryton.org/trytond?cmd=changeset&node=fa20ba963d98
description:
Always convert report when output format is different from input

issue11183
review387811002
(grafted from 2bbc59e018bc055448f8aad503e72598cd2fa105)
diffstat:

 trytond/report/report.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r fed30b3c3446 -r fa20ba963d98 trytond/report/report.py
--- a/trytond/report/report.py  Tue Feb 01 18:14:53 2022 +0100
+++ b/trytond/report/report.py  Thu Feb 03 22:24:34 2022 +0100
@@ -342,7 +342,7 @@
 and output_format == 'pdf'):
 return output_format, weasyprint.HTML(string=data).write_pdf()
 
-if output_format in MIMETYPES:
+if input_format == output_format and output_format in MIMETYPES:
 return output_format, data
 
 dtemp = tempfile.mkdtemp(prefix='trytond_')



[tryton-commits] changeset in tryton:6.0 Set encoding to version subprocess for f...

2022-02-07 Thread Cédric Krier
changeset 0909cbead6a5 in tryton:6.0
details: https://hg.tryton.org/tryton?cmd=changeset&node=0909cbead6a5
description:
Set encoding to version subprocess for freezing

issue11207
review376661002
(grafted from cf4a8197a4938a2e4fb884902cf06c0568c486ef)
diffstat:

 setup-freeze.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r c5b72f374a82 -r 0909cbead6a5 setup-freeze.py
--- a/setup-freeze.py   Sat Jan 22 21:16:11 2022 +0100
+++ b/setup-freeze.py   Thu Feb 03 22:30:14 2022 +0100
@@ -118,7 +118,8 @@
 (ssl_paths.openssl_capath, os.path.join('etc', 'ssl', 'certs')))
 
 version = Popen(
-'python setup.py --version', stdout=PIPE, shell=True).stdout.read()
+'python setup.py --version', stdout=PIPE, shell=True, encoding='utf-8'
+).stdout.read()
 version = version.strip()
 
 setup(name='tryton',



[tryton-commits] changeset in trytond:5.0 Always convert report when output forma...

2022-02-07 Thread Cédric Krier
changeset 336237c3c19a in trytond:5.0
details: https://hg.tryton.org/trytond?cmd=changeset&node=336237c3c19a
description:
Always convert report when output format is different from input

issue11183
review387811002
(grafted from 2bbc59e018bc055448f8aad503e72598cd2fa105)
diffstat:

 trytond/report/report.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r a0fb986aad89 -r 336237c3c19a trytond/report/report.py
--- a/trytond/report/report.py  Tue Feb 01 18:15:20 2022 +0100
+++ b/trytond/report/report.py  Thu Feb 03 22:24:34 2022 +0100
@@ -300,7 +300,7 @@
 input_format = report.template_extension
 output_format = report.extension or report.template_extension
 
-if output_format in MIMETYPES:
+if input_format == output_format and output_format in MIMETYPES:
 return output_format, data
 
 dtemp = tempfile.mkdtemp(prefix='trytond_')



[tryton-commits] changeset in weblate:default Translated using Weblate (Dutch)

2022-02-07 Thread EdbO
changeset 9e19e9092054 in weblate:default
details: https://hg.tryton.org/weblate?cmd=changeset&node=9e19e9092054
description:
Translated using Weblate (Dutch)

Currently translated at 100.0% (267 of 267 strings)

Translation: Tryton/purchase
Translate-URL: https://translate.tryton.org/projects/tryton/purchase/nl/
diffstat:

 modules/purchase/locale/nl.po |  10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (44 lines):

diff -r b0c2f3e98b28 -r 9e19e9092054 modules/purchase/locale/nl.po
--- a/modules/purchase/locale/nl.po Mon Feb 07 19:47:10 2022 +
+++ b/modules/purchase/locale/nl.po Mon Feb 07 22:18:02 2022 +
@@ -1,7 +1,7 @@
 #
 msgid ""
 msgstr ""
-"PO-Revision-Date: 2022-01-31 15:15+\n"
+"PO-Revision-Date: 2022-02-07 23:02+\n"
 "Last-Translator: EdbO \n"
 "Language: nl\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -607,7 +607,7 @@
 
 msgctxt "model:ir.action,name:act_return_form"
 msgid "Returns"
-msgstr "Retours"
+msgstr "Terugnames"
 
 msgctxt "model:ir.action,name:act_shipment_form"
 msgid "Shipments"
@@ -619,11 +619,11 @@
 
 msgctxt "model:ir.action,name:wizard_invoice_handle_exception"
 msgid "Handle Invoice Exception"
-msgstr "Uitzondering factuur afhandeling"
+msgstr "Afhandelen factuur uitzondering"
 
 msgctxt "model:ir.action,name:wizard_modify_header"
 msgid "Modify Header"
-msgstr "Wijzig koptekst"
+msgstr "Wijzig kop"
 
 msgctxt "model:ir.action,name:wizard_return_purchase"
 msgid "Return Purchase"
@@ -631,7 +631,7 @@
 
 msgctxt "model:ir.action,name:wizard_shipment_handle_exception"
 msgid "Handle Shipment Exception"
-msgstr "uitzondering verzendings afhandeling"
+msgstr "Afhandelen zending uitzondering"
 
 msgctxt "model:ir.action.act_window.domain,name:act_purchase_form_domain_all"
 msgid "All"



[tryton-commits] changeset in weblate:default Translated using Weblate (Dutch)

2022-02-07 Thread EdbO
changeset 5bb3bf326c89 in weblate:default
details: https://hg.tryton.org/weblate?cmd=changeset&node=5bb3bf326c89
description:
Translated using Weblate (Dutch)

Currently translated at 100.0% (376 of 376 strings)

Translation: Tryton/sale
Translate-URL: https://translate.tryton.org/projects/tryton/sale/nl/
diffstat:

 modules/sale/locale/nl.po |  312 +++---
 1 files changed, 156 insertions(+), 156 deletions(-)

diffs (1055 lines):

diff -r 9e19e9092054 -r 5bb3bf326c89 modules/sale/locale/nl.po
--- a/modules/sale/locale/nl.po Mon Feb 07 22:18:02 2022 +
+++ b/modules/sale/locale/nl.po Mon Feb 07 22:18:05 2022 +
@@ -1,7 +1,7 @@
 #
 msgid ""
 msgstr ""
-"PO-Revision-Date: 2022-01-31 15:15+\n"
+"PO-Revision-Date: 2022-02-07 23:02+\n"
 "Last-Translator: EdbO \n"
 "Language: nl\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -15,7 +15,7 @@
 
 msgctxt "field:account.invoice,sales:"
 msgid "Sales"
-msgstr "verkoop"
+msgstr "Verkoop"
 
 msgctxt "field:party.party,sale_invoice_method:"
 msgid "Invoice Method"
@@ -23,11 +23,11 @@
 
 msgctxt "field:party.party,sale_methods:"
 msgid "Sale Methods"
-msgstr "Verkoopfactuurmethode"
+msgstr "Verkoop methodes"
 
 msgctxt "field:party.party,sale_shipment_method:"
 msgid "Shipment Method"
-msgstr "Verzendwijze"
+msgstr "Verzend methode"
 
 msgctxt "field:party.party.sale_method,company:"
 msgid "Company"
@@ -39,7 +39,7 @@
 
 msgctxt "field:party.party.sale_method,sale_invoice_method:"
 msgid "Sale Invoice Method"
-msgstr "Verkoopfactuurmethode"
+msgstr "Verkoopfactuur methode"
 
 msgctxt "field:party.party.sale_method,sale_shipment_method:"
 msgid "Sale Shipment Method"
@@ -71,7 +71,7 @@
 
 msgctxt "field:product.product,sale_uom:"
 msgid "Sale UOM"
-msgstr "Maateenheid verkoop"
+msgstr "Verkoop maateeheid"
 
 msgctxt "field:product.sale.context,company:"
 msgid "Company"
@@ -95,11 +95,11 @@
 
 msgctxt "field:product.sale.context,sale_date:"
 msgid "Sale Date"
-msgstr "Verkoopsdatum"
+msgstr "Verkoop datum"
 
 msgctxt "field:product.sale.context,stock_date_end:"
 msgid "Stock End Date"
-msgstr "Einddatum voorraad"
+msgstr "Eind datum voorraad"
 
 msgctxt "field:product.template,lead_time:"
 msgid "Lead Time"
@@ -111,19 +111,19 @@
 
 msgctxt "field:product.template,sale_uom:"
 msgid "Sale UOM"
-msgstr "Maateenheid verkoop"
+msgstr "Verkoop maateeheid"
 
 msgctxt "field:sale.configuration,sale_invoice_method:"
 msgid "Sale Invoice Method"
-msgstr "Verkoopfactuurmethode"
+msgstr "Verkoopfactuur methode"
 
 msgctxt "field:sale.configuration,sale_process_after:"
 msgid "Process Sale after"
-msgstr "Procesverkoop na"
+msgstr "Verwerk verkoop na"
 
 msgctxt "field:sale.configuration,sale_sequence:"
 msgid "Sale Sequence"
-msgstr "Verkoopvolgorde"
+msgstr "Verkoop reeks"
 
 msgctxt "field:sale.configuration,sale_shipment_method:"
 msgid "Sale Shipment Method"
@@ -131,7 +131,7 @@
 
 msgctxt "field:sale.configuration.sale_method,sale_invoice_method:"
 msgid "Sale Invoice Method"
-msgstr "Verkoopfactuurmethode"
+msgstr "Verkoopfactuur methode"
 
 msgctxt "field:sale.configuration.sale_method,sale_shipment_method:"
 msgid "Sale Shipment Method"
@@ -143,7 +143,7 @@
 
 msgctxt "field:sale.configuration.sequence,sale_sequence:"
 msgid "Sale Sequence"
-msgstr "Verkoopvolgorde"
+msgstr "Verkoop reeks"
 
 msgctxt "field:sale.handle.invoice.exception.ask,domain_invoices:"
 msgid "Domain Invoices"
@@ -179,7 +179,7 @@
 
 msgctxt "field:sale.line,description:"
 msgid "Description"
-msgstr "Specificatie"
+msgstr "Omschrijving"
 
 msgctxt "field:sale.line,from_location:"
 msgid "From Location"
@@ -187,11 +187,11 @@
 
 msgctxt "field:sale.line,invoice_lines:"
 msgid "Invoice Lines"
-msgstr "Factuurregels"
+msgstr "Factuur regels"
 
 msgctxt "field:sale.line,move_done:"
 msgid "Moves Done"
-msgstr "Boekingen klaar"
+msgstr "Boekingen gereed"
 
 msgctxt "field:sale.line,move_exception:"
 msgid "Moves Exception"
@@ -211,7 +211,7 @@
 
 msgctxt "field:sale.line,note:"
 msgid "Note"
-msgstr "Aantekening"
+msgstr "Notitie"
 
 msgctxt "field:sale.line,product:"
 msgid "Product"
@@ -219,7 +219,7 @@
 
 msgctxt "field:sale.line,product_uom_category:"
 msgid "Product Uom Category"
-msgstr "Categorie eenheidsmaten (Catégorie d'unité de mesure)"
+msgstr "Categorie mateneenheid"
 
 msgctxt "field:sale.line,quantity:"
 msgid "Quantity"
@@ -235,7 +235,7 @@
 
 msgctxt "field:sale.line,shipping_date:"
 msgid "Shipping Date"
-msgstr "Verzendingsdatum"
+msgstr "Verzend datum"
 
 msgctxt "field:sale.line,summary:"
 msgid "Summary"
@@ -251,7 +251,7 @@
 
 msgctxt "field:sale.line,type:"
 msgid "Type"
-msgstr "Type"
+msgstr "Soort"
 
 msgctxt "field:sale.line,unit:"
 msgid "Unit"
@@ -267,7 +267,7 @@
 
 msgctxt "field:sale.line-account.tax,line:"
 msgid "Sale Line"
-msgstr "Offerteregel"
+msgstr "Verkoop regel"
 
 msgctxt "field:sale.line-account.tax,tax:"
 msgid "Tax"
@@ -279,7 +279,7 @@
 
 msgctxt "field:sale.line-ignored-stock.move,sal

[tryton-commits] changeset in weblate:default Translated using Weblate (Dutch)

2022-02-07 Thread EdbO
changeset 499922327bab in weblate:default
details: https://hg.tryton.org/weblate?cmd=changeset&node=499922327bab
description:
Translated using Weblate (Dutch)

Currently translated at 100.0% (55 of 55 strings)

Translation: Tryton/analytic_budget
Translate-URL: 
https://translate.tryton.org/projects/tryton/analytic_budget/nl/
diffstat:

 modules/analytic_budget/locale/nl.po |  10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (40 lines):

diff -r 5bb3bf326c89 -r 499922327bab modules/analytic_budget/locale/nl.po
--- a/modules/analytic_budget/locale/nl.po  Mon Feb 07 22:18:05 2022 +
+++ b/modules/analytic_budget/locale/nl.po  Mon Feb 07 22:39:17 2022 +
@@ -3,15 +3,15 @@
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2021-10-26 08:08+\n"
-"PO-Revision-Date: 2021-10-28 17:38+\n"
-"Last-Translator: Bert Defoor \n"
+"PO-Revision-Date: 2022-02-07 23:02+\n"
+"Last-Translator: EdbO \n"
 "Language-Team: LANGUAGE \n"
 "Language: nl\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 4.8.1\n"
+"X-Generator: Weblate 4.10.1\n"
 
 msgctxt "field:analytic_account.budget,company:"
 msgid "Company"
@@ -180,7 +180,7 @@
 
 msgctxt "model:ir.action,name:act_budget_line_form"
 msgid "Budget Lines"
-msgstr "Budgetlijn"
+msgstr "Begroting regels"
 
 msgctxt "model:ir.action,name:act_budget_report"
 msgid "Analytic Budgets"
@@ -188,7 +188,7 @@
 
 msgctxt "model:ir.action,name:wizard_budget_copy"
 msgid "Copy Budget"
-msgstr "Budget kopiëren"
+msgstr "Kopieer begroting"
 
 msgctxt "model:ir.model.button,string:budget_copy_button"
 msgid "Copy"



[tryton-commits] changeset in weblate:default Translated using Weblate (Dutch)

2022-02-07 Thread EdbO
changeset c83d795b7f3b in weblate:default
details: https://hg.tryton.org/weblate?cmd=changeset&node=c83d795b7f3b
description:
Translated using Weblate (Dutch)

Currently translated at 100.0% (93 of 93 strings)

Translation: Tryton/account_budget
Translate-URL: 
https://translate.tryton.org/projects/tryton/account_budget/nl/
diffstat:

 modules/account_budget/locale/nl.po |  100 ++-
 1 files changed, 52 insertions(+), 48 deletions(-)

diffs (298 lines):

diff -r 499922327bab -r c83d795b7f3b modules/account_budget/locale/nl.po
--- a/modules/account_budget/locale/nl.po   Mon Feb 07 22:39:17 2022 +
+++ b/modules/account_budget/locale/nl.po   Mon Feb 07 22:39:15 2022 +
@@ -3,15 +3,15 @@
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2021-09-04 07:33+\n"
-"PO-Revision-Date: 2021-10-28 17:38+\n"
-"Last-Translator: Bert Defoor \n"
+"PO-Revision-Date: 2022-02-07 23:02+\n"
+"Last-Translator: EdbO \n"
 "Language-Team: LANGUAGE \n"
 "Language: nl\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 4.8.1\n"
+"X-Generator: Weblate 4.10.1\n"
 
 msgctxt "field:account.budget,company:"
 msgid "Company"
@@ -67,15 +67,15 @@
 
 msgctxt "field:account.budget.line,account:"
 msgid "Account"
-msgstr "Rekening"
+msgstr "Grootboekrekening"
 
 msgctxt "field:account.budget.line,account_type:"
 msgid "Account Type"
-msgstr "Rekeningtype"
+msgstr "Grootboekrekening soort"
 
 msgctxt "field:account.budget.line,actual_amount:"
 msgid "Actual Amount"
-msgstr "Werkelijke bedrag"
+msgstr "Werkelijk bedrag"
 
 msgctxt "field:account.budget.line,amount:"
 msgid "Amount"
@@ -87,7 +87,7 @@
 
 msgctxt "field:account.budget.line,children:"
 msgid "Children"
-msgstr "Onderliggende niveaus"
+msgstr "Onderliggend"
 
 msgctxt "field:account.budget.line,company:"
 msgid "Company"
@@ -111,11 +111,11 @@
 
 msgctxt "field:account.budget.line,parent:"
 msgid "Parent"
-msgstr "Bovenliggend niveau"
+msgstr "Bovenliggend"
 
 msgctxt "field:account.budget.line,parent_account_type:"
 msgid "Parent Account Type"
-msgstr "Type bovenliggende rekening"
+msgstr "Soort grootboekrekening bovenliggende rekening"
 
 msgctxt "field:account.budget.line,percentage:"
 msgid "Percentage"
@@ -139,11 +139,11 @@
 
 msgctxt "field:account.budget.line.period,actual_amount:"
 msgid "Actual Amount"
-msgstr "Werkelijke bedrag"
+msgstr "Werkelijk bedrag"
 
 msgctxt "field:account.budget.line.period,budget_line:"
 msgid "Budget Line"
-msgstr "Budgetlijn"
+msgstr "Begroting regel"
 
 msgctxt "field:account.budget.line.period,currency:"
 msgid "Currency"
@@ -171,7 +171,7 @@
 
 msgctxt "help:account.budget,company:"
 msgid "The company that the budget is associated with."
-msgstr "Het bedrijf waaraan het budget is gekoppeld."
+msgstr "Het bedrijf waaraan de begroting is gekoppeld."
 
 msgctxt "help:account.budget,fiscalyear:"
 msgid "The fiscal year the budget applies to."
@@ -183,84 +183,88 @@
 
 msgctxt "help:account.budget.copy.start,factor:"
 msgid "The percentage to apply to the budget line amounts."
-msgstr "Het percentage dat van toepassing is op de budgetlijnbedragen."
+msgstr ""
+"Het percentage dat van toepassing is op de bedragen van de begroting regels."
 
 msgctxt "help:account.budget.copy.start,fiscalyear:"
 msgid "The fiscal year during which the new budget will apply."
-msgstr "Het boekjaar waarin het nieuwe budget van toepassing is."
+msgstr "Het boekjaar waarin de nieuwe begroting van toepassing is."
 
 msgctxt "help:account.budget.line,account:"
 msgid "The account the budget applies to."
-msgstr "De rekening waarop het budget van toepassing is."
+msgstr "De grootboekrekening waarop de begroting van toepassing is."
 
 msgctxt "help:account.budget.line,account_type:"
 msgid "The account type the budget applies to."
-msgstr "Het rekeningtype waarop het budget van toepassing is."
+msgstr "Het soort grootboekrekening waarop de begroting van toepassing is."
 
 msgctxt "help:account.budget.line,actual_amount:"
 msgid "The total amount booked against the budget line."
-msgstr "Het totale bedrag dat op de budgetlijn is geboekt."
+msgstr "Het totale bedrag dat op de begroting regel is geboekt."
 
 msgctxt "help:account.budget.line,amount:"
 msgid "The amount allocated to the budget line."
-msgstr "Het bedrag dat is toegewezen aan de begrotingslijn."
+msgstr "Het bedrag dat is toegewezen aan de begroting regel."
 
 msgctxt "help:account.budget.line,children:"
 msgid "Used to add structure below the budget."
-msgstr "Gebruikt om structuur toe te voegen onder het budget."
+msgstr "Wordt gebruikt om structuur toe te voegen onder de begroting."
 
 msgctxt "help:account.budget.line,parent:"
 msgid "Used to add structure above the budget."
-msgstr "Wordt gebruikt om structuur toe te voegen boven het budget."
+msgstr "Wordt geb

[tryton-commits] changeset in weblate:default Translated using Weblate (Dutch)

2022-02-07 Thread EdbO
changeset 864ebdeffc97 in weblate:default
details: https://hg.tryton.org/weblate?cmd=changeset&node=864ebdeffc97
description:
Translated using Weblate (Dutch)

Currently translated at 100.0% (161 of 161 strings)

Translation: Tryton/sale_point
Translate-URL: 
https://translate.tryton.org/projects/tryton/sale_point/nl/
diffstat:

 modules/sale_point/locale/nl.po |  12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (49 lines):

diff -r c83d795b7f3b -r 864ebdeffc97 modules/sale_point/locale/nl.po
--- a/modules/sale_point/locale/nl.po   Mon Feb 07 22:39:15 2022 +
+++ b/modules/sale_point/locale/nl.po   Mon Feb 07 22:18:03 2022 +
@@ -3,15 +3,15 @@
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2021-10-26 08:08+\n"
-"PO-Revision-Date: 2021-10-28 18:12+\n"
-"Last-Translator: Bert Defoor \n"
+"PO-Revision-Date: 2022-02-07 23:02+\n"
+"Last-Translator: EdbO \n"
 "Language-Team: LANGUAGE \n"
 "Language: nl\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 4.8.1\n"
+"X-Generator: Weblate 4.10.1\n"
 
 msgctxt "field:product.gross_price,company:"
 msgid "Company"
@@ -399,7 +399,7 @@
 
 msgctxt "model:ir.action.act_window.domain,name:act_sale_form_domain_all"
 msgid "All"
-msgstr "Alle"
+msgstr "Alles"
 
 msgctxt "model:ir.action.act_window.domain,name:act_sale_form_domain_done"
 msgid "Done"
@@ -512,7 +512,7 @@
 
 msgctxt "model:ir.model.button,string:sale_cancel_button"
 msgid "Cancel"
-msgstr "Annuleer"
+msgstr "Annuleren"
 
 msgctxt "model:ir.model.button,string:sale_open_button"
 msgid "Re-Open"
@@ -528,7 +528,7 @@
 
 msgctxt "model:ir.model.button,string:sale_process_button"
 msgid "Process"
-msgstr "Uitvoeren"
+msgstr "Verwerken"
 
 msgctxt "model:ir.rule.group,name:rule_group_cash_session_companies"
 msgid "User in companies"