IRC logs of #tryton for Thursday, 2020-02-06

chat.freenode.net #tryton log beginning Thu 06 Feb 2020 12:00:01 AM CET
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton23:58
-!- kwmiebach(sid16855@gateway/web/irccloud.com/x-nqehdsygomwnksdv) has joined #tryton00:26
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton01:17
-!- k-man(~jason@unaffiliated/k-man) has joined #tryton02:54
-!- springwurm(~Springwur@5.104.149.54) has joined #tryton05:58
-!- mrichez(~Maxime@mail.saluc.com) has joined #tryton07:24
-!- Timitos(~kpreisler@2001:a61:426:7801:762b:62ff:fe84:ed7e) has joined #tryton07:51
-!- rpit(~rpit@p200300C88F4B78001207D9AC39121C59.dip0.t-ipconnect.de) has joined #tryton07:53
-!- josesalvador(~josesalva@84.124.29.26.static.user.ono.com) has joined #tryton08:12
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton08:27
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton08:53
-!- sebd(~seb@aditu.ldd.fr) has joined #tryton09:13
sebdHello, using proteus 5.4, I would like to close an open session, so to release the database (and be able to use it as template to create a new one). I tried to "del" the TrytondConfig, does not work. Nor TrytondConfig.pool.stop(database_name). I cannot find an easy way. Is there ?09:19
semariesebd: I think that in order to release the database you will need to shutdown the server. no just to not have a client connected to the server09:21
sebdactually, it I stop the client, the database is released.09:22
semarieah. you are using proteus in "database" mode and not using xmlrpc09:23
semariewith config.set_trytond('...')09:23
sebdyes09:24
sebdok I just realized I do not need a running server so to use proteus (I thought it was pure client)09:26
semarieI am unsure if it is possible. I think the Pool() should be stopped09:26
cedksebd: calling database.close() should do it09:27
sebdok let's try09:27
sebd'str' object has no attribute 'close'09:28
semariesebd: proteus has two connection mode: using set_trytond('database'), it will directly use trytond code to speak with database ; and set_xmlrpc(url) where is acts as a client09:28
cedksebd: not the database name but the real database instance09:29
cedksebd: you can get it from Transaction09:29
sebdok09:29
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton09:34
sebdcedk: Transaction.start(dbname, 0).database.close() is wrong. How to get the current Database instance without starting a new transaction ?10:34
sebdor how to I reset the whole proteus environment ?10:37
sebdimportlib.reload(config) is not enough10:42
sebdnever mind, I'll use another algorithm10:43
-!- mariomop(~quassel@181.228.29.59) has joined #tryton10:46
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton11:24
-!- springwurm(~Springwur@5.104.149.54) has joined #tryton13:02
sebdParty.addresses is filled with an empty Address at creation. A supplied Address cannot overridable this first empty Address, except when user is root. Why ?14:16
sebdIdentifiers and ContactMechanisms do not suffer this problem.14:17
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton14:24
-!- josesalvador(~josesalva@170.253.41.74) has joined #tryton14:38
pokolisebd: you can update this value at creating15:00
sebdPartner(name='...', addresses=[Address(name='...', ...)]).save()  # inserts an empty address before mine15:08
sebdI understand I have to update the auto-created address, yes15:09
sebdI just don't understand why15:09
pokolisebd: party = Party(); address, = party.addresses; address.street = 'Your street here'15:10
sebdtoo many code lines ! ;)15:11
-!- josesalvador(~josesalva@170.253.41.74) has joined #tryton15:38
cedksebd: because proteus behaves like the client15:40
cedksebd: you can not in the client prefill a field at creation before having the default value15:41
cedkbut I think we could improve proteus to not request default value for fields passed at initialization15:41
-!- josesalvador(~josesalva@170.253.41.74) has joined #tryton15:42
sebdok I understand15:43
-!- josesalvador(~josesalva@170.253.41.74) has joined #tryton16:03
-!- josesalvador(~josesalva@170.253.41.74) has joined #tryton16:49
-!- josesalvador(~josesalva@170.253.41.74) has joined #tryton17:17

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