IRC logs of #tryton for Wednesday, 2020-05-13

chat.freenode.net #tryton log beginning Wed 13 May 2020 12:00:01 AM CEST
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton22:40
-!- thaneor(~ldlc6@r186-55-20-104.dialup.adsl.anteldata.net.uy) has joined #tryton02:07
-!- springwurm(~Springwur@5.104.149.54) has joined #tryton04:46
-!- mrichez(~Maxime@2a02:a03f:467c:d500:a385:4ecf:c4ea:d8cf) has joined #tryton05:35
-!- rpit(~rpit@p4FFB760E.dip0.t-ipconnect.de) has joined #tryton06:14
semariewhat is the way to make tox to avoid cloning from https://hg.tryton.org/ but using local repositories ?06:45
pokolisemarie: if you've cloned tryton-env you can run tryton tests with: python -m trytond.tests.run-tests -m <module_name>07:11
pokolisemarie: this runs the tests from sources without installing anything07:12
semarieI have a local tryton-env clone, but I keep it clean and I work in cloned modules (outside tryton-env)07:16
semariekeeping it clean permit me to control what I put in production :)07:17
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton07:34
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton08:00
-!- Timitos(~kpreisler@2001:a61:400:901:762b:62ff:fe84:ed7e) has joined #tryton08:16
pokolisemarie: and how do you install dependencies?08:29
semariepokoli: I am running tox with --sitepackages. dependencies are installed system wide (as I am running trytond locally for testing purpose)09:13
pokolisemarie: I mean internall dependencies, i.e: Other tryton modules09:23
pokolisemarie: you clone also in the cloned modules?09:23
semarieoh09:23
semarieit is the problem. tox clone them from internet09:23
semariefrom tox point of vue, I have only a cloned module. so when running, tox installs it and all dependencies (cloned from hg.tryton.org) before running tests09:25
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton09:38
-!- mariomop(~quassel@190.193.24.15) has joined #tryton10:56
semarieI have an odd behaviour with sqlite: my column is defined as FirstValue(statement.end_balance, window=w).as_('last_amount') and fetchall() returns to me bytes()11:31
semariethe usual idiom for sqlite is: if not isinstance(var, Decimal): var = Decimal(str(var))11:32
semariebut here with bytes() :  str(b'80') => "b'80'"11:32
semarieand Decimal fails with decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]11:32
cedksemarie: only for this field?11:35
semarieI haven't check others fields if bytes() or str()11:35
semarieI will do it11:35
cedksemarie: SQLite tries to interpret the type from the value11:37
cedksemarie: sometimes it may help to force the cast11:38
semarieothers seems fine: 1 2020-05-13 b'80' / but it is:  int, date, numeric11:40
semarieI will try with a Cast11:40
cedksemarie: by the way, we define has_window_functions as false for SQLite11:42
cedkI think you should not use window function with SQLite11:44
semarie:-(11:45
cedkwindows function on SQLite is still quite recent: https://www.sqlite.org/windowfunctions.html#history11:46
semarieI am currently looking at https://sqlite.org/windowfunctions.html#biwinfunc11:46
cedkand I bet the casting is not yet good enough11:46
semarieah. I think a found a bug in python-sql11:51
semarieCast(FirstValue(statement.end_balance, window=w).as_('last_amount'), Statement.end_balance.sql_type().base) => CAST("last_amount" AS NUMERIC)11:52
semarieI will move the .as_()11:53
cedksemarie: it is not a valid expression, the "AS" should always be the last call11:53
semarieyes, it is better with .as_() last11:54
semarieand the Cast() seems to do right things11:55
cedkreading https://www.sqlite.org/datatype3.html#type_affinity the problem may come from NULL value stored in this column11:56
cedksemarie: but any way, you should provide an implementation also without window function (we do not care if it is less performent)11:57
-!- springwurm(~Springwur@5.104.149.54) has joined #tryton12:05
-!- lucas__(~lucascast@177-185-139-41.isotelco.net.br) has joined #tryton12:05
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton12:11
-!- thaneor1(~ldlc6@r186-55-19-1.dialup.adsl.anteldata.net.uy) has joined #tryton14:09
-!- udono1(~udono@121-131-067-156.ip-addr.inexio.net) has joined #tryton14:21
-!- udono(~udono@048-135-067-156.ip-addr.inexio.net) has joined #tryton14:39
semarieI think I have a cache/depends issue with my Function field in 'account.statement.journal' : the value is computed from 'account.statement'. how to add a depend for that in order to let know tryton when to refresh ?14:53
cedksemarie: I do not understand the problem15:10
semariecedk: using tests scenarios to check account_journal.last_date value, it keep the first value tested15:13
semarieif my first test is just after journal creation, the value is None (right), and for further tests it is always None (wrong)15:14
cedksemarie: you must call reload on the record15:14
cedklike you would do with the client15:14
semariearg15:14
semarieat lest, it would be more simple. thanks :)15:15
semarieleast*15:15
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton16:01
-!- thaneor(~ldlc6@r186-55-19-1.dialup.adsl.anteldata.net.uy) has joined #tryton16:08
-!- josesalvador(~josesalva@170.253.40.186) has joined #tryton18:10
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton19:23
-!- umekalu(~abraham@197.210.227.59) has joined #tryton19:47

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!