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

2020-02-04 Thread Cedric Krier
changeset 8e9435f0737f in weblate:default
details: https://hg.tryton.org/weblate?cmd=changeset;node=8e9435f0737f
description:
Translated using Weblate (French)

Currently translated at 100.0% (133 of 133 strings)

Translation: Tryton/production
Translate-URL: 
https://translate.tryton.org/projects/tryton/production/fr/
diffstat:

 modules/production/locale/fr.po |  13 ++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 23dcbe6f2c24 -r 8e9435f0737f modules/production/locale/fr.po
--- a/modules/production/locale/fr.po   Tue Feb 04 22:45:22 2020 +
+++ b/modules/production/locale/fr.po   Tue Feb 04 22:46:59 2020 +
@@ -1,6 +1,13 @@
 #
 msgid ""
-msgstr "Content-Type: text/plain; charset=UTF-8\n"
+msgstr ""
+"PO-Revision-Date: 2020-02-05 07:57+\n"
+"Last-Translator: Cedric Krier \n"
+"Language: fr\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 3.10.3\n"
 
 msgctxt "field:product.product,boms:"
 msgid "BOMs"
@@ -249,7 +256,7 @@
 
 msgctxt "field:stock.move,production_cost_price_updated:"
 msgid "Cost Price Updated"
-msgstr ""
+msgstr "Prix de revient actualisé"
 
 msgctxt "field:stock.move,production_input:"
 msgid "Production Input"
@@ -471,7 +478,7 @@
 
 msgctxt "selection:ir.cron,method:"
 msgid "Set Cost from Moves"
-msgstr ""
+msgstr "Établir les coûts des mouvements"
 
 msgctxt "selection:production,state:"
 msgid "Assigned"



[tryton-commits] changeset in modules/sale:default Make sale required on line

2020-02-04 Thread Cédric Krier
changeset 80a8e42ec637 in modules/sale:default
details: https://hg.tryton.org/modules/sale?cmd=changeset;node=80a8e42ec637
description:
Make sale required on line

issue8998
review286561002
diffstat:

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

diffs (12 lines):

