merging from the trunk
bzr revid: mga@tinyerp.com-20081211113653-saduvneg6f6sdjjr
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem icon="terp-administration" id="menu_administration" name="Administration" sequence="20"/>
|
||||
<menuitem id="menu_custom" name="Custom" parent="base.menu_administration" sequence="2"/>
|
||||
<menuitem id="next_id_4" name="Low Level Objects" parent="base.menu_administration" sequence="3"/>
|
||||
<menuitem id="menu_low_workflow" name="Workflow Items" parent="base.next_id_4"/>
|
||||
<menuitem id="menu_custom" name="Customization" parent="base.menu_administration" sequence="2"/>
|
||||
<menuitem id="menu_custom_action" name="Actions" parent="base.menu_custom" sequence="20"/>
|
||||
<menuitem id="menu_config" name="Configuration" parent="base.menu_administration" sequence="1"/>
|
||||
<menuitem id="menu_translation" name="Translations" parent="base.menu_administration" sequence="4"/>
|
||||
<menuitem id="menu_translation_app" name="Application Terms" parent="base.menu_translation" sequence="4"/>
|
||||
<menuitem id="menu_translation_export" name="Import / Export" parent="base.menu_translation" sequence="4"/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
Languages
|
||||
======================
|
||||
-->
|
||||
<menuitem id="next_id_2" name="Interface" parent="base.menu_custom"/>
|
||||
<menuitem id="next_id_2" name="User Interface" parent="base.menu_custom"/>
|
||||
|
||||
<!--
|
||||
======================
|
||||
|
||||
+14
-14
@@ -41,7 +41,7 @@
|
||||
</record>
|
||||
|
||||
<record id="act_values_form" model="ir.actions.act_window">
|
||||
<field name="name">Values</field>
|
||||
<field name="name">Client Actions Connections</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">ir.values</field>
|
||||
<field name="view_type">form</field>
|
||||
@@ -49,7 +49,6 @@
|
||||
<field name="context">{'read':'default'}</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="next_id_4" name="Low Level" parent="menu_custom"/>
|
||||
<menuitem action="act_values_form" id="menu_values_form" parent="next_id_4"/>
|
||||
|
||||
<!-- Sequences -->
|
||||
@@ -114,7 +113,7 @@
|
||||
<field name="view_id" ref="sequence_view_tree"/>
|
||||
<field name="context">{'active_test': False}</field>
|
||||
</record>
|
||||
<menuitem id="next_id_5" name="Sequences" parent="base.menu_custom"/>
|
||||
<menuitem id="next_id_5" name="Sequences" parent="base.menu_config"/>
|
||||
<menuitem action="ir_sequence_form" id="menu_ir_sequence_form" parent="next_id_5"/>
|
||||
|
||||
<!-- Sequences Types -->
|
||||
@@ -464,7 +463,7 @@
|
||||
<field name="model">ir.ui.view</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="User Interface - Views">
|
||||
<form string="Views">
|
||||
<field name="name" select="1"/>
|
||||
<field name="type" select="1"/>
|
||||
<field name="model" select="1"/>
|
||||
@@ -480,7 +479,7 @@
|
||||
<field name="model">ir.ui.view</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<tree string="Views">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="model"/>
|
||||
@@ -488,7 +487,7 @@
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_ui_view" model="ir.actions.act_window">
|
||||
<field name="name">View</field>
|
||||
<field name="name">Views</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">ir.ui.view</field>
|
||||
<field name="view_id" ref="view_view_tree"/>
|
||||
@@ -719,7 +718,7 @@
|
||||
</page>
|
||||
<page string="Access Rights">
|
||||
<field colspan="4" name="access_ids" select="1" nolabel="1">
|
||||
<tree string="Access Rules" editable="bottom" colspan="4">
|
||||
<tree string="Access Rules" editable="bottom">
|
||||
<field name="group_id"/>
|
||||
<field name="perm_read"/>
|
||||
<field name="perm_write"/>
|
||||
@@ -788,7 +787,7 @@
|
||||
<field name="on_delete" attrs="{'readonly': [('ttype','!=','many2one')]}"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Security on Groups" colspan="4">
|
||||
<page string="Security on Groups">
|
||||
<field name="groups" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
@@ -935,7 +934,7 @@
|
||||
</field>
|
||||
</record>
|
||||
<record id="grant_menu_access" model="ir.actions.act_window">
|
||||
<field name="name">Grant access to menu</field>
|
||||
<field name="name">Grant Access To Menus</field>
|
||||
<field name="res_model">ir.ui.menu</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="edit_menu"/>
|
||||
@@ -993,7 +992,7 @@
|
||||
<field name="context">{'active_test': False}</field>
|
||||
<field name="view_id" ref="ir_cron_view_tree"/>
|
||||
</record>
|
||||
<menuitem id="next_id_10" name="Scheduler" parent="base.menu_custom"/>
|
||||
<menuitem id="next_id_10" name="Scheduler" parent="base.menu_config"/>
|
||||
<menuitem action="ir_cron_act" id="menu_ir_cron_act" parent="next_id_10"/>
|
||||
|
||||
|
||||
@@ -1184,12 +1183,12 @@
|
||||
<tree string="Field Mappings" editable="top">
|
||||
<field name="col1" domain="[('model_id','=',parent.srcmodel_id or parent.model_id)]"/>
|
||||
<field name="type"/>
|
||||
<field name="value" colsapan="4"/>
|
||||
<field name="value" colspan="4"/>
|
||||
</tree>
|
||||
<form string="Field Mapping">
|
||||
<field name="col1" domain="[('model_id','=',parent.srcmodel_id or parent.model_id)]"/>
|
||||
<field name="type"/>
|
||||
<field name="value" colsapan="4"/>
|
||||
<field name="value" colspan="4"/>
|
||||
</form>
|
||||
</field>
|
||||
<label colspan="4" string="If you use a formula type, use a python expression using the variable 'object'." align="0.0"/>
|
||||
@@ -1227,7 +1226,7 @@
|
||||
<field name="view_id" ref="view_server_action_tree"/>
|
||||
<field name="context">{'key':'server_action'}</field>
|
||||
</record>
|
||||
<menuitem action="action_server_action" id="menu_server_action" parent="base.next_id_6"/>
|
||||
<menuitem action="action_server_action" id="menu_server_action" parent="base.menu_custom_action"/>
|
||||
|
||||
<record id="view_model_fields_tree" model="ir.ui.view">
|
||||
<field name="name">ir.model.fields.tree</field>
|
||||
@@ -1287,7 +1286,8 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="domain">[('type','=','configure')]</field>
|
||||
</record>
|
||||
<menuitem id="next_id_11" name="Configuration Wizards" parent="base.menu_custom"/><menuitem action="act_ir_actions_todo_form" id="menu_ir_actions_todo_form" parent="next_id_11"/>
|
||||
<menuitem id="next_id_11" name="Configuration Wizards" parent="base.menu_config" sequence="1"/>
|
||||
<menuitem action="act_ir_actions_todo_form" id="menu_ir_actions_todo_form" parent="next_id_11"/>
|
||||
|
||||
<record id="view_config_wizard_form" model="ir.ui.view">
|
||||
<field name="name">Main Configuration Wizard</field>
|
||||
|
||||
@@ -48,7 +48,7 @@ class ir_translation(osv.osv, Cacheable):
|
||||
lang_ids = lang_obj.search(cr, uid, [('translatable', '=', True)],
|
||||
context=context)
|
||||
langs = lang_obj.browse(cr, uid, lang_ids, context=context)
|
||||
res = [(lang.code, unicode(lang.name,'utf-8')) for lang in langs]
|
||||
res = [(lang.code, lang.name) for lang in langs]
|
||||
for lang_dict in tools.scan_languages():
|
||||
if lang_dict not in res:
|
||||
res.append(lang_dict)
|
||||
|
||||
@@ -27,7 +27,6 @@ import netsvc
|
||||
import os
|
||||
|
||||
def _check_xml(self, cr, uid, ids, context={}):
|
||||
return True
|
||||
for view in self.browse(cr, uid, ids, context):
|
||||
eview = etree.fromstring(view.arch)
|
||||
frng = tools.file_open(os.path.join('base','rng','view.rng'))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem id="menu_workflow_root" name="Workflows" parent="menu_custom"/>
|
||||
<menuitem id="menu_workflow_root" name="Workflow Definitions" parent="menu_custom"/>
|
||||
|
||||
<!--
|
||||
================================
|
||||
@@ -110,7 +110,7 @@
|
||||
</record>
|
||||
|
||||
<record id="action_workflow_activity_form" model="ir.actions.act_window">
|
||||
<field name="name">Activites</field>
|
||||
<field name="name">Activities</field>
|
||||
<field name="res_model">workflow.activity</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_workflow_activity_tree"/>
|
||||
@@ -207,7 +207,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_workflow_instance_tree"/>
|
||||
</record>
|
||||
<menuitem action="action_workflow_instance_form" id="menu_workflow_instance" parent="base.menu_workflow_root"/>
|
||||
<menuitem action="action_workflow_instance_form" id="menu_workflow_instance" parent="base.menu_low_workflow"/>
|
||||
|
||||
<!--
|
||||
================================
|
||||
@@ -248,7 +248,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_workflow_workitem_tree"/>
|
||||
</record>
|
||||
<menuitem action="action_workflow_workitem_form" id="menu_workflow_workitem" parent="base.menu_workflow_root"/>
|
||||
<menuitem action="action_workflow_workitem_form" id="menu_workflow_workitem" parent="base.menu_low_workflow"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -32,78 +32,46 @@ from osv import osv, fields
|
||||
import pooler
|
||||
import time
|
||||
import math
|
||||
from pprint import pprint as pp
|
||||
|
||||
from tools import config
|
||||
import xmlrpclib
|
||||
|
||||
class maintenance_contract_module(osv.osv):
|
||||
_name ="maintenance.contract.module"
|
||||
_description = "maintenance contract modules"
|
||||
_columns = {
|
||||
'name' : fields.char('Name', size=128, required=True),
|
||||
'version': fields.char('Version', size=64,),
|
||||
}
|
||||
|
||||
maintenance_contract_module()
|
||||
|
||||
class maintenance_contract(osv.osv):
|
||||
_name = "maintenance.contract"
|
||||
_description = "Maintenance Contract"
|
||||
|
||||
def _valid_get(self, cr, uid, ids, field_name, arg, context=None):
|
||||
res = {}
|
||||
for contract in self.browse(cr, uid, ids, context=context):
|
||||
res[contract.id] = ("unvalid", "valid")[contract.date_stop >= time.strftime('%Y-%m-%d')]
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'name' : fields.char('Contract ID', size=256, required=True, readonly=True),
|
||||
'password' : fields.char('Password', size=64, invisible=True, required=True, readonly=True),
|
||||
'date_start' : fields.date('Starting Date', readonly=True),
|
||||
'date_stop' : fields.date('Ending Date', readonly=True),
|
||||
'modules': fields.text('Covered Modules')
|
||||
'module_ids' : fields.many2many('maintenance.contract.module', 'maintenance_contract_module_rel', 'contract_id', 'module_id', 'Covered Modules', readonly=True),
|
||||
'state' : fields.function(_valid_get, method=True, string="State", type="selection", selection=[('valid', 'Valid'),('unvalid', 'Unvalid')], readonly=True),
|
||||
'kind' : fields.selection([('full', 'Full'),('partial', 'Partial')], 'Kind', required=True, readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'password' : lambda obj,cr,uid,context={} : '',
|
||||
}
|
||||
def _test_maintenance(self, cr, uid, ids, context):
|
||||
remote_db='trunk'
|
||||
remote_server='localhost'
|
||||
port=8069
|
||||
module_obj=self.pool.get('ir.module.module')
|
||||
contract_obj=self.pool.get('maintenance.contract')
|
||||
module_ids=module_obj.search(cr, uid, [('state','=','installed')])
|
||||
modules=module_obj.read(cr, uid, module_ids, ['name','installed_version'])
|
||||
contract_obj=contract_obj.read(cr, uid, ids[0])
|
||||
local_url = 'http://%s:%d/xmlrpc/common'%(remote_server,port)
|
||||
rpc = xmlrpclib.ServerProxy(local_url)
|
||||
ruid = rpc.login(remote_db, 'admin', 'admin')
|
||||
local_url = 'http://%s:%d/xmlrpc/object'%(remote_server,port)
|
||||
rrpc = xmlrpclib.ServerProxy(local_url)
|
||||
try:
|
||||
result=rrpc.execute(remote_db, ruid, 'admin', 'maintenance.maintenance', 'check_contract' , modules,contract_obj)
|
||||
except:
|
||||
raise osv.except_osv(_('Maintenance Error !'),('''Module Maintenance_Editor is not installed at server : %s Database : %s'''%(remote_server,remote_db)))
|
||||
if context.get('active_id',False):
|
||||
if result['status']=='ko':
|
||||
raise osv.except_osv(_('Maintenance Error !'),('''Maintenance Contract
|
||||
-----------------------------------------------------------
|
||||
You have no valid maintenance contract! If you are using
|
||||
Open ERP, it is highly suggested to take maintenance contract.
|
||||
The maintenance program offers you:
|
||||
* Migrations on new versions,
|
||||
* Bugfix guarantee,
|
||||
* Monthly announces of bugs,
|
||||
* Security alerts,
|
||||
* Access to the customer portal.
|
||||
* Check the maintenance contract (www.openerp.com)'''))
|
||||
elif result['status']=='partial':
|
||||
raise osv.except_osv(_('Maintenance Error !'),('''Maintenance Contract
|
||||
-----------------------------------------------------------
|
||||
You have a maintenance contract, But you installed modules those
|
||||
are not covered by your maintenance contract:
|
||||
%s
|
||||
It means we can not offer you the garantee of maintenance on
|
||||
your whole installation.
|
||||
The maintenance program includes:
|
||||
* Migrations on new versions,
|
||||
* Bugfix guarantee,
|
||||
* Monthly announces of bugs,
|
||||
* Security alerts,
|
||||
* Access to the customer portal.
|
||||
|
||||
To include these modules in your maintenance contract, you should
|
||||
extend your contract with the editor. We will review and validate
|
||||
your installed modules.
|
||||
|
||||
* Extend your maintenance to the modules you used.
|
||||
* Check your maintenance contract''') % ','.join(result['modules']))
|
||||
else:
|
||||
raise osv.except_osv(_('Valid Maintenance Contract !'),('''Your Maintenance Contract is up to date'''))
|
||||
return result
|
||||
_sql_constraints = [
|
||||
('uniq_name', 'unique(name)', "Your maintenance contract is already subscribed in the system !")
|
||||
]
|
||||
|
||||
maintenance_contract()
|
||||
|
||||
@@ -114,11 +82,55 @@ class maintenance_contract_wizard(osv.osv_memory):
|
||||
_columns = {
|
||||
'name' : fields.char('Contract ID', size=256, required=True ),
|
||||
'password' : fields.char('Password', size=64, required=True),
|
||||
'state' : fields.selection([('draft', 'Draft'),('validated', 'Validated'),('unvalidated', 'Unvalidated')], 'States'),
|
||||
}
|
||||
|
||||
def validate_cb(self, cr, uid, ids, context):
|
||||
print "Validate_cb"
|
||||
return False
|
||||
_defaults = {
|
||||
'state' : lambda *a: 'draft',
|
||||
}
|
||||
|
||||
def action_validate(self, cr, uid, ids, context):
|
||||
if not ids:
|
||||
return False
|
||||
|
||||
module_proxy = self.pool.get('ir.module.module')
|
||||
module_ids = module_proxy.search(cr, uid, [('state', '=', 'installed')])
|
||||
modules = module_proxy.read(cr, uid, module_ids, ['name', 'installed_version'])
|
||||
|
||||
contract = self.read(cr, uid, ids, ['name', 'password'])[0]
|
||||
|
||||
login, password, remote_db, remote_server, port = 'admin', 'admin', 'trunk', 'localhost', 8069
|
||||
|
||||
rpc = xmlrpclib.ServerProxy('http://%s:%d/xmlrpc/common' % (remote_server, port))
|
||||
ruid = rpc.login(remote_db, login, password)
|
||||
rpc = xmlrpclib.ServerProxy('http://%s:%d/xmlrpc/object' % (remote_server, port))
|
||||
contract_info = rpc.execute(remote_db, ruid, password, 'maintenance.maintenance', 'check_contract', modules, contract )
|
||||
is_ok = contract_info['status'] in ('partial', 'full')
|
||||
if is_ok:
|
||||
if contract_info['modules_with_contract']:
|
||||
module_ids = []
|
||||
for name, version in contract_info['modules_with_contract']:
|
||||
contract_module = self.pool.get('maintenance.contract.module')
|
||||
res = contract_module.search(cr, uid, [('name', '=', name),('version', '=', version)])
|
||||
if not res:
|
||||
id = contract_module.create(cr, uid, { 'name' : name, 'version' : version } )
|
||||
else:
|
||||
id = res[0]
|
||||
module_ids.append(id)
|
||||
|
||||
self.pool.get('maintenance.contract').create(
|
||||
cr,
|
||||
uid, {
|
||||
'name' : contract['name'],
|
||||
'password' : contract['password'],
|
||||
'date_start' : contract_info['date_from'],
|
||||
'date_stop' : contract_info['date_to'],
|
||||
'kind' : contract_info['status'],
|
||||
'module_ids' : [(6,0,module_ids)],
|
||||
}
|
||||
)
|
||||
|
||||
return self.write(cr, uid, ids, {'state' : ('unvalidated', 'validated')[is_ok] }, context=context)
|
||||
|
||||
maintenance_contract_wizard()
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<field name="name"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_stop"/>
|
||||
<field name="state" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -22,11 +23,17 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Maintenance Contract">
|
||||
<separator string="Information" colspan="4"/>
|
||||
<field name="name" select="1" colspan="4"/>
|
||||
<field name="name" select="1" />
|
||||
<field name="state" />
|
||||
<field name="date_start" select="1"/>
|
||||
<field name="date_stop" select="1"/>
|
||||
<separator string="Covered Modules" colspan="4"/>
|
||||
<field name="modules" nolabel="1" colspan="4"/>
|
||||
<field name="module_ids" nolabel="1" colspan="4">
|
||||
<tree string="Covered Modules">
|
||||
<field name="name" />
|
||||
<field name="version" />
|
||||
</tree>
|
||||
</field>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -54,14 +61,28 @@
|
||||
<field name="model">maintenance.contract.wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Add Maintenance Contract">
|
||||
<separator string="Add Maintenance Contract" colspan="2"/>
|
||||
<newline />
|
||||
<field name="name" />
|
||||
<newline />
|
||||
<field name="password" password="True" />
|
||||
<newline />
|
||||
<label string="" /><button name="validate_cb" type="object" string="Validate" />
|
||||
<form string="Add Maintenance Contract" col="2">
|
||||
<image name="gtk-dialog-info" />
|
||||
<group col="1">
|
||||
<separator string="Add Maintenance Contract" />
|
||||
<group states="draft">
|
||||
<field name="name" width="250" />
|
||||
<newline />
|
||||
<field name="password" password="True" />
|
||||
<field name="state" invisible="1" />
|
||||
</group>
|
||||
<group states="validated">
|
||||
<label string="Maintenance contract added !"/>
|
||||
</group>
|
||||
<group states="unvalidated">
|
||||
<label string="Could you check your contract information ?" />
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<button type="object" string="_Cancel" icon="gtk-cancel" special="cancel" states="draft"/>
|
||||
<button type="object" string="_Validate" icon="gtk-apply" name="action_validate" states="draft"/>
|
||||
<button type="object" string="_Close" icon="gtk-close" special="cancel" states="validated,unvalidated"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -107,49 +107,33 @@ class module(osv.osv):
|
||||
res[m.id] = ''
|
||||
return res
|
||||
|
||||
def _get_menus(self, cr, uid, ids, field_name=None, arg=None, context={}):
|
||||
res = {}
|
||||
model_data_obj = self.pool.get('ir.model.data')
|
||||
menu_obj = self.pool.get('ir.ui.menu')
|
||||
for m in self.browse(cr, uid, ids):
|
||||
if m.state == 'installed':
|
||||
menu_txt = ''
|
||||
menus_id = model_data_obj.search(cr,uid,[('module','=',m.name),('model','=','ir.ui.menu')])
|
||||
for data_id in model_data_obj.browse(cr,uid,menus_id):
|
||||
menu_txt += menu_obj.browse(cr,uid,data_id.res_id).complete_name + '\n'
|
||||
res[m.id] = menu_txt
|
||||
else:
|
||||
res[m.id] = ''
|
||||
return res
|
||||
|
||||
def _get_reports(self, cr, uid, ids, field_name=None, arg=None, context={}):
|
||||
res = {}
|
||||
model_data_obj = self.pool.get('ir.model.data')
|
||||
report_obj = self.pool.get('ir.actions.report.xml')
|
||||
for m in self.browse(cr, uid, ids):
|
||||
if m.state == 'installed':
|
||||
report_txt = ''
|
||||
report_id = model_data_obj.search(cr,uid,[('module','=',m.name),('model','=','ir.actions.report.xml')])
|
||||
for data_id in model_data_obj.browse(cr,uid,report_id):
|
||||
report_txt += report_obj.browse(cr,uid,data_id.res_id).name + '\n'
|
||||
res[m.id] = report_txt
|
||||
else:
|
||||
res[m.id] = ''
|
||||
return res
|
||||
|
||||
def _get_views(self, cr, uid, ids, field_name=None, arg=None, context={}):
|
||||
res = {}
|
||||
model_data_obj = self.pool.get('ir.model.data')
|
||||
view_obj = self.pool.get('ir.ui.view')
|
||||
for m in self.browse(cr, uid, ids, context=context):
|
||||
if m.state == 'installed':
|
||||
view_txt = ''
|
||||
view_id = model_data_obj.search(cr,uid,[('module','=',m.name),('model','=','ir.ui.view')])
|
||||
for data_id in model_data_obj.browse(cr,uid,view_id):
|
||||
view_txt += view_obj.browse(cr,uid,data_id.res_id).name + '\n'
|
||||
res[m.id] = view_txt
|
||||
else:
|
||||
res[m.id] = ''
|
||||
report_obj = self.pool.get('ir.actions.report.xml')
|
||||
menu_obj = self.pool.get('ir.ui.menu')
|
||||
mlist = self.browse(cr, uid, ids, context=context)
|
||||
mnames = {}
|
||||
for m in mlist:
|
||||
mnames[m.name] = m.id
|
||||
res[m.id] = {
|
||||
'menus_by_module':'',
|
||||
'reports_by_module':'',
|
||||
'views_by_module': ''
|
||||
}
|
||||
view_id = model_data_obj.search(cr,uid,[('module','in', mnames.keys()),
|
||||
('model','in',('ir.ui.view','ir.actions.report.xml','ir.ui.menu'))])
|
||||
for data_id in model_data_obj.browse(cr,uid,view_id,context):
|
||||
key = data_id['model']
|
||||
if key=='ir.ui.view':
|
||||
v = view_obj.browse(cr,uid,data_id.res_id)
|
||||
aa = v.inherit_id and '* INHERIT ' or ''
|
||||
res[mnames[data_id.module]]['views_by_module'] += aa + v.name + ' ('+v.type+')\n'
|
||||
elif key=='ir.actions.report.xml':
|
||||
res[mnames[data_id.module]]['reports_by_module'] += report_obj.browse(cr,uid,data_id.res_id).name + '\n'
|
||||
elif key=='ir.ui.menu':
|
||||
res[mnames[data_id.module]]['menus_by_module'] += menu_obj.browse(cr,uid,data_id.res_id).complete_name + '\n'
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
@@ -182,9 +166,9 @@ class module(osv.osv):
|
||||
('GPL-3 or any later version', 'GPL-3 or later version'),
|
||||
('Other proprietary', 'Other proprietary')
|
||||
], string='License', readonly=True),
|
||||
'menus_by_module': fields.function(_get_menus, method=True, string='Menus', type='text'),
|
||||
'reports_by_module': fields.function(_get_reports, method=True, string='Reports', type='text'),
|
||||
'views_by_module': fields.function(_get_views, method=True, string='Views', type='text'),
|
||||
'menus_by_module': fields.function(_get_views, method=True, string='Menus', type='text', multi="meta"),
|
||||
'reports_by_module': fields.function(_get_views, method=True, string='Reports', type='text', multi="meta"),
|
||||
'views_by_module': fields.function(_get_views, method=True, string='Views', type='text', multi="meta"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
||||
@@ -28,30 +28,30 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form col="3" string="Export language">
|
||||
<notebook>
|
||||
<page string="Export Data">
|
||||
<group col="2" fill="0" states="choose">
|
||||
<separator colspan="2" string="Export translation file"/>
|
||||
<field name="lang" required="1" width="300"/>
|
||||
<field name="format" required="1"/>
|
||||
<field height="200" name="modules" width="500"/>
|
||||
<field invisible="1" name="state"/>
|
||||
</group>
|
||||
<group col="1" fill="0" states="get">
|
||||
<separator string="Export done"/>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="data" nolabel="1" readonly="1" fieldname="name"/>
|
||||
<field height="80" name="advice" nolabel="1"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Help">
|
||||
<label align="0.0" colspan="4" string="The official translations pack of all OpenERP/OpenObjects module are managed through launchpad. We use their online interface to synchronize all translations efforts."/>
|
||||
<label align="0.0" colspan="4" string="To improve some terms of the official translations of OpenERP, you should modify the terms directly on the launchpad interface. If you made lots of translations for your own module, you can also publish all your translation at once."/>
|
||||
<label align="0.0" colspan="4" string="To browse official translations, you can visit this link: "/>
|
||||
<label align="0.0" colspan="4" string="https://translations.launchpad.net/openobject"/>
|
||||
</page>
|
||||
<notebook>
|
||||
<page string="Export Data">
|
||||
<group col="2" fill="0" states="choose">
|
||||
<separator colspan="2" string="Export translation file"/>
|
||||
<field name="lang" required="1" width="300"/>
|
||||
<field name="format" required="1"/>
|
||||
<field height="200" name="modules" width="500"/>
|
||||
<field invisible="1" name="state"/>
|
||||
</group>
|
||||
<group col="1" fill="0" states="get">
|
||||
<separator string="Export done"/>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="data" nolabel="1" readonly="1" fieldname="name"/>
|
||||
<field height="80" name="advice" nolabel="1"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Help">
|
||||
<label align="0.0" colspan="4" string="The official translations pack of all OpenERP/OpenObjects module are managed through launchpad. We use their online interface to synchronize all translations efforts."/>
|
||||
<label align="0.0" colspan="4" string="To improve some terms of the official translations of OpenERP, you should modify the terms directly on the launchpad interface. If you made lots of translations for your own module, you can also publish all your translation at once."/>
|
||||
<label align="0.0" colspan="4" string="To browse official translations, you can visit this link: "/>
|
||||
<label align="0.0" colspan="4" string="https://translations.launchpad.net/openobject"/>
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
|
||||
<group col="2" colspan="3" fill="0">
|
||||
<button icon="gtk-cancel" name="act_cancel" special="cancel" states="choose" string="Cancel" type="object"/>
|
||||
<button icon="gtk-ok" name="act_getfile" states="choose" string="Get file" type="object"/>
|
||||
|
||||
@@ -137,6 +137,13 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P6">[[ format(module.description or '') ]]</para>
|
||||
<h1>Menus</h1>
|
||||
<para style="P6">[[ format(module.menus_by_module or '') ]]</para>
|
||||
<h1>Reports</h1>
|
||||
<para style="P6">[[ format(module.reports_by_module or '') ]]</para>
|
||||
<h1>Views</h1>
|
||||
<para style="P6">[[ format(module.views_by_module or '') ]]</para>
|
||||
<h1>Objects</h1>
|
||||
<section>
|
||||
<para style="Standard">[[ repeatIn(findobj(module.name) ,'object') ]]</para>
|
||||
<blockTable colWidths="510.0" repeatRows="1" style="Tableau3">
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
<field name="domain">[('res_id','=',False)]</field>
|
||||
<field name="view_id" ref="ir_property_view_tree"/>
|
||||
</record>
|
||||
<menuitem id="next_id_15" name="Properties" parent="base.menu_custom"/><menuitem action="ir_property_form" id="menu_ir_property_form" parent="next_id_15"/>
|
||||
<menuitem id="next_id_15" name="Properties" parent="base.menu_config"/>
|
||||
<menuitem action="ir_property_form" id="menu_ir_property_form" parent="next_id_15"/>
|
||||
|
||||
<record id="ir_property_form_all" model="ir.actions.act_window">
|
||||
<field name="name">All Properties</field>
|
||||
|
||||
@@ -44,7 +44,6 @@ class lang(osv.osv):
|
||||
'grouping':fields.char('Separator Format',size=64,required=True,help="The Separator Format should be like [,n] where 0 < n :starting from Unit digit.-1 will end the separation. e.g. [3,2,-1] will represent 106500 to be 1,06,500;[1,2,-1] will represent it to be 106,50,0;[3] will represent it as 106,500. Provided ',' as the thousand separator in each case."),
|
||||
'decimal_point':fields.char('Decimal Separator', size=64,required=True),
|
||||
'thousands_sep':fields.char('Thousands Separator',size=64),
|
||||
'legend':fields.text('Legends for Date and Time Formats',readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'active': lambda *a: 1,
|
||||
@@ -55,40 +54,6 @@ class lang(osv.osv):
|
||||
'grouping':lambda *a: '[]',
|
||||
'decimal_point':lambda *a: '.',
|
||||
'thousands_sep':lambda *a: ',',
|
||||
'legend': lambda *a: '%a - Abbreviated weekday name.\
|
||||
\n%A - Full weekday name.\
|
||||
\n%b - Abbreviated month name.\
|
||||
\n%B - Full month name. \
|
||||
\n%c - Appropriate date and time representation.\
|
||||
\n%d - Day of the month as a decimal number [01,31].\
|
||||
\n%H - Hour (24-hour clock) as a decimal number [00,23].\
|
||||
\n%I - Hour (12-hour clock) as a decimal number [01,12].\
|
||||
\n%j - Day of the year as a decimal number [001,366].\
|
||||
\n%m - Month as a decimal number [01,12].\
|
||||
\n%M - Minute as a decimal number [00,59].\
|
||||
\n%p - Equivalent of either AM or PM.\
|
||||
\n%S - Second as a decimal number [00,61].\
|
||||
\n%U - Week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0.\
|
||||
\n%w - Weekday as a decimal number [0(Sunday),6].\
|
||||
\n%W - Week number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday are considered to be in week 0.\
|
||||
\n%x - Appropriate date representation.\
|
||||
\n%X - Appropriate time representation.\
|
||||
\n%y - Year without century as a decimal number [00,99].\
|
||||
\n%Y - Year with century as a decimal number.\
|
||||
\n ==========================================\
|
||||
\n\nExamples:\
|
||||
\n1. %c ==> Fri Dec 5 18:25:20 2008\
|
||||
\n2. %a ,%A ==> Fri, Friday\
|
||||
\n3. %x ,%X ==> 12/05/08, 18:25:20\
|
||||
\n4. %b, %B ==> Dec, December\
|
||||
\n5. %y, %Y ==> 08, 2008\
|
||||
\n6. %d, %m ==> 05, 12\
|
||||
\n7. %H:%M:%S ==> 18:25:20\
|
||||
\n8. %I:%M:%S %p ==> 06:25:20 PM\
|
||||
\n9. %j ==> 340\
|
||||
\n10. %S ==> 20\
|
||||
\n11. %U or %W ==> 48 (49th week)\
|
||||
\n12. %w ==> 5 ( Friday is the 6th day)',
|
||||
}
|
||||
|
||||
def _group(self,cr,uid,ids,s, monetary=False):
|
||||
|
||||
@@ -27,18 +27,72 @@
|
||||
<field name="active" />
|
||||
<field name="translatable"/>
|
||||
<field name="grouping" />
|
||||
<field name="direction" />
|
||||
<newline/>
|
||||
<field name="date_format"/>
|
||||
<field name="time_format"/>
|
||||
<field name="decimal_point"/>
|
||||
<field name="thousands_sep"/>
|
||||
<newline/>
|
||||
<field name="direction" />
|
||||
</group>
|
||||
|
||||
<newline/>
|
||||
<separator colspan="4" string="Legends for Date and Time Formats"/>
|
||||
<field name="legend" nolabel="1" colspan="4"/>
|
||||
<group col="4" colspan="4">
|
||||
<label align="0.0" string="%%a - Abbreviated weekday name."/>
|
||||
<label align="0.0" string="%%A - Full weekday name."/>
|
||||
<newline/>
|
||||
<label align="0.0" string="%%b - Abbreviated month name."/>
|
||||
<label align="0.0" string="%%B - Full month name." />
|
||||
<newline/>
|
||||
<label align="0.0" string="%%c - Appropriate date and time representation." />
|
||||
<label align="0.0" string="%%d - Day of the month as a decimal number [01,31]." />
|
||||
<newline/>
|
||||
<label align="0.0" string="%%H - Hour (24-hour clock) as a decimal number [00,23]." />
|
||||
<label align="0.0" string="%%I - Hour (12-hour clock) as a decimal number [01,12]." />
|
||||
<newline/>
|
||||
<label align="0.0" string="%%j - Day of the year as a decimal number [001,366]." />
|
||||
<label align="0.0" string="%%m - Month as a decimal number [01,12]." />
|
||||
<newline/>
|
||||
<label align="0.0" string="%%M - Minute as a decimal number [00,59]." />
|
||||
<label align="0.0" string="%%p - Equivalent of either AM or PM." />
|
||||
<newline/>
|
||||
<label align="0.0" string="%%S - Second as a decimal number [00,61]." />
|
||||
<label align="0.0" string="%%w - Weekday as a decimal number [0(Sunday),6]." />
|
||||
<newline/>
|
||||
<label align="0.0" string="%%x - Appropriate date representation." />
|
||||
<label align="0.0" string="%%X - Appropriate time representation." />
|
||||
<newline/>
|
||||
<label align="0.0" string="%%y - Year without century as a decimal number [00,99]." />
|
||||
<label align="0.0" string="%%Y - Year with century as a decimal number." />
|
||||
<newline/>
|
||||
<label align="0.0" string="%%U - Week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0." />
|
||||
<label align="0.0" string="%%W - Week number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday are considered to be in week 0." />
|
||||
<newline/>
|
||||
<label align="0.0" string="======================================================" />
|
||||
</group>
|
||||
<newline/>
|
||||
<group colspan="4" col="4">
|
||||
<separator string="Examples"/>
|
||||
<newline/>
|
||||
<label align="0.0" string="1. %%c ==> Fri Dec 5 18:25:20 2008"/>
|
||||
<label align="0.0" string="2. %%a ,%%A ==> Fri, Friday"/>
|
||||
<newline/>
|
||||
<label align="0.0" string="3. %%x ,%%X ==> 12/05/08, 18:25:20"/>
|
||||
<label align="0.0" string="4. %%b, %%B ==> Dec, December"/>
|
||||
<newline/>
|
||||
<label align="0.0" string="5. %%y, %%Y ==> 08, 2008"/>
|
||||
<label align="0.0" string="6. %%d, %%m ==> 05, 12"/>
|
||||
<newline/>
|
||||
<label align="0.0" string="7. %%H:%%M:%%S ==> 18:25:20"/>
|
||||
<label align="0.0" string="8. %%I:%%M:%%S %%p ==> 06:25:20 PM"/>
|
||||
<newline/>
|
||||
<label align="0.0" string="9. %%j ==> 340"/>
|
||||
<label align="0.0" string="10. %%S ==> 20"/>
|
||||
<newline/>
|
||||
<label align="0.0" string="11. %%U or %%W ==> 48 (49th week)"/>
|
||||
<label align="0.0" string="12. %%w ==> 5 ( Friday is the 6th day)"/>
|
||||
<newline/>
|
||||
</group>
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<rng:optional><rng:attribute name="editable"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="type"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="position"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="link"/></rng:optional>
|
||||
<rng:zeroOrMore>
|
||||
<rng:choice>
|
||||
<rng:ref name="notebook"/>
|
||||
@@ -33,6 +34,7 @@
|
||||
<rng:optional><rng:attribute name="editable"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="toolbar"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="position"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="link"/></rng:optional>
|
||||
<rng:zeroOrMore>
|
||||
<rng:choice>
|
||||
<rng:ref name="field"/>
|
||||
@@ -60,6 +62,31 @@
|
||||
</rng:element>
|
||||
</rng:define>
|
||||
|
||||
<rng:define name="level">
|
||||
<rng:element name="level">
|
||||
<rng:optional><rng:attribute name="object"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="link"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="domain"/></rng:optional>
|
||||
<rng:oneOrMore>
|
||||
<rng:optional><rng:ref name="field"/></rng:optional>
|
||||
</rng:oneOrMore>
|
||||
</rng:element>
|
||||
</rng:define>
|
||||
|
||||
<rng:define name="gantt">
|
||||
<rng:element name="gantt">
|
||||
<rng:optional><rng:attribute name="color"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="date_delay"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="date_start"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="date_string"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="string"/></rng:optional>
|
||||
<rng:zeroOrMore>
|
||||
<rng:optional><rng:ref name="level"/></rng:optional>
|
||||
<rng:optional><rng:ref name="field"/></rng:optional>
|
||||
</rng:zeroOrMore>
|
||||
</rng:element>
|
||||
</rng:define>
|
||||
|
||||
<rng:define name="hpaned">
|
||||
<rng:element name="hpaned">
|
||||
<rng:optional><rng:attribute name="position"/></rng:optional>
|
||||
@@ -123,6 +150,17 @@
|
||||
<rng:optional><rng:attribute name="col"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="select"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="position"/></rng:optional>
|
||||
<rng:zeroOrMore>
|
||||
<rng:choice>
|
||||
<rng:ref name="separator"/>
|
||||
<rng:ref name="button"/>
|
||||
<rng:ref name="field"/>
|
||||
<rng:ref name="label" />
|
||||
<rng:ref name="group" />
|
||||
<rng:element name="properties"><rng:empty/></rng:element>
|
||||
<rng:element name="newline"><rng:empty/></rng:element>
|
||||
</rng:choice>
|
||||
</rng:zeroOrMore>
|
||||
</rng:element>
|
||||
</rng:define>
|
||||
|
||||
@@ -132,9 +170,10 @@
|
||||
<rng:optional><rng:attribute name="position"/></rng:optional>
|
||||
<rng:zeroOrMore>
|
||||
<rng:choice>
|
||||
<rng:ref name="notebook" />
|
||||
<rng:ref name="graph" />
|
||||
<rng:ref name="calendar" />
|
||||
<rng:ref name="notebook" />
|
||||
<rng:ref name="graph" />
|
||||
<rng:ref name="calendar" />
|
||||
<rng:ref name="gantt" />
|
||||
<rng:ref name="form"/>
|
||||
<rng:ref name="tree"/>
|
||||
<rng:ref name="field"/>
|
||||
@@ -181,13 +220,18 @@
|
||||
<rng:optional><rng:attribute name="digits"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="icon"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="mode"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="img_width"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="img_height"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="size"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="filename"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="fieldname"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="height"/></rng:optional>
|
||||
<rng:zeroOrMore>
|
||||
<rng:choice>
|
||||
<rng:ref name="form"/>
|
||||
<rng:ref name="tree"/>
|
||||
<rng:ref name="field"/>
|
||||
<rng:ref name="label"/>
|
||||
<rng:ref name="separator"/>
|
||||
<rng:ref name="xpath"/>
|
||||
<rng:ref name="button"/>
|
||||
@@ -203,12 +247,14 @@
|
||||
<rng:optional><rng:attribute name="attrs"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="col"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="colspan"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="position"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="expand"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="states"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="groups"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="string"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="fill"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="height"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="name"/></rng:optional>
|
||||
<rng:zeroOrMore>
|
||||
<rng:choice>
|
||||
<rng:ref name="separator"/>
|
||||
@@ -265,16 +311,17 @@
|
||||
<rng:optional><rng:attribute name="position"/></rng:optional>
|
||||
<rng:zeroOrMore>
|
||||
<rng:choice>
|
||||
<rng:ref name="form" />
|
||||
<rng:ref name="field" />
|
||||
<rng:ref name="tree" />
|
||||
<rng:ref name="notebook" />
|
||||
<rng:ref name="graph" />
|
||||
<rng:ref name="calendar" />
|
||||
<rng:ref name="xpath" />
|
||||
<rng:ref name="page" />
|
||||
<rng:ref name="separator"/>
|
||||
<rng:ref name="button"/>
|
||||
<rng:ref name="form" />
|
||||
<rng:ref name="field" />
|
||||
<rng:ref name="tree" />
|
||||
<rng:ref name="notebook" />
|
||||
<rng:ref name="graph" />
|
||||
<rng:ref name="calendar" />
|
||||
<rng:ref name="gantt" />
|
||||
<rng:ref name="xpath" />
|
||||
<rng:ref name="page" />
|
||||
<rng:ref name="separator"/>
|
||||
<rng:ref name="button"/>
|
||||
<rng:element name="properties"><rng:empty/></rng:element>
|
||||
<rng:element name="newline"><rng:empty/></rng:element>
|
||||
</rng:choice>
|
||||
@@ -286,11 +333,13 @@
|
||||
<rng:start>
|
||||
<rng:choice>
|
||||
<rng:ref name="form" />
|
||||
<rng:ref name="group" />
|
||||
<rng:ref name="field" />
|
||||
<rng:ref name="tree" />
|
||||
<rng:ref name="notebook" />
|
||||
<rng:ref name="graph" />
|
||||
<rng:ref name="calendar" />
|
||||
<rng:ref name="gantt" />
|
||||
<rng:ref name="xpath" />
|
||||
<rng:ref name="page" />
|
||||
<rng:ref name="separator"/>
|
||||
|
||||
+1
-1
@@ -206,7 +206,7 @@ class Logger(object):
|
||||
log = logging.getLogger(name)
|
||||
level_method = getattr(log, level)
|
||||
|
||||
result = msg.strip().split('\n')
|
||||
result = str(msg).strip().split('\n')
|
||||
if len(result)>1:
|
||||
for idx, s in enumerate(result):
|
||||
level_method('[%02d]: %s' % (idx+1, s,))
|
||||
|
||||
Reference in New Issue
Block a user