2010/7/15 Christophe Simonis <c...@openerp.com> > > On 15 Jul 2010, at 18:02, Christophe CHAUVET (SYLEAM) wrote: > > > Hi > > > > 2010/7/15 Albert Cervera i Areny <alb...@nan-tic.com> > > A Dijous, 15 de juliol de 2010, Olivier Dony va escriure: > > > > 7) I believe it's still not possible in a many2one view, to select > the > > > > view that would popup in the search list view or from record > > > > creation/visualization view. > > > > Currently we should code for this and override fields_view get and > use > > > > the context, but I think it would be better to support this natively > > > > and declaratively using an attribute parameter. > > > > (we do that hack in the fleet_maintenance module for instance). > > > > > > Hmm, ugly hack indeed. How about doing it the other way around and > > > making this view the highest priority form view (thus the one used in > > > the m2o), and then specifying another form view explicitly in the > action > > > that opens your regular list/form views. > > That does not work in the case of invoices, for example. If you have a > many2one widget to a customer invoice it will open up suppliers view. If you > made customer invoice view the default, you'd have the same problem with > many2one widgets referring to supplier invoices. > > This problem happens in several cases. > > > > For this i use in the context > > > > <field name="my_m2o" context="{'form_view_ref': 134, 'tree_view_ref': > 256}"/> > > > > 134 and 256 is the id for form and tree views that i want > > > > This doesn't work like that. You have to provide the XMLID of the view, not > his ID. > > But I think that the stable client doesn't update the context in the case > of x2many widget, avoiding to use this feature (bug report exists: > https://bugs.launchpad.net/bugs/581816) >
Yes you're right, it the xml_id ;) @Raphaël: you must search _view_ref, because it can be calendar_view_ref, graph_view_ref, gantt_view_ref $ rgrep "_view_ref" * osv/orm.py: view_ref = context.get(view_type + '_view_ref', False) In an old syleam branch, i implement a similar feature, but i prefer this one that Christophe (OpenERP) have implemented Regards, Christophe. -- Christophe Chauvet Directeur Technique/Technical Manager 27 Avenue Jean Mantelet 61000 Alençon, France http://www.syleam.fr/ ******************************************************************************** Ce message et toutes les pièces jointes (ci-après le "message") sont établis à l'intention exclusive de ses destinataires et sont confidentiels. Si vous recevez ce message par erreur, merci de le détruire et d'en avertir immédiatement l'expéditeur. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. L'internet ne permettant pas d'assurer l'intégrité de ce message, SYLEAM décline toute responsabilité au titre de ce message, dans l'hypothèse où il aurait été modifié. This message and any attachments (the "message") is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The internet can not guarantee the integrity of this message. SYLEAM shall not therefore be liable for the message if modified. ********************************************************************************
_______________________________________________ Mailing list: https://launchpad.net/~openerp-expert-framework Post to : openerp-expert-framework@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-expert-framework More help : https://help.launchpad.net/ListHelp