IRC logs of #tryton for Wednesday, 2020-05-13 #tryton log beginning Wed 13 May 2020 12:00:01 AM CEST
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton00:05
-!- thaneor( has joined #tryton04:05
-!- springwurm(~Springwur@ has joined #tryton06:05
-!- mrichez(~Maxime@2a02:a03f:467c:d500:a385:4ecf:c4ea:d8cf) has joined #tryton07:05
-!- rpit( has joined #tryton08:05
semariewhat is the way to make tox to avoid cloning from but using local repositories ?08:05
pokolisemarie: if you've cloned tryton-env you can run tryton tests with: python -m -m <module_name>09:05
pokolisemarie: this runs the tests from sources without installing anything09:05
semarieI have a local tryton-env clone, but I keep it clean and I work in cloned modules (outside tryton-env)09:05
semariekeeping it clean permit me to control what I put in production :)09:05
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton09:05
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton10:05
-!- Timitos(~kpreisler@2001:a61:400:901:762b:62ff:fe84:ed7e) has joined #tryton10:05
pokolisemarie: and how do you install dependencies?10:05
semariepokoli: I am running tox with --sitepackages. dependencies are installed system wide (as I am running trytond locally for testing purpose)11:05
pokolisemarie: I mean internall dependencies, i.e: Other tryton modules11:05
pokolisemarie: you clone also in the cloned modules?11:05
semarieit is the problem. tox clone them from internet11:05
semariefrom tox point of vue, I have only a cloned module. so when running, tox installs it and all dependencies (cloned from before running tests11:05
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton11:05
-!- mariomop(~quassel@ has joined #tryton12:05
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()13:05
semariethe usual idiom for sqlite is: if not isinstance(var, Decimal): var = Decimal(str(var))13:05
semariebut here with bytes() :  str(b'80') => "b'80'"13:05
semarieand Decimal fails with decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]13:05
cedksemarie: only for this field?13:05
semarieI haven't check others fields if bytes() or str()13:05
semarieI will do it13:05
cedksemarie: SQLite tries to interpret the type from the value13:05
cedksemarie: sometimes it may help to force the cast13:05
semarieothers seems fine: 1 2020-05-13 b'80' / but it is:  int, date, numeric13:05
semarieI will try with a Cast13:05
cedksemarie: by the way, we define has_window_functions as false for SQLite13:05
cedkI think you should not use window function with SQLite13:05
cedkwindows function on SQLite is still quite recent:
semarieI am currently looking at
cedkand I bet the casting is not yet good enough13:05
semarieah. I think a found a bug in python-sql13:05
semarieCast(FirstValue(statement.end_balance, window=w).as_('last_amount'), Statement.end_balance.sql_type().base) => CAST("last_amount" AS NUMERIC)13:05
semarieI will move the .as_()13:05
cedksemarie: it is not a valid expression, the "AS" should always be the last call13:05
semarieyes, it is better with .as_() last13:05
semarieand the Cast() seems to do right things13:05
cedkreading the problem may come from NULL value stored in this column13:05
cedksemarie: but any way, you should provide an implementation also without window function (we do not care if it is less performent)13:05
-!- springwurm(~Springwur@ has joined #tryton14:05
-!- lucas__( has joined #tryton14:05
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton14:05
-!- thaneor1( has joined #tryton16:05
-!- udono1( has joined #tryton16:05
-!- udono( has joined #tryton16:05
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 ?16:05
cedksemarie: I do not understand the problem17:05
semariecedk: using tests scenarios to check account_journal.last_date value, it keep the first value tested17:05
semarieif my first test is just after journal creation, the value is None (right), and for further tests it is always None (wrong)17:05
cedksemarie: you must call reload on the record17:05
cedklike you would do with the client17:05
semarieat lest, it would be more simple. thanks :)17:05
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton18:05
-!- thaneor( has joined #tryton18:05
-!- josesalvador(~josesalva@ has joined #tryton20:05
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton21:05
-!- umekalu(~abraham@ has joined #tryton21:05

Generated by 2.16.0 by Marius Gedminas - find it at!