Re: [tryton-dev] Appearence of the product field on product template form view
On 2018-04-25 14:07, Udo Spallek wrote: > For me it is the perfect solution: > > if the Variants have more than one record, it is shown as a list > if the Variants have less than two records, it is shown as a form > > Is it an interesting enhancement of the product module? I do not think so because the behaviour is strange when user adds a second variant. The field on which the second variant is added become invisible. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ -- You received this message because you are subscribed to the Google Groups "tryton-dev" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton-dev/20180425140004.GW10584%40kei. signature.asc Description: Digital signature
Re: [tryton-dev] Appearence of the product field on product template form view
Wed, 25 Apr 2018 09:40:58 +0200 Cédric Krier: >On 2018-04-24 17:53, Udo Spallek wrote: >It can not work because clients build first the view before bind it >with record values. Thank you for the explanation. >I think it will be better to have a configuration option that defines >if the company is working with variants or not. This configuration >will be used to set a proper mode. I thought about a configuration, too. IMHO a configuration has limitations, as it is company-wide and not product specific: * Even when using variants in a setup, there can also be other products which are not variants. * When using variants it can be useful to have the product (variant) form view shown on new product templates, just for quick encoding. But I found another solution. I put two products fields in the view. There is one for mode="tree,form" and another for mode="form,tree", each of them surrounded by a group with a separate id:: (Maybe it can be done simpler with less use of groups) And now each group can be switched by view attributes:: class Template: __metaclass__ = PoolMeta __name__ = "product.template" @classmethod def view_attributes(cls): res = super(Template, cls).view_attributes() res.append(( "//group[@id='products-form']", 'states', {'invisible': Greater(Len(Eval('products')), 1)}, )) res.append(( "//group[@id='products-tree']", 'states', {'invisible': Less(Len(Eval('products')), 2)}, )) return res For me it is the perfect solution: if the Variants have more than one record, it is shown as a list if the Variants have less than two records, it is shown as a form Is it an interesting enhancement of the product module? Regards Udo -- virtual things Preisler & Spallek GbR Windeckstr. 77 81375 München Tel: +49 (89) 710 481 55 i...@virtual-things.biz https://www.virtual-things.biz -- You received this message because you are subscribed to the Google Groups "tryton-dev" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton-dev/20180425140700.3f2b971a%40bender.fritz.box. pgppdRVdKlOHY.pgp Description: Digitale Signatur von OpenPGP
Re: [tryton-dev] Appearence of the product field on product template form view
On 2018-04-24 17:53, Udo Spallek wrote: > But the following code (in version 4.0), but it doesn't work, > the view_attribute[2] does not *dynamically* set the > *mode*[3] attribute:: > > > class Template: > __metaclass__ = PoolMeta > __name__ = "product.template" > > > @classmethod > def view_attributes(cls): > res = super(Template, cls).view_attributes() > > res.append(( > "/form/notebook/page[@id='general']/field[@name='products']", > 'mode', > If(Greater(Len(Eval('products')), 1), > 'tree,form', 'form,tree') > )) > return res > > Are there any ideas how it could work? What is missing? It can not work because clients build first the view before bind it with record values. I think it will be better to have a configuration option that defines if the company is working with variants or not. This configuration will be used to set a proper mode. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ -- You received this message because you are subscribed to the Google Groups "tryton-dev" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton-dev/20180425074058.GQ10584%40kei. signature.asc Description: Digital signature
[tryton-dev] Do you speak English? Please help to review the tool tips
Hi, please help to review the *tool tips* (also known as *help texts*) of the Tryton server: https://tryton-rietveld.appspot.com/44551003 Thank you very much in advance for finding misspellings, typos, guideline[1] issues and better explanations. Regards Udo Spallek [1] https://discuss.tryton.org/t/how-to-write-tooltips -- virtual things Preisler & Spallek GbR Tel: +498971048155 i...@virtual-things.biz https://www.virtual-things.biz -- You received this message because you are subscribed to the Google Groups "tryton-dev" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton-dev/20180425085830.17113a66%40bender.fritz.box. pgpn9yLd_fL1c.pgp Description: Digitale Signatur von OpenPGP