chat.freenode.net #tryton log beginning Wed Mar 28 00:00:01 CEST 2018 | ||
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 23:26 | |
-!- cdchapman(~perturbed@c-67-169-243-133.hsd1.ut.comcast.net) has joined #tryton | 01:10 | |
-!- mono(~mono@201.184.144.165) has joined #tryton | 01:16 | |
-!- kstenger(~karla@r186-55-75-95.dialup.adsl.anteldata.net.uy) has joined #tryton | 01:24 | |
-!- zmijunkie1(~Adium@200116b80a2c1d009c9092826cdbdbb7.dip.versatel-1u1.de) has joined #tryton | 02:04 | |
-!- yangoon1(~mathiasb@i59F4A741.versanet.de) has joined #tryton | 02:36 | |
-!- mono(~mono@201.184.144.165) has joined #tryton | 03:23 | |
-!- udono1(~udono@075-057-210-188.ip-addr.inexio.net) has joined #tryton | 04:19 | |
-!- _2cadz(~2cadz@212-198-245-154.rev.numericable.fr) has joined #tryton | 05:46 | |
-!- hedererjs(~hedererjs@dig50-1-78-222-206-45.fbx.proxad.net) has joined #tryton | 06:26 | |
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton | 06:53 | |
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton | 07:08 | |
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton | 07:13 | |
-!- zmijunkie(~Adium@x2f7f12a.dyn.telefonica.de) has joined #tryton | 07:21 | |
-!- zmijunkie(~Adium@b2b-78-94-52-226.unitymedia.biz) has joined #tryton | 07:47 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 07:52 | |
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton | 08:14 | |
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton | 08:17 | |
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton | 08:19 | |
-!- JanGB(~jan@nat3.hmt-leipzig.de) has joined #tryton | 08:52 | |
-!- _2cadz_(~2cadz@80.215.72.209) has joined #tryton | 10:10 | |
-!- _2cadz(~2cadz@212-198-245-154.rev.numericable.fr) has joined #tryton | 10:25 | |
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton | 10:45 | |
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton | 10:47 | |
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton | 11:02 | |
-!- mariomop(~quassel@181.91.17.234) has joined #tryton | 11:15 | |
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton | 12:12 | |
-!- _2cadz(~2cadz@212-198-245-154.rev.numericable.fr) has joined #tryton | 12:30 | |
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton | 12:32 | |
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton | 12:46 | |
-!- hedererjs(~hedererjs@dig50-1-78-222-206-45.fbx.proxad.net) has joined #tryton | 12:48 | |
-!- kstenger1(~karla@r186-49-252-111.dialup.adsl.anteldata.net.uy) has joined #tryton | 13:26 | |
-!- csotelo(~csotelo@179.43.97.56) has joined #tryton | 13:41 | |
-!- rpit(~rpit@ip-109-40-2-115.web.vodafone.de) has joined #tryton | 14:20 | |
-!- _2cadz_(~2cadz@212-198-245-154.rev.numericable.fr) has joined #tryton | 14:23 | |
-!- andrespoliti(~andrespol@250-183-89-200.fibertel.com.ar) has joined #tryton | 14:39 | |
andrespoliti | hi, 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? | 14:41 |
---|---|---|
andrespoliti | my 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 view | 14:41 |
pokoli | andrespoliti: your function probably does not return the correct values and the client thinks that the user has changed it | 14:43 |
pokoli | andrespoliti: one reason can be that you are returning more digits than the ones expected by the client (defined in field definition) | 14:44 |
andrespoliti | no, it's not it, i fill the one2many with empty lines and the dialog still pops up | 14:55 |
andrespoliti | empty dictionaries | 14:56 |
andrespoliti | i think the dialog pops up because the model detects that the function one2many changed | 14:57 |
pokoli | andrespoliti: I think what you are trying to achieve is: https://bugs.tryton.org/issue3764 | 14:59 |
andrespoliti | pokoli: 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 record | 14:59 |
andrespoliti | pokoli: yes, i want to give the one2many a list of dicts of computed data | 15:05 |
andrespoliti | is there any way around the save dialog? | 15:16 |
andrespoliti | would replacing the on_change with a getter work? | 15:19 |
pokoli | andrespoliti: the problem is that the API is based on ids, so you should always give the same id to the generated records | 15:32 |
pokoli | andrespoliti: using negative ids will not work as the client will consider them new records | 15:33 |
pokoli | andrespoliti: I remember making it work, but it required some hack on the target model | 15:33 |
andrespoliti | the target model is a modelView, i created it specially for this case | 15:33 |
pokoli | andrespoliti: 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 values | 15:34 |
andrespoliti | mm i don't think so, it can have any number of records | 15:34 |
pokoli | andrespoliti: could you explain what are you calculating? | 15:41 |
andrespoliti | for a party, i calculate the total amounts of vouchers and settlements, grouped by year and month | 15:42 |
andrespoliti | but inside each record, there are other calculations that are also grouped | 15:43 |
pokoli | andrespoliti: the first sentence sounds as calculable in a sql query, so better if you can use a ModelSQL wiht table_query | 15:44 |
andrespoliti | yes, but it has multiple levels | 15:45 |
pokoli | andrespoliti: by levels you mean that you have a tree? | 15:45 |
andrespoliti | the target model also has 3 other function one2many's | 15:45 |
pokoli | andrespoliti: here is an example on how to calculate a resum per month, year: http://hg.tryton.org/modules/sale_opportunity/file/0edc65ca5cd8/opportunity.py#l675 | 15:46 |
pokoli | andrespoliti: then you should create also 3 other table_queries, otherwise you will have the same problem | 15:47 |
andrespoliti | i don't think it's possible with sql, it's too complicated | 15:51 |
andrespoliti | i already tried | 15:52 |
andrespoliti | i think i'll try to disable the dialog in the client if the field is of type function | 15:52 |
pokoli | andrespoliti: 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 save | 15:54 |
pokoli | andrespoliti: what you are tryting to achieve is some kind of bussiness inteligence report? | 15:54 |
andrespoliti | it's the sum of settlement amounts for each party, grouped by concept, and month and year | 15:58 |
cedk | andrespoliti: use SQL | 15:59 |
pokoli | andrespoliti: the sale_opportunity module is a good example on how to compute similar reporting, sharing same fields but diferent groupings | 16:01 |
cedk | andrespoliti: indeed you just need to use SQL to get the lines you need and use Function field if you have complex computation | 16:04 |
-!- rpit(~rpit@p4FFB7E77.dip0.t-ipconnect.de) has joined #tryton | 17:27 | |
-!- Telesight(~anthony@4dae0c97.ftth.telfortglasvezel.nl) has joined #tryton | 17:28 | |
-!- zmijunkie(~Adium@i577B55D3.versanet.de) has joined #tryton | 19:50 | |
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton | 20:00 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!