IRC logs of #tryton for Wednesday, 2018-03-28

chat.freenode.net #tryton log beginning Wed Mar 28 00:00:01 CEST 2018
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton01:03
-!- cdchapman(~perturbed@c-67-169-243-133.hsd1.ut.comcast.net) has joined #tryton03:03
-!- mono(~mono@201.184.144.165) has joined #tryton03:03
-!- kstenger(~karla@r186-55-75-95.dialup.adsl.anteldata.net.uy) has joined #tryton03:03
-!- zmijunkie1(~Adium@200116b80a2c1d009c9092826cdbdbb7.dip.versatel-1u1.de) has joined #tryton04:03
-!- yangoon1(~mathiasb@i59F4A741.versanet.de) has joined #tryton04:03
-!- mono(~mono@201.184.144.165) has joined #tryton05:03
-!- udono1(~udono@075-057-210-188.ip-addr.inexio.net) has joined #tryton06:03
-!- _2cadz(~2cadz@212-198-245-154.rev.numericable.fr) has joined #tryton07:03
-!- hedererjs(~hedererjs@dig50-1-78-222-206-45.fbx.proxad.net) has joined #tryton08:03
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton08:03
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton09:03
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton09:03
-!- zmijunkie(~Adium@x2f7f12a.dyn.telefonica.de) has joined #tryton09:03
-!- zmijunkie(~Adium@b2b-78-94-52-226.unitymedia.biz) has joined #tryton09:03
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton09:03
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton10:03
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton10:03
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton10:03
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton10:03
-!- _2cadz_(~2cadz@80.215.72.209) has joined #tryton12:03
-!- _2cadz(~2cadz@212-198-245-154.rev.numericable.fr) has joined #tryton12:03
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton12:03
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton12:03
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton13:03
-!- mariomop(~quassel@181.91.17.234) has joined #tryton13:03
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton14:03
-!- _2cadz(~2cadz@212-198-245-154.rev.numericable.fr) has joined #tryton14:03
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton14:03
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton14:03
-!- hedererjs(~hedererjs@dig50-1-78-222-206-45.fbx.proxad.net) has joined #tryton14:03
-!- kstenger1(~karla@r186-49-252-111.dialup.adsl.anteldata.net.uy) has joined #tryton15:03
-!- csotelo(~csotelo@179.43.97.56) has joined #tryton15:03
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton16:03
-!- _2cadz_(~2cadz@212-198-245-154.rev.numericable.fr) has joined #tryton16:03
-!- andrespoliti(~andrespol@250-183-89-200.fibertel.com.ar) has joined #tryton16:03
andrespolitihi, i have a function one2many that calculates some totals. It's not persisted and the calculations are way too complicated to do them as a sql view, so i did it in the on_change, but now, the save confirmation dialog pops up when the function field has data. Is there a way of disabling the save dialog if this field detects changes?16:03
andrespolitimy question is similar to a previous question i made https://www.tryton.org/~irclog/2017-10-05.log.html but now i can't solve it by defining an sql view16:03
pokoliandrespoliti: your function probably does not return the correct values and the client thinks that the user has changed it16:03
pokoliandrespoliti: one reason can be that you are returning more digits than the ones expected by the client (defined in field definition)16:03
andrespolitino, it's not it, i fill the one2many with empty lines and the dialog still pops up16:03
andrespolitiempty dictionaries16:03
andrespolitii think the dialog pops up because the model detects that the function one2many changed16:03
pokoliandrespoliti: I think what you are trying to achieve is: https://bugs.tryton.org/issue376416:03
andrespolitipokoli: i don't know if this is correct, but the function one2many on_change depends on the model's id, so it gets filled as soon as the user opens a record16:03
andrespolitipokoli: yes, i want to give the one2many a list of dicts of computed data17:03
andrespolitiis there any way around the save dialog?17:03
andrespolitiwould replacing the on_change with a getter work?17:03
pokoliandrespoliti: the problem is that the API is based on ids, so you should always give the same id to the generated records17:03
pokoliandrespoliti: using negative ids will not work as the client will consider them new records17:03
pokoliandrespoliti: I remember making it work, but it required some hack on the target model17:03
andrespolitithe target model is a modelView, i created it specially for this case17:03
pokoliandrespoliti: If you have a fixed number of records on the relation, you can use a table query to create the ids and then add functional fields to compute the values17:03
andrespolitimm i don't think so, it can have any number of records17:03
pokoliandrespoliti: could you explain what are you calculating?17:03
andrespolitifor a party, i calculate the total amounts of vouchers and settlements, grouped by year and month17:03
andrespolitibut inside each record, there are other calculations that are also grouped17:03
pokoliandrespoliti: the first sentence sounds as calculable in a sql query, so better if you can use a ModelSQL wiht table_query17:03
andrespolitiyes, but it has multiple levels17:03
pokoliandrespoliti: by levels you mean that you have a tree?17:03
andrespolitithe target model also has 3 other function one2many's17:03
pokoliandrespoliti: here is an example on how to calculate a resum per month, year: http://hg.tryton.org/modules/sale_opportunity/file/0edc65ca5cd8/opportunity.py#l67517:03
pokoliandrespoliti: then you should create also 3 other table_queries, otherwise you will have the same problem17:03
andrespolitii don't think it's possible with sql, it's too complicated17:03
andrespolitii already tried17:03
andrespolitii think i'll try to disable the dialog in the client if the field is of type function17:03
pokoliandrespoliti: be sure to check that the function does not have a setter, otherwise it's doable to update a function field and it should trigger the save17:03
pokoliandrespoliti: what you are tryting to achieve is some kind of bussiness inteligence report?17:03
andrespolitiit's the sum of settlement amounts for each party, grouped by concept, and month and year17:03
cedkandrespoliti: use SQL17:03
pokoliandrespoliti: the sale_opportunity module is a good example on how to compute similar reporting, sharing same fields but diferent groupings18:03
cedkandrespoliti: indeed you just need to use SQL to get the lines you need and use Function field if you have complex computation18:03
-!- rpit(~rpit@p4FFB7E77.dip0.t-ipconnect.de) has joined #tryton19:03
-!- Telesight(~anthony@4dae0c97.ftth.telfortglasvezel.nl) has joined #tryton19:03
-!- zmijunkie(~Adium@i577B55D3.versanet.de) has joined #tryton21:03
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton22:03

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