chat.freenode.net #tryton log beginning Fri Jun 11 12:00:01 AM CEST 2021 | ||
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 23:02 | |
-!- lucascastro(~lucascast@177-185-133-236.dynamic.isotelco.net.br) has joined #tryton | 23:53 | |
-!- buxy(~rhertzog@helios.freexian.com) has joined #tryton | 02:21 | |
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton | 04:49 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 05:08 | |
-!- LordVan_(~LordVan@gentoo/developer/LordVan) has joined #tryton | 05:27 | |
-!- Timitos(~kpreisler@2001:a61:4ac:5b01:762b:62ff:fe84:ed7e) has joined #tryton | 05:35 | |
-!- irclog(~irclog@2001:41d0:8:67bb::1) has joined #tryton | 05:40 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 06:28 | |
-!- pokoli(~pokoli@unaffiliated/pokoli) has joined #tryton | 06:46 | |
-!- ludo2(~Thunderbi@221.114.141.88.rev.sfr.net) has joined #tryton | 06:55 | |
-!- ludo3(~Thunderbi@2001:912:1480:380::1) has joined #tryton | 07:00 | |
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton | 07:03 | |
LordVan_ | cedk, i got a question about product kit code customization .. you got a few minutes? | 07:58 |
---|---|---|
LordVan_ | I want to add some customization to the code that adds the components as (sale) lines but am unsure how this whole mixin stuff works and how i'd add it | 08:20 |
pokoli | LordVan_: just ask the questions here an somebody will answer if available | 08:22 |
LordVan_ | i just did haha | 08:22 |
LordVan_ | i just want to hook into the code where the components get added as lines and i am really unsure as to how to accomplish that | 08:22 |
pokoli | LordVan_: the module already creates sale lines when quoting | 08:23 |
LordVan_ | pokoli, i know that | 08:23 |
LordVan_ | but i need extra logic | 08:23 |
LordVan_ | to fill in a custom field of mine based on the contents of that same custom field on the "parent" part | 08:23 |
pokoli | LordVan_: https://hg.tryton.org/modules/product_kit/file/d0d4ca3d552a/common.py#l184 | 08:24 |
LordVan_ | yes | 08:24 |
LordVan_ | but that is a mixin class returned from a method | 08:24 |
LordVan_ | maybe this is more a python question than a tryton one | 08:24 |
LordVan_ | but how would I "replace" or extend this | 08:24 |
LordVan_ | or coul di just make my own get_component on SaleLine | 08:25 |
LordVan_ | and it would use that? | 08:25 |
pokoli | LordVan_: if you want it for sales, you just extend the method on the sale class | 08:27 |
LordVan_ | ok so that would work | 08:28 |
LordVan_ | cool | 08:28 |
LordVan_ | i was going to try that but was real unsure if that would work nor not | 08:28 |
LordVan_ | ^^ | 08:28 |
pokoli | LordVan_: if you want for all the Mixin instances you can use register_mixin: https://docs.tryton.org/projects/server/en/latest/ref/pool.html?highlight=register_mixin#trytond.pool.Pool.register_mixin | 08:28 |
LordVan_ | nah only need it for sales | 08:28 |
LordVan_ | i will read up about mixins at some point though .. seems an interesting concept (That i honestly do not fully understand yet) | 08:28 |
pokoli | LordVan_: it's an easy way to share code between several models | 08:29 |
LordVan_ | yeah but i do not yet know how the implementation works,.. | 08:30 |
LordVan_ | pokoli, so I would just add a get_component method there https://github.com/LordVan/tryton-modules/blob/1f68535c148b23c3130a1ae7605f2dd1b1597d90/rm_extra_data/sale.py#L141 | 08:31 |
LordVan_ | would I need some decorators though? like fields,. ? | 08:31 |
LordVan_ | cuz i think i'D need @fields.depends('folder_no') since that is the field iw ant to copy | 08:35 |
LordVan_ | though I am not sure if I really need it? | 08:36 |
pokoli | LordVan_: sorry but I'm lost | 08:43 |
LordVan_ | I was just wondering if i needed to add @fileds.depends('<my custom field') before def get_component | 08:45 |
LordVan_ | or if in this case i do not need it | 08:45 |
-!- thaneor(~acer8@r167-61-24-62.dialup.adsl.anteldata.net.uy) has joined #tryton | 08:46 | |
-!- thaneor1(~ldlc6@r167-61-24-62.dialup.adsl.anteldata.net.uy) has joined #tryton | 08:46 | |
pokoli | LordVan_: depends is just used for on_change | 08:51 |
LordVan_ | ok then i don'T need it. | 08:51 |
LordVan_ | thanks | 08:51 |
LordVan_ | i really need to look into how the decorators,.. are used at some point | 08:52 |
LordVan_ | [when i have time] | 08:52 |
-!- mariomop(~quassel@181.29.189.235) has joined #tryton | 10:51 | |
-!- LordVan_(~LordVan@gentoo/developer/LordVan) has joined #tryton | 11:03 | |
LordVan_ | btw | 11:42 |
LordVan_ | with latest releases I noticed that when a record that is opened is duplicated the client does not swap to the new record anymore as it used to. Is there a way to change this back as I found it super useful? | 11:44 |
pokoli | LordVan_: this is a bug that is already fixed, it's just missing the backport | 11:44 |
LordVan_ | [looking through the changelogs atm but i don'T know what exactly to look for so ^^ | 11:44 |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 12:33 | |
-!- springwurm(~springwur@5.104.149.54) has joined #tryton | 12:57 | |
-!- thaneor2(~ldlc6@r167-61-85-203.dialup.adsl.anteldata.net.uy) has joined #tryton | 20:49 | |
-!- thaneor3(~acer8@r167-61-85-203.dialup.adsl.anteldata.net.uy) has joined #tryton | 20:50 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 21:58 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!