IRC logs of #tryton for Wednesday, 2018-03-28 #tryton log beginning Wed Mar 28 00:00:01 CEST 2018
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton01:03
-!- cdchapman( has joined #tryton03:03
-!- mono(~mono@ has joined #tryton03:03
-!- kstenger( has joined #tryton03:03
-!- zmijunkie1( has joined #tryton04:03
-!- yangoon1( has joined #tryton04:03
-!- mono(~mono@ has joined #tryton05:03
-!- udono1( has joined #tryton06:03
-!- _2cadz( has joined #tryton07:03
-!- hedererjs( has joined #tryton08:03
-!- JanGB( has joined #tryton08:03
-!- mrichez( has joined #tryton09:03
-!- Timitos( has joined #tryton09:03
-!- zmijunkie( has joined #tryton09:03
-!- zmijunkie( has joined #tryton09:03
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton09:03
-!- rpit( has joined #tryton10:03
-!- rpit( has joined #tryton10:03
-!- nicoe( has joined #tryton10:03
-!- JanGB( has joined #tryton10:03
-!- _2cadz_(~2cadz@ has joined #tryton12:03
-!- _2cadz( has joined #tryton12:03
-!- rpit( has joined #tryton12:03
-!- rpit( has joined #tryton12:03
-!- rpit( has joined #tryton13:03
-!- mariomop(~quassel@ has joined #tryton13:03
-!- rpit( has joined #tryton14:03
-!- _2cadz( has joined #tryton14:03
-!- rpit( has joined #tryton14:03
-!- rpit( has joined #tryton14:03
-!- hedererjs( has joined #tryton14:03
-!- kstenger1( has joined #tryton15:03
-!- csotelo(~csotelo@ has joined #tryton15:03
-!- rpit( has joined #tryton16:03
-!- _2cadz_( has joined #tryton16:03
-!- andrespoliti( 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 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:
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:
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( has joined #tryton19:03
-!- Telesight( has joined #tryton19:03
-!- zmijunkie( has joined #tryton21:03
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton22:03

Generated by 2.16.0 by Marius Gedminas - find it at!