Rinse

Module Test

Nov 23rd, 2012
125
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ------------------ ROOT FOLDER -----------------------
  2. ## __init__.py ##
  3. (empty)
  4.  
  5.  
  6. ## __openerp__.py ##
  7. # -*- coding: utf-8 -*-
  8. {
  9. "name": "Test Module",
  10. "description": """Dit is een test module voor het testen van Qweb modules.""",
  11. "category": "LBA Modules",
  12. "version": "1.0",
  13. "author": "LBA Automatisering",
  14. "website": 'http://lbaonline.nl',
  15. "depends": ['web'],
  16. "init_xml" : ["my_custom_theme.xml"],
  17. "demo_xml" : [],
  18. "update_xml" : ["my_custom_theme.xml"],
  19. "js": ["static/src/js/chrome.js"],
  20. "qweb": ["static/src/xml/base.xml"],
  21. "css": [],
  22. 'active': False,
  23. }
  24.  
  25.  
  26. ## my_custom_theme.xml ##
  27. <?xml version="1.0" encoding="utf-8"?>
  28. <openerp>
  29. <data>
  30. <record id="test_view" model="ir.ui.view">
  31. <field name="description" colspan="4" widget="link" />
  32. </record>
  33. </data>
  34. </openerp>
  35.  
  36.  
  37. ----------------------- STATIC FOLDER ---------------------------------
  38. ## base.xml ##
  39. <templates id="template" xml:space="preserve">
  40. <t t-name="link">
  41. <div>manage your template </div>
  42. </t>
  43. </templates>
  44.  
  45.  
  46. ## chrome.js ##
  47. openerp.lib = function(instance)
  48. {
  49. console.log('tTTT',instance)
  50. instance.web.form.widgets.add('link', 'openerp.lib.Mywidget');
  51. instance.lib.Mywidget = instance.web.form.Widget.extend( {
  52. template : 'link',
  53. init : function(arg)
  54. {
  55. console.log('initi....my custome widget');
  56. }
  57. })
  58. }
RAW Paste Data