irc.libera.chat #tryton log beginning Fri Nov 4 12:00:01 AM CET 2022 | ||
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 00:04 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 00:04 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 06:31 | |
LordVan | hi. I have a question: I was considering making the shipment out lines editable in the tree view. but is it possible to do that per column too? | 07:10 |
---|---|---|
LordVan | the way I understand https://docs.tryton.org/projects/server/en/latest/topics/views/index.html editable="1" on the tree tag would make everything editable? | 07:11 |
LordVan | the only way I could imagnine this work would be <tree editable="1" ..> <field readonly="1" name="bla" /> <field name="foo" /> </tree> | 07:12 |
LordVan | is that the correct way to do this? | 07:12 |
-!- mrichez(~Maxime@mail.saluc.com) has joined #tryton | 07:39 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 07:58 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 07:58 | |
-!- htgoebel(~hartmut@p200300d5df122d008f20b09c4eeec113.dip0.t-ipconnect.de) has joined #tryton | 08:08 | |
-!- htgoebel(~hartmut@p200300d5df122d008f20b09c4eeec113.dip0.t-ipconnect.de) has left #tryton | 08:08 | |
-!- rpit(~rpit@p200300c88f3b7e00ca0d9a1455ec95df.dip0.t-ipconnect.de) has joined #tryton | 08:13 | |
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton | 08:28 | |
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton | 09:01 | |
mrichez | hi, i need to hide a field on move treeview in Supplier Shipment Form view. From yesterday discuss on irc, i could use view_attributes to hide field with tree_invisible depending on context. | 09:32 |
mrichez | So where defining context on supplier_shipment model ? setup method ? | 09:33 |
pokoli | LordVan: once the view is editable any editalbe field will be writtable | 09:51 |
pokoli | mrichez: the context can be defined on the action window | 09:52 |
LordVan | pokoli, so i cannot use the field tag to make it readonly in the tree view? | 09:52 |
pokoli | LordVan: yes you can | 09:54 |
mrichez | pokoli: thanks! | 09:54 |
pokoli | LordVan: but is better to set readonly on models so it is updated to any views | 09:54 |
LordVan | well i want it updateable in th detail view | 09:55 |
LordVan | just not in the treeview to avoid some user errors /accidents ^^ | 09:55 |
pokoli | LordVan: there is no concept of updatable. If the user is allowed to create on the one2many it will be able to create new records on the editable view | 09:56 |
LordVan | hm | 09:56 |
LordVan | ok I might leave it without doing that then | 09:57 |
LordVan | for the time being | 09:57 |
LordVan | thanks | 09:59 |
LordVan | one thing though .. i thought there was a "creatable" attribute on tree to decide if records can be created . no? | 10:00 |
mrichez | pokoli: should a context_model always having a form ? i just need to define a boolean field to true | 10:10 |
pokoli | mrichez: not context_model but just context field on action window: https://hg.tryton.org/modules/account_invoice/file/06b657529465/invoice.xml#l48 | 10:22 |
pokoli | it will be great if the action documentation is improved to explain such feature | 10:22 |
pokoli | LordVan: yes, it was added on 6.4: https://docs.tryton.org/projects/server/en/latest/releases.html#version-6-4-0-2022-05-02 | 10:23 |
pokoli | LordVan: https://docs.tryton.org/projects/server/en/latest/topics/views/index.html#id2 | 10:23 |
mrichez | pokoli: ok :-) | 10:24 |
mrichez | pokoli: did an eval take care of context values ? | 10:59 |
mrichez | pokoli: i define: <field name="context" eval="{'shipment_in': True}" pyson="1"/> | 11:00 |
mrichez | pokoli: and my view_attributes is : return super().view_attributes() + [('/tree/button[@name="update_quantity_wizard"]', 'tree_invisible', Eval('shipment_in', False)),] | 11:01 |
mrichez | pokoli: but it seems not working | 11:01 |
cedk | mrichez: it does but as 'context' | 11:56 |
mrichez | cedk: so what's wrong with my example ? | 11:57 |
mrichez | cedk: so i should doing this: Get(Eval('context', {}), 'shipment_in', False)) | 12:01 |
cedk | mrichez: normally yes | 12:29 |
mrichez | cedk: hum... not working... i'll explain my problem on discuss... | 12:36 |
cedk | mrichez: indeed looking in tryton/tryton/gui/window/view_form/view/list.py the screen context is directly the PYSONDecoder so it is directly the context that is evaluated | 13:11 |
-!- springwurm(~springwur@2a01:76c0:302:ab00::39b) has joined #tryton | 13:11 | |
mrichez | cedk: i put the problem on discuss: https://discuss.tryton.org/t/hiding-column-in-treeview-on-specific-model/5672/1 | 13:16 |
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton | 13:16 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 13:21 | |
-!- rmu(~robert@cpe90-146-68-21.liwest.at) has joined #tryton | 15:39 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!