IRC logs of #tryton for Thursday, 2017-07-20

chat.freenode.net #tryton log beginning Thu Jul 20 00:00:01 CEST 2017
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton01:38
-!- kstenger1(~karla@r167-56-254-146.dialup.adsl.anteldata.net.uy) has joined #tryton01:46
-!- notizblock(~notizbloc@nblock.org) has joined #tryton03:46
-!- thaneor(~ldlc6@r167-63-12-154.dialup.adsl.anteldata.net.uy) has joined #tryton07:28
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton07:37
-!- rpit(~rpit@aftr-37-24-146-138.unity-media.net) has joined #tryton07:53
-!- thaneor(~ldlc6@179.26.234.162) has joined #tryton08:07
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton08:47
-!- csotelo(~csotelo@2001:1388:49c7:c2bb:dbf:dc5c:b51a:b8d7) has joined #tryton10:31
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton10:44
csotelogood morning dear coders12:08
csoteloI have an issue relateed to an invoice method rewritten. I have rewritten https://hg.tryton.org/modules/account_invoice/file/3.8/invoice.py#l385 on https://bitbucket.org/tryton-pe/account_invoice_pe/src/d29c8d818ee009da8d726d781866468a36b9e7a0/invoice.py?at=default&fileviewer=file-view-default#invoice.py-59. It works well when i create an invoie, however, when an invoice is created from other module like http://hg.savannah.gnu.org12:11
csotelo/hgweb/health/file/c1c0a7204143/tryton/health_services/wizard/wizard_health_services.py#l60, my rewritten method is no called. Any suggest??12:11
cedkcsotelo: always call super()12:12
csotelocedk, I do https://bitbucket.org/tryton-pe/account_invoice_pe/src/d29c8d818ee009da8d726d781866468a36b9e7a0/invoice.py?at=default&fileviewer=file-view-default#invoice.py-6012:13
csoteloI have try to run the wizard from health, but the originl on_change_party is called instead my custom on_change_party12:15
csotelothat is my question, how to make my custom method been called instead the origin method12:16
pokolicsotelo: does the origin on_change_party call super?12:17
csotelowizrad calling on_change_party is http://hg.savannah.gnu.org/hgweb/health/file/c1c0a7204143/tryton/health_services/wizard/wizard_health_services.py#l15112:17
csotelopokoli, yes [https://bitbucket.org/tryton-pe/account_invoice_pe/src/d29c8d818ee009da8d726d781866468a36b9e7a0/invoice.py?at=default&fileviewer=file-view-default#invoice.py-60]12:18
pokolicsotelo: i mean the gnuhealth module12:18
csotelopokoli, when I create an invoice from the invoice form, then this method is called12:19
pokolicsotelo: on_change methods are not called on server side code, unless explicity written12:19
pokolicsotelo: an I do not see any on_change_party on the gnuhealth code12:19
cedkcsotelo: not in the first link you gave, on_change_type does not call super12:19
csotelopokoli, on no place on wizard is called, it is just activated  on the invoice create12:20
pokoliACTION does not understand12:20
csotelocedk, I will take off that method12:22
csoteloI just copy it from other incvoice localization, however on_change_type doesnt affect, I guess12:22
csotelosince I dont have document_type any more12:23
csoteloOh I noticed.. srry I was wrong. I was completely wrong12:23
csotelocedk, you are right, but it is on sequences12:24
csotelowhen the invoice have been created12:24
csoteloI am on on_change_party12:24
csotelopokoli, sorry, on http://hg.savannah.gnu.org/hgweb/health/file/c1c0a7204143/tryton/health_services/wizard/wizard_health_services.py#l39 is the gnu health wizard used to create invoices from health services12:25
csotelothis wizard writes invoices on http://hg.savannah.gnu.org/hgweb/health/file/c1c0a7204143/tryton/health_services/wizard/wizard_health_services.py#l15112:26
csoteloand onchange_party is called, but the original no my custom12:26
csoteloany suggest?12:32
cedkcsotelo: I do not see any on_change call in this wizard12:34
cedkcsotelo: indeed if you need to customize this method, I must say that it is not properly written to ease the task12:35
cedkcsotelo: it should be split, with a method to get the main Invoice instance, a method to fill the lines and a final method to store it12:35
cedkcsotelo: FYI: trytond never calls any on_change method magically, it must always be explicit12:36
csotelocedk, after talking here, I just noticed that you say about magically calls, since I have noticed that the on_change_party behavior habe been executed on lines http://hg.savannah.gnu.org/hgweb/health/file/c1c0a7204143/tryton/health_services/wizard/wizard_health_services.py#l111, then I was really guessing that on_change_party have been called12:37
csotelothen my question now, is could I call a method when I write data on this way: http://hg.savannah.gnu.org/hgweb/health/file/c1c0a7204143/tryton/health_services/wizard/wizard_health_services.py#l15112:38
csoteloInvoice.create(invoices)12:39
csotelosomething like Invoice.create(invoices).on_change_party() or something like that???12:39
cedkcsotelo: as I said this method is not using the best Tryton practice12:39
cedkcsotelo: to be able to call on_change method you need the instances12:40
cedkbut this wizard use a dictionary of values12:40
csoteloI understand12:40
csoteloand I agree12:40
cedkcsotelo: I guess the best is to propose a rewrite of it to GNUHealth12:41
cedkit should be a very common need to customize the invoice creation12:41
csoteloyes, and as you wrote, using instances in stead of dictionary could be great in order on make it easier to customize12:42
csotelocedk, just for asking about the bests practices... could be the wrizard on health written using dictiaries instead of instances for a perfonce criteria???13:01
csoteloperformance*13:01
cedkcsotelo: no, I guess it is for historical reason13:04
cedkcsotelo: ActiveRecord exists since 2.6 (5 years ago)13:05
csotelocedk, nice to know, I will propose it on health13:06
csotelothanks a lot13:07
-!- mariomop(~quassel@181.94.15.202) has joined #tryton13:14
-!- smarro(~sebastian@181.88.239.59) has joined #tryton13:34
-!- kobain(~kobain@190.7.62.242) has joined #tryton14:34
-!- kobain(~kobain@unaffiliated/kobain) has joined #tryton14:34
-!- kstenger(~karla@r186-55-71-9.dialup.adsl.anteldata.net.uy) has joined #tryton15:03
-!- csotelo_at_work(~csotelo@179.43.97.56) has joined #tryton15:17
-!- JosDzG(~Thunderbi@189.250.44.48) has joined #tryton16:54
-!- Telesight(~anthony@4dae0c97.ftth.telfortglasvezel.nl) has joined #tryton17:13
-!- kobain(~kobain@unaffiliated/kobain) has joined #tryton17:23
-!- andrespoliti(~andrespol@250-183-89-200.fibertel.com.ar) has joined #tryton17:41
andrespolitihi! I have a wizard that is called from an action of a model. Is there a way of obtaining the selected records from inside the wizard17:42
-!- JosDzG(~Thunderbi@189.250.44.48) has joined #tryton17:45
-!- smarro(~sebastian@cust-138-45-13-200.trynet.com.ar) has joined #tryton18:27
-!- smarro(~sebastian@181.88.239.59) has joined #tryton20:10
-!- semarie_(~semarie@unaffiliated/semarie) has joined #tryton22:01
-!- JosDzG(~Thunderbi@189.250.44.48) has joined #tryton22:11
-!- apostatize(~visavis@unaffiliated/apostatize) has joined #tryton22:28
-!- Telesight(~anthony@4dae0c97.ftth.telfortglasvezel.nl) has joined #tryton23:07
-!- JosDzG(~Thunderbi@189.250.44.48) has joined #tryton23:33
-!- kstenger(~karla@r186-55-71-9.dialup.adsl.anteldata.net.uy) has joined #tryton23:38
-!- kobain(~kobain@unaffiliated/kobain) has joined #tryton23:48

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!