chat.freenode.net #tryton log beginning Thu Jul 20 00:00:01 CEST 2017 | ||
2017-07-20 01:38 -!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | ||
2017-07-20 01:46 -!- kstenger1(~karla@r167-56-254-146.dialup.adsl.anteldata.net.uy) has joined #tryton | ||
2017-07-20 03:46 -!- notizblock(~notizbloc@nblock.org) has joined #tryton | ||
2017-07-20 07:28 -!- thaneor(~ldlc6@r167-63-12-154.dialup.adsl.anteldata.net.uy) has joined #tryton | ||
2017-07-20 07:37 -!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton | ||
2017-07-20 07:53 -!- rpit(~rpit@aftr-37-24-146-138.unity-media.net) has joined #tryton | ||
2017-07-20 08:07 -!- thaneor(~ldlc6@179.26.234.162) has joined #tryton | ||
2017-07-20 08:47 -!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | ||
2017-07-20 10:31 -!- csotelo(~csotelo@2001:1388:49c7:c2bb:dbf:dc5c:b51a:b8d7) has joined #tryton | ||
2017-07-20 10:44 -!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton | ||
2017-07-20 12:08 <csotelo> good morning dear coders | ||
2017-07-20 12:11 <csotelo> I 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.org | ||
2017-07-20 12:11 <csotelo> /hgweb/health/file/c1c0a7204143/tryton/health_services/wizard/wizard_health_services.py#l60, my rewritten method is no called. Any suggest?? | ||
2017-07-20 12:12 <cedk> csotelo: always call super() | ||
2017-07-20 12:13 <csotelo> cedk, I do https://bitbucket.org/tryton-pe/account_invoice_pe/src/d29c8d818ee009da8d726d781866468a36b9e7a0/invoice.py?at=default&fileviewer=file-view-default#invoice.py-60 | ||
2017-07-20 12:15 <csotelo> I have try to run the wizard from health, but the originl on_change_party is called instead my custom on_change_party | ||
2017-07-20 12:16 <csotelo> that is my question, how to make my custom method been called instead the origin method | ||
2017-07-20 12:17 <pokoli> csotelo: does the origin on_change_party call super? | ||
2017-07-20 12:17 <csotelo> wizrad calling on_change_party is http://hg.savannah.gnu.org/hgweb/health/file/c1c0a7204143/tryton/health_services/wizard/wizard_health_services.py#l151 | ||
2017-07-20 12:18 <csotelo> pokoli, yes [https://bitbucket.org/tryton-pe/account_invoice_pe/src/d29c8d818ee009da8d726d781866468a36b9e7a0/invoice.py?at=default&fileviewer=file-view-default#invoice.py-60] | ||
2017-07-20 12:18 <pokoli> csotelo: i mean the gnuhealth module | ||
2017-07-20 12:19 <csotelo> pokoli, when I create an invoice from the invoice form, then this method is called | ||
2017-07-20 12:19 <pokoli> csotelo: on_change methods are not called on server side code, unless explicity written | ||
2017-07-20 12:19 <pokoli> csotelo: an I do not see any on_change_party on the gnuhealth code | ||
2017-07-20 12:19 <cedk> csotelo: not in the first link you gave, on_change_type does not call super | ||
2017-07-20 12:20 <csotelo> pokoli, on no place on wizard is called, it is just activated on the invoice create | ||
2017-07-20 12:20 <pokoli> ACTION does not understand | ||
2017-07-20 12:22 <csotelo> cedk, I will take off that method | ||
2017-07-20 12:22 <csotelo> I just copy it from other incvoice localization, however on_change_type doesnt affect, I guess | ||
2017-07-20 12:23 <csotelo> since I dont have document_type any more | ||
2017-07-20 12:23 <csotelo> Oh I noticed.. srry I was wrong. I was completely wrong | ||
2017-07-20 12:24 <csotelo> cedk, you are right, but it is on sequences | ||
2017-07-20 12:24 <csotelo> when the invoice have been created | ||
2017-07-20 12:24 <csotelo> I am on on_change_party | ||
2017-07-20 12:25 <csotelo> pokoli, 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 services | ||
2017-07-20 12:26 <csotelo> this wizard writes invoices on http://hg.savannah.gnu.org/hgweb/health/file/c1c0a7204143/tryton/health_services/wizard/wizard_health_services.py#l151 | ||
2017-07-20 12:26 <csotelo> and onchange_party is called, but the original no my custom | ||
2017-07-20 12:32 <csotelo> any suggest? | ||
2017-07-20 12:34 <cedk> csotelo: I do not see any on_change call in this wizard | ||
2017-07-20 12:35 <cedk> csotelo: indeed if you need to customize this method, I must say that it is not properly written to ease the task | ||
2017-07-20 12:35 <cedk> csotelo: 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 it | ||
2017-07-20 12:36 <cedk> csotelo: FYI: trytond never calls any on_change method magically, it must always be explicit | ||
2017-07-20 12:37 <csotelo> cedk, 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 called | ||
2017-07-20 12:38 <csotelo> then 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#l151 | ||
2017-07-20 12:39 <csotelo> Invoice.create(invoices) | ||
2017-07-20 12:39 <csotelo> something like Invoice.create(invoices).on_change_party() or something like that??? | ||
2017-07-20 12:39 <cedk> csotelo: as I said this method is not using the best Tryton practice | ||
2017-07-20 12:40 <cedk> csotelo: to be able to call on_change method you need the instances | ||
2017-07-20 12:40 <cedk> but this wizard use a dictionary of values | ||
2017-07-20 12:40 <csotelo> I understand | ||
2017-07-20 12:40 <csotelo> and I agree | ||
2017-07-20 12:41 <cedk> csotelo: I guess the best is to propose a rewrite of it to GNUHealth | ||
2017-07-20 12:41 <cedk> it should be a very common need to customize the invoice creation | ||
2017-07-20 12:42 <csotelo> yes, and as you wrote, using instances in stead of dictionary could be great in order on make it easier to customize | ||
2017-07-20 13:01 <csotelo> cedk, just for asking about the bests practices... could be the wrizard on health written using dictiaries instead of instances for a perfonce criteria??? | ||
2017-07-20 13:01 <csotelo> performance* | ||
2017-07-20 13:04 <cedk> csotelo: no, I guess it is for historical reason | ||
2017-07-20 13:05 <cedk> csotelo: ActiveRecord exists since 2.6 (5 years ago) | ||
2017-07-20 13:06 <csotelo> cedk, nice to know, I will propose it on health | ||
2017-07-20 13:07 <csotelo> thanks a lot | ||
2017-07-20 13:14 -!- mariomop(~quassel@181.94.15.202) has joined #tryton | ||
2017-07-20 13:34 -!- smarro(~sebastian@181.88.239.59) has joined #tryton | ||
2017-07-20 14:34 -!- kobain(~kobain@190.7.62.242) has joined #tryton | ||
2017-07-20 14:34 -!- kobain(~kobain@unaffiliated/kobain) has joined #tryton | ||
2017-07-20 15:03 -!- kstenger(~karla@r186-55-71-9.dialup.adsl.anteldata.net.uy) has joined #tryton | ||
2017-07-20 15:17 -!- csotelo_at_work(~csotelo@179.43.97.56) has joined #tryton | ||
2017-07-20 16:54 -!- JosDzG(~Thunderbi@189.250.44.48) has joined #tryton | ||
2017-07-20 17:13 -!- Telesight(~anthony@4dae0c97.ftth.telfortglasvezel.nl) has joined #tryton | ||
2017-07-20 17:23 -!- kobain(~kobain@unaffiliated/kobain) has joined #tryton | ||
2017-07-20 17:41 -!- andrespoliti(~andrespol@250-183-89-200.fibertel.com.ar) has joined #tryton | ||
2017-07-20 17:42 <andrespoliti> hi! 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 wizard | ||
2017-07-20 17:45 -!- JosDzG(~Thunderbi@189.250.44.48) has joined #tryton | ||
2017-07-20 18:27 -!- smarro(~sebastian@cust-138-45-13-200.trynet.com.ar) has joined #tryton | ||
2017-07-20 20:10 -!- smarro(~sebastian@181.88.239.59) has joined #tryton | ||
2017-07-20 22:01 -!- semarie_(~semarie@unaffiliated/semarie) has joined #tryton | ||
2017-07-20 22:11 -!- JosDzG(~Thunderbi@189.250.44.48) has joined #tryton | ||
2017-07-20 22:28 -!- apostatize(~visavis@unaffiliated/apostatize) has joined #tryton | ||
2017-07-20 23:07 -!- Telesight(~anthony@4dae0c97.ftth.telfortglasvezel.nl) has joined #tryton | ||
2017-07-20 23:33 -!- JosDzG(~Thunderbi@189.250.44.48) has joined #tryton | ||
2017-07-20 23:38 -!- kstenger(~karla@r186-55-71-9.dialup.adsl.anteldata.net.uy) has joined #tryton | ||
2017-07-20 23:48 -!- kobain(~kobain@unaffiliated/kobain) has joined #tryton |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!