diff -r 702bf7fc4e03 -r 80a8e42ec637 sale.py
--- a/sale.py   Sat Jan 25 20:18:49 2020 +0100
+++ b/sale.py   Tue Feb 04 18:33:23 2020 +0100
@@ -945,7 +945,7 @@
 'Sale Line'
 __name__ = 'sale.line'
 sale = fields.Many2One('sale.sale', 'Sale', ondelete='CASCADE',
-select=True,
+select=True, required=True,
 states={
 'readonly': ((Eval('sale_state') != 'draft')
 & Bool(Eval('sale'))),



[tryton-commits] changeset in sao:default Add tests for types checking in PYSON G...

2020-02-04 Thread Cédric Krier
changeset 55fd1e215974 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=55fd1e215974
description:
Add tests for types checking in PYSON Greater

issue9002
review276711002
diffstat:

 tests/sao.js |  8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (25 lines):

diff -r 366f80d5f722 -r 55fd1e215974 tests/sao.js
--- a/tests/sao.js  Tue Feb 04 18:30:04 2020 +0100
+++ b/tests/sao.js  Tue Feb 04 18:32:10 2020 +0100
@@ -403,6 +403,9 @@
 QUnit.throws(function() {
 new Sao.PYSON.Greater(1, 'test');
 }, 'statement must be an integer or a float');
+QUnit.throws(function() {
+new Sao.PYSON.Greater(new Sao.PYSON.Eval('foo'), 0);
+}, 'statement must be an integer of float');
 
 QUnit.ok(Sao.common.compare(new Sao.PYSON.Greater(1, 0).types(),
 ['boolean']), 'Greater(1, 0).types()');
@@ -444,6 +447,11 @@
 'decode(Greater(1, null))');
 QUnit.strictEqual(new Sao.PYSON.Greater(1, 0).toString(),
 "Greater(1, 0, false)");
+
+eval_ = new Sao.PYSON.Encoder().encode(
+new Sao.PYSON.Greater(new Sao.PYSON.Eval('i', 0), 0));
+QUnit.strictEqual(new Sao.PYSON.Decoder({i: 1}).decode(eval_), true,
+"decode(Greater(Eval('i', 0)))");
 });
 
 QUnit.test('PYSON Less', function() {



[tryton-commits] changeset in trytond:default Add tests for types checking in PYS...

2020-02-04 Thread Cédric Krier
changeset 0cbfedbcf98e in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=0cbfedbcf98e
description:
Add tests for types checking in PYSON Greater

issue9002
review276711002
diffstat:

 trytond/tests/test_pyson.py |  6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diffs (23 lines):

diff -r 0ba6dd7d1c81 -r 0cbfedbcf98e trytond/tests/test_pyson.py
--- a/trytond/tests/test_pyson.py   Wed Jan 29 00:05:32 2020 +0100
+++ b/trytond/tests/test_pyson.py   Tue Feb 04 18:32:10 2020 +0100
@@ -224,6 +224,8 @@
 if not sys.flags.optimize:
 self.assertRaises(AssertionError, pyson.Greater, 'test', 0)
 self.assertRaises(AssertionError, pyson.Greater, 1, 'test')
+self.assertRaises(
+AssertionError, pyson.Greater, pyson.Eval('foo'), 0)
 
 self.assertEqual(pyson.Greater(1, 0).types(), set([bool]))
 
@@ -253,6 +255,10 @@
 
 self.assertEqual(repr(pyson.Greater(1, 0)), 'Greater(1, 0, False)')
 
+eval = pyson.PYSONEncoder().encode(
+pyson.Greater(pyson.Eval('i', 0), 0))
+self.assertTrue(pyson.PYSONDecoder({'i': 1}).decode(eval))
+
 def test_Less(self):
 'Test pyson.Less'
 self.assertEqual(pyson.Less(0, 1).pyson(), {



[tryton-commits] changeset in sao:default Check statement types in Greater PYSON

2020-02-04 Thread Cédric Krier
changeset 366f80d5f722 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=366f80d5f722
description:
Check statement types in Greater PYSON

issue9002
review276711002
diffstat:

 src/pyson.js |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 61b6bde722d9 -r 366f80d5f722 src/pyson.js
--- a/src/pyson.js  Tue Feb 04 18:28:09 2020 +0100
+++ b/src/pyson.js  Tue Feb 04 18:30:04 2020 +0100
@@ -383,7 +383,7 @@
 for (var i = 0; i < 2; i++) {
 var statement = statements[i];
 if (statement instanceof Sao.PYSON.PYSON) {
-if (jQuery(statement).not(['number']).length) {
+if (jQuery(statement.types()).not(['number']).length) {
 throw 'statement must be an integer or a float';
 }
 } else {



[tryton-commits] changeset in tryton:default Use locale context to format date in...

2020-02-04 Thread Cédric Krier
changeset a40efbdaba86 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=a40efbdaba86
description:
Use locale context to format date in domain parser

issue8999
review278401002
diffstat:

 tryton/common/domain_parser.py |  12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (50 lines):

diff -r 65b4f2df4b0e -r a40efbdaba86 tryton/common/domain_parser.py
--- a/tryton/common/domain_parser.pyTue Jan 28 00:36:19 2020 +0100
+++ b/tryton/common/domain_parser.pyTue Feb 04 18:28:09 2020 +0100
@@ -10,7 +10,7 @@
 import io
 from collections import OrderedDict
 
-from tryton.common import untimezoned_date, timezoned_date
+from tryton.common import untimezoned_date, timezoned_date, date_format
 from tryton.common.datetime_ import date_parse
 from tryton.common.timedelta import parse as timedelta_parse
 from tryton.common.timedelta import format as timedelta_format
@@ -237,7 +237,8 @@
 def convert_datetime():
 if not value:
 return
-format_ = context.get('date_format', '%x') + ' %X'
+format_ = (
+date_format(context.get('date_format')) + ' ' + time_format(field))
 try:
 dt = date_parse(value, format_)
 return untimezoned_date(dt)
@@ -247,7 +248,7 @@
 def convert_date():
 if not value:
 return
-format_ = context.get('date_format', '%x')
+format_ = date_format(context.get('date_format'))
 try:
 return date_parse(value, format_).date()
 except (ValueError, TypeError):
@@ -337,7 +338,8 @@
 def format_datetime():
 if not value:
 return ''
-format_ = context.get('date_format', '%x') + ' ' + time_format(field)
+format_ = (
+date_format(context.get('date_format')) + ' ' + time_format(field))
 if not isinstance(value, datetime.datetime):
 time = datetime.datetime.combine(value, datetime.time.min)
 else:
@@ -349,7 +351,7 @@
 def format_date():
 if not value:
 return ''
-format_ = context.get('date_format', '%x')
+format_ = date_format(context.get('date_format'))
 return value.strftime(format_)
 
 def format_time():



[tryton-commits] changeset in sao:default Use locale context to format date in do...

2020-02-04 Thread Cédric Krier
changeset 61b6bde722d9 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=61b6bde722d9
description:
Use locale context to format date in domain parser

issue8999
review278401002
diffstat:

 src/common.js |  28 +---
 1 files changed, 17 insertions(+), 11 deletions(-)

diffs (96 lines):

diff -r f8e41334bfe7 -r 61b6bde722d9 src/common.js
--- a/src/common.js Fri Jan 24 00:25:30 2020 +0100
+++ b/src/common.js Tue Feb 04 18:28:09 2020 +0100
@@ -1744,8 +1744,8 @@
 'time'].indexOf(field.type)) {
 if ((typeof value == 'string') && 
value.contains('..')) {
 var values = value.split('..', 2);
-var lvalue = this.convert_value(field, values[0]);
-var rvalue = this.convert_value(field, values[1]);
+var lvalue = this.convert_value(field, values[0], 
this.context);
+var rvalue = this.convert_value(field, values[1], 
this.context);
 result.push([
 this._clausify([field_name, '>=', lvalue]),
 this._clausify([field_name, '<=', rvalue])
@@ -1755,14 +1755,14 @@
 }
 if (value instanceof Array) {
 value = value.map(function(v) {
-return this.convert_value(field, v);
+return this.convert_value(field, v, this.context);
 }.bind(this));
 if (~['many2one', 'one2many', 'many2many', 'one2one',
 'many2many', 'one2one'].indexOf(field.type)) {
 field_name += '.rec_name';
 }
 } else {
-value = this.convert_value(field, value);
+value = this.convert_value(field, value, this.context);
 }
 if (operator.contains('like')) {
 value = this.likify(value);
@@ -1848,7 +1848,10 @@
 }
 return [target, value];
 },
-convert_value: function(field, value) {
+convert_value: function(field, value, context) {
+if (!context) {
+context = {};
+}
 var convert_selection = function() {
 if (typeof value == 'string') {
 for (var i = 0; i < field.selection.length; i++) {
@@ -1911,14 +1914,14 @@
 'reference': convert_selection,
 'datetime': function() {
 var result = Sao.common.parse_datetime(
-Sao.common.date_format(),
+Sao.common.date_format(context.date_format),
 this.time_format(field),
 value);
 return result;
 }.bind(this),
 'date': function() {
 return Sao.common.parse_date(
-Sao.common.date_format(),
+Sao.common.date_format(context.date_format),
 value);
 },
 'time': function() {
@@ -1951,10 +1954,13 @@
 return value;
 }
 },
-format_value: function(field, value, target) {
+format_value: function(field, value, target, context) {
 if (target === undefined) {
 target = null;
 }
+if (!context) {
+context = {};
+}
 var format_float = function() {
 if (!value && value !== 0 && value !== new Sao.Decimal(0)) {
 return '';
@@ -2023,17 +2029,17 @@
 value.minute() ||
 value.second())) {
 return Sao.common.format_date(
-Sao.common.date_format(),
+Sao.common.date_format(context.date_format),
 value);
 }
 return Sao.common.format_datetime(
-Sao.common.date_format(),
+Sao.common.date_format(context.date_format),
 this.time_format(field),
 value);
 }.bind(this),
 'date': function() {
 return Sao.common.format_date(
-Sao.common.date_format(),
+Sao.common.date_format(context.date_format),
 value);
 },
 'time': function() {



[tryton-commits] changeset in modules/account:default Enable periods to end on an...

2020-02-04 Thread David Harper
changeset 2330071b33cf in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset;node=2330071b33cf
description:
Enable periods to end on any day of the month

issue8855
review252671002
diffstat:

 CHANGELOG |2 +
 __init__.py   |  146 +
 fiscalyear.py |  110 ++
 fiscalyear.xml|   23 ++-
 tests/test_account.py |   49 -
 view/fiscalyear_create_periods_start_form.xml |   14 ++
 view/fiscalyear_form.xml  |3 +-
 7 files changed, 232 insertions(+), 115 deletions(-)

diffs (517 lines):

diff -r 69a5c20480c8 -r 2330071b33cf CHANGELOG
--- a/CHANGELOG Sun Jan 12 10:21:51 2020 +0100
+++ b/CHANGELOG Tue Feb 04 10:10:32 2020 +0100
@@ -1,3 +1,5 @@
+* Allow periods to end on any day of the month
+* Use a wizard to select parameters when creating periods
 * Modularize code in GroupLines wizard
 
 Version 5.4.0 - 2019-11-04
diff -r 69a5c20480c8 -r 2330071b33cf __init__.py
--- a/__init__.py   Sun Jan 12 10:21:51 2020 +0100
+++ b/__init__.py   Tue Feb 04 10:10:32 2020 +0100
@@ -2,62 +2,62 @@
 # this repository contains the full copyright notices and license terms.
 
 from trytond.pool import Pool
-from .fiscalyear import *
-from .account import *
+from . import account
 from . import configuration
-from .period import *
-from .journal import *
-from .move import *
-from .move_template import *
+from . import fiscalyear
+from . import journal
+from . import move
+from . import move_template
+from . import party
+from . import period
 from . import tax
-from . import party
 
 
 def register():
 Pool.register(
-FiscalYear,
-BalanceNonDeferralStart,
-TypeTemplate,
-Type,
-AccountTemplate,
-AccountTemplateTaxTemplate,
-Account,
-AccountDeferral,
-AccountTax,
-OpenChartAccountStart,
-GeneralLedgerAccount,
-GeneralLedgerAccountContext,
-GeneralLedgerLine,
-GeneralLedgerLineContext,
-BalanceSheetContext,
-BalanceSheetComparisionContext,
-IncomeStatementContext,
-CreateChartStart,
-CreateChartAccount,
-CreateChartProperties,
-UpdateChartStart,
-UpdateChartSucceed,
-AgedBalanceContext,
-AgedBalance,
+fiscalyear.FiscalYear,
+fiscalyear.BalanceNonDeferralStart,
+account.TypeTemplate,
+account.Type,
+account.AccountTemplate,
+account.AccountTemplateTaxTemplate,
+account.Account,
+account.AccountDeferral,
+account.AccountTax,
+account.OpenChartAccountStart,
+account.GeneralLedgerAccount,
+account.GeneralLedgerAccountContext,
+account.GeneralLedgerLine,
+account.GeneralLedgerLineContext,
+account.BalanceSheetContext,
+account.BalanceSheetComparisionContext,
+account.IncomeStatementContext,
+account.CreateChartStart,
+account.CreateChartAccount,
+account.CreateChartProperties,
+account.UpdateChartStart,
+account.UpdateChartSucceed,
+account.AgedBalanceContext,
+account.AgedBalance,
 configuration.Configuration,
 configuration.ConfigurationDefaultAccount,
 configuration.DefaultTaxRule,
-Period,
-Journal,
-JournalSequence,
-JournalCashContext,
-JournalPeriod,
-Move,
-Reconciliation,
+period.Period,
+journal.Journal,
+journal.JournalSequence,
+journal.JournalCashContext,
+journal.JournalPeriod,
+move.Move,
+move.Reconciliation,
 configuration.ConfigurationTaxRounding,
-Line,
-WriteOff,
-OpenJournalAsk,
-ReconcileLinesWriteOff,
-ReconcileShow,
-CancelMovesDefault,
-GroupLinesStart,
-PrintGeneralJournalStart,
+move.Line,
+move.WriteOff,
+move.OpenJournalAsk,
+move.ReconcileLinesWriteOff,
+move.ReconcileShow,
+move.CancelMovesDefault,
+move.GroupLinesStart,
+move.PrintGeneralJournalStart,
 tax.TaxGroup,
 tax.TaxCodeTemplate,
 tax.TaxCode,
@@ -73,41 +73,43 @@
 tax.TaxRuleLine,
 tax.TestTaxView,
 tax.TestTaxViewResult,
-MoveTemplate,
-MoveTemplateKeyword,
-MoveLineTemplate,
-TaxLineTemplate,
-CreateMoveTemplate,
-CreateMoveKeywords,
+move_template.MoveTemplate,
+move_template.MoveTemplateKeyword,
+move_template.MoveLineTemplate,
+move_template.TaxLineTemplate,
+move_template.CreateMoveTemplate,
+move_template.CreateMoveKeywords,
 party.Party,