chat.freenode.net #tryton log beginning Thu Nov 15 00:00:01 CET 2018 | ||
-!- csotelo(~csotelo@190.40.232.60) has joined #tryton | 23:46 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 00:33 | |
-!- thaneor(~lenovo3@r179-24-154-114.dialup.adsl.anteldata.net.uy) has joined #tryton | 00:40 | |
-!- Seburath__(bf649377@gateway/web/freenode/ip.191.100.147.119) has joined #tryton | 01:52 | |
-!- lucascastro(~lucascast@177-185-139-186.isotelco.net.br) has joined #tryton | 02:32 | |
-!- yangoon1(~mathiasb@i59F4B033.versanet.de) has joined #tryton | 04:00 | |
-!- mono(~mono@181.137.134.104) has joined #tryton | 04:45 | |
-!- mono2(~mono@181.137.134.104) has joined #tryton | 04:47 | |
-!- mono(~mono@181.137.134.104) has joined #tryton | 04:48 | |
-!- kwmiebach(sid16855@gateway/web/irccloud.com/x-sxfydmckejopzzal) has joined #tryton | 06:00 | |
-!- JanGB(~jan@dslb-088-075-074-201.088.075.pools.vodafone-ip.de) has joined #tryton | 06:22 | |
-!- tafelgeschirr(~tafelgesc@5.104.149.54) has joined #tryton | 06:31 | |
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton | 07:45 | |
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton | 07:51 | |
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton | 07:53 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 07:53 | |
-!- rpit(~rpit@p4FD19D28.dip0.t-ipconnect.de) has joined #tryton | 08:07 | |
-!- nicoe(~nicoe@2a02:578:858c:500:7e2a:31ff:fe5e:b25d) has joined #tryton | 08:10 | |
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton | 09:19 | |
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton | 09:50 | |
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton | 11:28 | |
-!- mono(~mono@181.137.134.104) has joined #tryton | 12:27 | |
-!- thaneor1(~lenovo3@r179-25-64-11.dialup.adsl.anteldata.net.uy) has joined #tryton | 12:42 | |
-!- tafelgeschirr(~tafelgesc@5.104.149.54) has joined #tryton | 13:08 | |
-!- tafelgeschirr_(~tafelgesc@5.104.149.54) has joined #tryton | 13:09 | |
vmora | hi cedk, when a member function of my Model is called, I used to get the record id with `str(self.id)` but this doesn't work anymore, could you plz tell me how to access the id of the record on wich the function is called ? | 13:26 |
---|---|---|
pokoli | vmora: the id is avaialbe on self.id for instance methods | 13:41 |
vmora | pokoli, thanks, but print(self.id) returns <trytond.model.fields.integer.Integer object at 0x7eff4a27d748> and not the value of the id | 13:48 |
pokoli | vmora: then you are in a classmethod and self is poiting to the class instead of the record | 13:49 |
pokoli | vmora: classmethod normally have a second argument which is a list of records | 13:49 |
vmora | it does, but the list is empty | 13:49 |
pokoli | vmora: on which method you are? | 13:50 |
pokoli | vmora: is the method decorated with Workflow.transition ? | 13:50 |
vmora | pokoli no decorator on the method | 13:51 |
pokoli | vmora: so how you call it? | 13:51 |
vmora | fields.Function | 13:52 |
vmora | I think | 13:52 |
vmora | no, actually I have a @classmethod @ModelView.button function... | 13:58 |
pokoli | vmora so when you click on the button in the user interface the client will pass the list of records to the server | 14:08 |
pokoli | vmora: on which view do you have the button? | 14:09 |
vmora | pokoli form view | 14:10 |
pokoli | vmora: so it should pass the selected record | 14:13 |
pokoli | vmora: are you sure it's not decorated with Worfklow.transition? because this decorator filters the records, only passing the ones that have a valid transition | 14:14 |
pokoli | vmora: posting a snippet of your source code using some paste service (i.e: pastebin.com) will allow us to provide better advices | 14:14 |
vmora | no decorator except for the ModelView.button | 14:17 |
vmora | pokoli https://pastebin.com/9sBaasw7 | 14:18 |
vmora | I don't get the call cls.get_map(record, 'map') | 14:19 |
vmora | if I remove 'map', then the number of arguments if wrong for the call to get_map | 14:20 |
vmora | pokoli: got it: get_map should be @classmethod | 14:22 |
pokoli | vmora: or you should call it as: record.get_map('map') | 14:23 |
vmora | pokoli, got it now, my base class _get_image function was a @classmethod, it should'nt have | 14:37 |
vmora | pokoli thanks a lot | 14:37 |
pokoli | vmora: you're welcome! | 14:42 |
-!- mariomop(~quassel@186.153.190.249) has joined #tryton | 14:58 | |
-!- csotelo(~csotelo@181.64.192.215) has joined #tryton | 15:35 | |
-!- mono(~mono@201.184.144.165) has joined #tryton | 15:53 | |
-!- csotelo_(~csotelo@190.232.110.6) has joined #tryton | 17:08 | |
-!- yangoon(~mathiasb@i59F4B033.versanet.de) has joined #tryton | 17:37 | |
-!- mono2(~mono@201.184.144.165) has joined #tryton | 18:17 | |
-!- intart(b334b6f5@gateway/web/freenode/ip.179.52.182.245) has joined #tryton | 18:31 | |
-!- mono(~mono@201.184.144.165) has joined #tryton | 19:04 | |
-!- mono(~mono@201.184.144.165) has joined #tryton | 19:11 | |
-!- mono2(~mono@190.7.112.31) has joined #tryton | 19:18 | |
-!- nicoe(~nicoe@2a02:578:858c:500:7e2a:31ff:fe5e:b25d) has joined #tryton | 19:46 | |
-!- rpit(~rpit@p200300C88F34F900FFAD08C9FBE63E32.dip0.t-ipconnect.de) has joined #tryton | 20:08 | |
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton | 21:01 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!