IRC logs of #tryton for Monday, 2021-04-05

chat.freenode.net #tryton log beginning Mon Apr 5 12:00:01 AM CEST 2021
-!- ChanServ(ChanServ@services.) has joined #tryton22:13
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton22:21
udonoLordVan: Hi, it depends if you use variants. Then you should consider for each of your new fields:  is it one setting for all of its variants? --> put in template, otherwise its save to put in product. But it depends on your setup.22:47
LordVani do not plan to use variants22:47
udonoLordVan: so it could be easier to put the fields on product. This way you save a click when accessing the product from invoice, sale, purchase.22:50
udonoafk22:50
LordVanyes definitely want to save that click22:51
LordVancuz it is unneded22:51
LordVanI mean yeah i could make it variants instead but i do not see any benefit (at the moment .. still reading the source ^⁾23:00
-!- srgdts(~srgdts@unaffiliated/srgdts) has joined #tryton01:52
-!- thaneor2(~acer8@r167-61-33-158.dialup.adsl.anteldata.net.uy) has joined #tryton02:13
-!- thaneor3(~ldlc6@r167-61-33-158.dialup.adsl.anteldata.net.uy) has joined #tryton02:13
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton06:49
-!- springwurm(~Springwur@5.104.149.54) has joined #tryton06:52
cedkLordVan: usually when you do not know, it is better to put it on template06:53
cedkLordVan: this is because it is simpler to move it later on product than the opposite06:54
cedkbut when you add a field on Template, you must register also an empty Product class so there will be a function field created06:54
LordVancedk, hmm interesting.07:40
LordVanwell i was still ondering over that over night07:41
LordVanlet me quickly explain more what I need: 1) I have my standard products/templates which are named like "Standard-<material name> <material thickness" there is absolutely nothing price or inventory stuff needed here as each will likely be more or less unique and then 2) there are those products that are actually ordered more often which i want to put into tryton properly so they can be re-used . they also need material + mateiral thickness (+07:43
LordVansome other custom fields or attributes but that aside now)07:43
LordVanso I see 2 options now:07:43
LordVan1) have one generic Template with variants on the different materials and material thicknesses -- for the "Standard" ones07:43
LordVanor 2) make one template/product pair for each07:44
LordVanabout 1): it'd be like Template "Sheet Metal Part" and then the Variants like "Steel, St37 1,00mm" , "Stainless Steel 1.4301 brushed 1,50 mm"07:44
LordVanand so on07:45
LordVanfor the actually repeatedly ordered parts (that also nave customer drawing numbers,..) I am pretty sure it makes more sense to make a template/product pair for each07:46
LordVan(in fact i might use the product/variant for different versions of the same part, but then again i am not too sure because sometimes there are changes even in material so more likely a seperate template/product pair for versions too..)07:46
LordVanso the thing i am currently thinking about is mostly the "standard" parts07:47
LordVansince they will be created once, witha  price of 0 - they are just placeholders after all and then never be changed,..07:47
LordVanbut i am leaning towards making a seperate template/product pair for each as well as to have consistent handling between those and the other products (ie not have lots of variants/products on the standard ones, but only 1 product per template for the "repeatedly ordered" parts)07:48
LordVancedk, did i manage to explain what my plan is or is it unclear?07:54
LordVanactually after a bit of testing on the demo server .. i think08:28
LordVani will go for Template(product) "Sheet Metal" and Product(Variants) being "1.4301 1,00mm", "S235JG 1,00mm" , ..08:28
LordVanwith the extra data in either attributes or extra fields08:29
LordVanstill weighing the pro's and cons08:29
LordVanbut i think i'lll make fields08:29
-!- ludo2(~Thunderbi@2001:912:1480:380::1) has joined #tryton08:29
LordVanas to wether I will then later on make Temlate-Product pairs for the repeatedly ordered things or not i will decide after some testing, but first i need this part up and running08:30
LordVanbtw08:30
LordVannot sure how many people did see this yesterday, so I post again:08:30
LordVani want to override on_change_product in SaleLine (to add some extra logic) .. ( do I have to copy/add the @fields again too on the new method? or is it enough to leave it on the original since i will call taht with super() anyway after overridign with @classmethod08:30
LordVan[I want to just automatically copy some data from the product/variant to the sale line08:31
-!- alidipatrick(~alidipatr@154.126.12.140) has joined #tryton08:32
-!- mrichez(~Maxime@2a02:a03f:c2e8:f900:ed77:85ea:af2b:ba6e) has joined #tryton08:43
LordVanok attributes are .. too roundabout to use for stuff you need on every product ^^ i'll make fields ;)08:52
cedkLordVan: for on_change you add a decorator for each field you will use in your code09:22
LordVanok so that is enough. thanks a lot.09:30
-!- rpit(~rpit@p200300c88f0235001c42215a17f33f55.dip0.t-ipconnect.de) has joined #tryton09:39
LordVanhm09:54
LordVani wonder .. why on the demo server can I enter a code but on my install i cannot .. probalby different module(s)09:55
LordVan(i mean "code" on the variants)09:55
cedkLordVan: I guess you have setup a sequence for product09:56
LordVanyes i was just lookign at that09:56
LordVani think i set it up for testing once09:56
LordVanand forgot09:56
LordVancan i just remove it and then use it "normally" again?09:57
LordVanor would that potentially break something ? (i only have test articles in my db so far btw)09:57
cedkLordVan: I do not think it will be a problem09:58
LordVanyeah i just tested it09:59
LordVanthanks09:59
LordVannow to figure out the correct xpath for the next step .. *wanders off to read the source*10:01
-!- jani-matti(~quassel@93-90-53-6.welcomnet.fi) has joined #tryton10:17
-!- mariomop(~quassel@181.29.189.235) has joined #tryton10:50
LordVanI'm kind of stuck with an error in my XML i just seem not to be able to spot .. running trytond-admin gives me this error: (complete traceback in the paste11:57
LordVanValueError: too many values to unpack (expected 2)11:57
LordVanhttps://dpaste.org/CeSM11:58
LordVanwhat am I missing?11:59
LordVanit's effectively (with obvious changes) the same as my code to change the sale line fomr11:59
LordVanfirst xml product.xml12:00
LordVansecond view/sale_line_form.xml12:00
LordVanah wait12:02
LordVani just forgot to save a change12:03
LordVanfrom product_form to product_view_form12:03
LordVan..12:03
-!- mmm33(~i@37.170.168.83) has joined #tryton12:08
LordVanand of course i wanted tbefore the label not before the field .. ah well12:08
udonoLordVan: hi, it's line 6: ref="product.product_form" the pattern is: module_name.view_name12:16
LordVanyes thanks i already found the problem12:16
LordVannow i am trying to figure out why those fields are readonly12:16
udonoLordVan: … because you define them on template?12:17
LordVannope12:17
LordVani defined on Product only12:17
udonoLordVan: did you update the module in the database?12:17
udonoLordVan: trytond-admin -u … -d …12:18
LordVani ran trytond-admin yes12:18
LordVanbut let me re-run the module update12:18
udonoLordVan: depends on your setup, after this maybe restart the trytond service…12:19
LordVani always restart the service and run trytond-admin because it just takes no time to do the service restart anyway12:19
LordVancopy paste error ...12:21
LordVani accidentally copied this too states = { 'readonly': Eval('sale_state') != 'draft', },12:21
LordVan                                 help = 'extra text to be appended to material'12:21
LordVan(same fields as on sale_line already)12:21
LordVanobviously that is always false there12:21
-!- springwurm(~Springwur@5.104.149.54) has joined #tryton12:25
-!- thaneor(~acer8@r167-61-33-158.dialup.adsl.anteldata.net.uy) has joined #tryton12:33
LordVanhmm i just looked at https://github.com/tryton/product/blob/develop/view/product_form_simple.xml and then wrote my own view to extend that https://github.com/LordVan/tryton-modules/blob/master/rm_extra_data/view/product_form_simple.xml12:50
LordVanbut my fields are nto showing12:50
LordVanthe xpath seesm fine to me?12:50
-!- alidipatrick(~alidipatr@197.149.39.7) has joined #tryton12:56
udonoLordVan: the simple form you can only see it on template: https://hg.tryton.org/modules/product/file/tip/view/template_form.xml13:02
LordVanudono, i know13:03
LordVanbut when i checked there it is still the original form13:03
LordVando i need to add some xml to make the template form use the "new" version?13:04
LordVanah wait13:04
LordVando you mean i need to add some xml to replace the line that adds the simple view there?13:05
udonoLordVan: it should be visible on template, in form view of the o2m Variants field.13:06
LordVanlike xpath expr="/form/notebook/page/field[@name='producsts]" position='replace' ?13:06
LordVanit is not13:06
LordVanvisible there now13:06
LordVanmaybe i need to add something there? https://github.com/LordVan/tryton-modules/blob/master/rm_extra_data/product.xml13:06
udonoLordVan: I don't think it is needed13:08
LordVanwell it definitely is not using it .. do i maybe need to set a priority? i have seen that somewhere13:11
udonoLordVan: maybe, but not sure either. Just give it a try13:12
LordVanyeah was goign to13:13
LordVanhmm actualyl there is a traceback from trytond-admin .. hmm DomainValidationError13:17
LordVanprobably got a wrong view name or sth ..13:17
udonoLordVan: Runs the client with --dev, otherwise restart the client13:20
LordVani have restarted the client severa times13:20
LordVanalso as i said that error was from the last trytond-admin run13:20
LordVanhttps://dpaste.org/bzod13:20
LordVanis there no way to get more meaningful errors with xml issue slike this? it doesn't seem to mention which line it was parsing anywhere /(unless i'm blind)13:22
LordVani mean besides "In tag record model ir.ui.view with id ..13:22
cedkLordVan: I guess you have set a view_type on the view inheriting another one which is not allowed13:25
LordVani have not set view_type13:26
LordVannever in fact used that so far13:26
LordVancedk, https://github.com/LordVan/tryton-modules/blob/master/rm_extra_data/product.xml <- this is the xml with the record entry it complains about13:27
cedkLordVan: I guess you have modified the XML between updates13:30
LordVanwhat do you mean?13:30
udonoLordVan: try to remove the product.xml content and update, then put it back and update again13:30
LordVanah ok let me do that13:32
LordVanah cool it works now13:35
LordVanthanks .. I wouldn't have figured that out anytime soon I think (more likely by conincidence) .. I didn't even know this could be an issue13:35
udonommm33: so just continue here. comming from #tryton.de13:38
udonommm33: plz try with more verbosity and pase again  trytond-admin -vvv -c /etc/tryton/trytond.conf -d tryton –all13:40
-!- thaneor(~acer8@r167-61-54-188.dialup.adsl.anteldata.net.uy) has joined #tryton14:16
-!- thaneor1(~ldlc6@r167-61-54-188.dialup.adsl.anteldata.net.uy) has joined #tryton14:16
-!- alidipatrick(~alidipatr@197.149.31.55) has joined #tryton14:32
cedkquite depressing, I just reviewed 2/3 of the issue with patch and about 80% have already been reviewed but with comment that the author never took into consideration16:26
cedkas most of the time I'm the reviewer, I feel like reducing my review work as many are not respecting it16:27
udonocedk: Iam not so quick, last review was an hour ago :-)16:40
cedkudono: I'm talking about the 200 issues with patch and no move since months16:45
-!- rpit(~rpit@p200300c88f0235001c42215a17f33f55.dip0.t-ipconnect.de) has joined #tryton17:32
-!- alidipatrick(~alidipatr@197.149.31.55) has joined #tryton18:01
-!- LordVan(~lordvan@gentoo/developer/LordVan) has joined #tryton18:36
LordVanhi19:09
LordVanlooking at product.py line 58 .. is it preferred to have more complicated readonly logic in a method? (like product.code_readonly) ?19:18
LordVani only need readonly if state is not draft and no product is selected (i want to readonly automatically filled in fields to avoid user lazyness (i mean errors of course ^^)19:19
LordVanor is it ok to just write Eval('sale.state') != 'draft' || Eval('product')19:21
LordVan?19:21
LordVanerr never mind me i make the method19:23
LordVan[unless what i am testing now works]19:24
-!- lucascastro(~lucascast@177-185-131-162.corp.isotelco.net.br) has joined #tryton19:28
LordVanI have to say .. the framework is real nice to work with ..19:31
LordVanstates = {'readonly': (Eval('sale_state') != 'draft') | Eval('product'), },19:31
LordVanis easy to write and read :D19:31
LordVanhm21:16
LordVanwhy would  the product code not save ? ..21:16
LordVani assign it call .save()21:20
LordVanbut then it is still empty21:20
LordVan(it is not readonly)21:20
LordVanI need to set suffix_code21:23

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