IRC logs of #tryton for Thursday, 2020-02-06 #tryton log beginning Thu 06 Feb 2020 12:00:01 AM CET
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton00:02
-!- kwmiebach(sid16855@gateway/web/ has joined #tryton01:02
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton02:02
-!- k-man(~jason@unaffiliated/k-man) has joined #tryton03:02
-!- springwurm(~Springwur@ has joined #tryton06:02
-!- mrichez( has joined #tryton08:02
-!- Timitos(~kpreisler@2001:a61:426:7801:762b:62ff:fe84:ed7e) has joined #tryton08:02
-!- rpit( has joined #tryton08:02
-!- josesalvador( has joined #tryton09:02
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton09:02
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton09:02
-!- sebd( has joined #tryton10:02
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 ?10:02
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 server10:02
sebdactually, it I stop the client, the database is released.10:02
semarieah. you are using proteus in "database" mode and not using xmlrpc10:02
semariewith config.set_trytond('...')10:02
sebdok I just realized I do not need a running server so to use proteus (I thought it was pure client)10:02
semarieI am unsure if it is possible. I think the Pool() should be stopped10:02
cedksebd: calling database.close() should do it10:02
sebdok let's try10:02
sebd'str' object has no attribute 'close'10:02
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 client10:02
cedksebd: not the database name but the real database instance10:02
cedksebd: you can get it from Transaction10:02
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton10:02
sebdcedk: Transaction.start(dbname, 0).database.close() is wrong. How to get the current Database instance without starting a new transaction ?11:02
sebdor how to I reset the whole proteus environment ?11:02
sebdimportlib.reload(config) is not enough11:02
sebdnever mind, I'll use another algorithm11:02
-!- mariomop(~quassel@ has joined #tryton11:02
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton12:02
-!- springwurm(~Springwur@ has joined #tryton14: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 ?15:02
sebdIdentifiers and ContactMechanisms do not suffer this problem.15:02
-!- nicoe(~nicoe@2a02:578:852a:c00:7e2a:31ff:fe5e:b25d) has joined #tryton15:02
-!- josesalvador(~josesalva@ has joined #tryton15:02
pokolisebd: you can update this value at creating16:02
sebdPartner(name='...', addresses=[Address(name='...', ...)]).save()  # inserts an empty address before mine16:02
sebdI understand I have to update the auto-created address, yes16:02
sebdI just don't understand why16:02
pokolisebd: party = Party(); address, = party.addresses; address.street = 'Your street here'16:02
sebdtoo many code lines ! ;)16:02
-!- josesalvador(~josesalva@ has joined #tryton16:02
cedksebd: because proteus behaves like the client16:02
cedksebd: you can not in the client prefill a field at creation before having the default value16:02
cedkbut I think we could improve proteus to not request default value for fields passed at initialization16:02
-!- josesalvador(~josesalva@ has joined #tryton16:02
sebdok I understand16:02
-!- josesalvador(~josesalva@ has joined #tryton17:02
-!- josesalvador(~josesalva@ has joined #tryton17:02
-!- josesalvador(~josesalva@ has joined #tryton18:02

Generated by 2.16.0 by Marius Gedminas - find it at!