IRC logs of #tryton for Friday, 2021-06-11

chat.freenode.net #tryton log beginning Fri Jun 11 12:00:01 AM CEST 2021
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton23:02
-!- lucascastro(~lucascast@177-185-133-236.dynamic.isotelco.net.br) has joined #tryton23:53
-!- buxy(~rhertzog@helios.freexian.com) has joined #tryton02:21
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton04:49
-!- springwurm(~springwur@5.104.149.54) has joined #tryton05:08
-!- LordVan_(~LordVan@gentoo/developer/LordVan) has joined #tryton05:27
-!- Timitos(~kpreisler@2001:a61:4ac:5b01:762b:62ff:fe84:ed7e) has joined #tryton05:35
-!- irclog(~irclog@2001:41d0:8:67bb::1) has joined #tryton05:40
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton06:28
-!- pokoli(~pokoli@unaffiliated/pokoli) has joined #tryton06:46
-!- ludo2(~Thunderbi@221.114.141.88.rev.sfr.net) has joined #tryton06:55
-!- ludo3(~Thunderbi@2001:912:1480:380::1) has joined #tryton07:00
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton07: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 it08:20
pokoliLordVan_: just ask the questions here an somebody will answer if available08:22
LordVan_i just did haha08: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 that08:22
pokoliLordVan_: the module already creates sale lines when quoting08:23
LordVan_pokoli, i know that08:23
LordVan_but i need extra logic08:23
LordVan_to fill in a custom field of mine based on the contents of that same custom field on the "parent" part08:23
pokoliLordVan_: https://hg.tryton.org/modules/product_kit/file/d0d4ca3d552a/common.py#l18408:24
LordVan_yes08:24
LordVan_but that is a mixin class returned from a method08:24
LordVan_maybe this is more a python question than a tryton one08:24
LordVan_but how would I "replace" or extend this08:24
LordVan_or coul di just make my own get_component on SaleLine08:25
LordVan_and it would use that?08:25
pokoliLordVan_: if you want it for sales, you just extend the method on the sale class08:27
LordVan_ok so that would work08:28
LordVan_cool08:28
LordVan_i was going to try that but was real unsure if that would work nor not08:28
LordVan_^^08:28
pokoliLordVan_: 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_mixin08:28
LordVan_nah only need it for sales08: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
pokoliLordVan_: it's an easy way to share code between several models08: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#L14108: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 copy08:35
LordVan_though I am not sure if I really need it?08:36
pokoliLordVan_: sorry but I'm lost08:43
LordVan_I was just wondering if i needed to add @fileds.depends('<my custom field') before def get_component08:45
LordVan_or if in this case i do not need it08:45
-!- thaneor(~acer8@r167-61-24-62.dialup.adsl.anteldata.net.uy) has joined #tryton08:46
-!- thaneor1(~ldlc6@r167-61-24-62.dialup.adsl.anteldata.net.uy) has joined #tryton08:46
pokoliLordVan_: depends is just used for on_change08:51
LordVan_ok then i don'T need it.08:51
LordVan_thanks08:51
LordVan_i really need to look into how the decorators,.. are used at some point08:52
LordVan_[when i have time]08:52
-!- mariomop(~quassel@181.29.189.235) has joined #tryton10:51
-!- LordVan_(~LordVan@gentoo/developer/LordVan) has joined #tryton11:03
LordVan_btw11: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
pokoliLordVan_: this is a bug that is already fixed, it's just missing the backport11: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 #tryton12:33
-!- springwurm(~springwur@5.104.149.54) has joined #tryton12:57
-!- thaneor2(~ldlc6@r167-61-85-203.dialup.adsl.anteldata.net.uy) has joined #tryton20:49
-!- thaneor3(~acer8@r167-61-85-203.dialup.adsl.anteldata.net.uy) has joined #tryton20:50
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton21:58

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!