[MERGE] Merged with server (trunk).

bzr revid: tde@openerp.com-20120702130351-55nv9m0b2xg4p54l
This commit is contained in:
Thibault Delavallée 2012-07-02 15:03:51 +02:00
commit db366d1699
20 changed files with 141 additions and 155 deletions

View File

@ -222,9 +222,10 @@ class act_window(osv.osv):
help="Optional domain filtering of the destination data, as a Python expression"),
'context': fields.char('Context Value', size=250, required=True,
help="Context dictionary as Python expression, empty by default (Default: {})"),
'res_model': fields.char('Object', size=64, required=True,
'res_id': fields.integer('Record ID', help="Database ID of record to open in form view, when ``view_mode`` is set to 'form' only"),
'res_model': fields.char('Destination Model', size=64, required=True,
help="Model name of the object to open in the view window"),
'src_model': fields.char('Source Object', size=64,
'src_model': fields.char('Source Model', size=64,
help="Optional model name of the objects on which this action should be visible"),
'target': fields.selection([('current','Current Window'),('new','New Window'),('inline','Inline')], 'Target Window'),
'view_type': fields.selection((('tree','Tree'),('form','Form')), string='View Type', required=True,

View File

@ -8,8 +8,9 @@
<field name="arch" type="xml">
<form string="Create Menu" version="7.0">
<header>
<button name="menu_create" string="Create _Menu" type="object"/>
<button special="cancel" string="_Cancel"/>
<button name="menu_create" string="Create _Menu" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<group>
<field name="name"/>

View File

@ -7,7 +7,12 @@
<field name="model">base.language.export</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Export Translations">
<form string="Export Translations" version="7.0">
<header>
<button name="act_getfile" string="_Export" type="object" states="choose" class="oe_highlight"/>
<label string="or" states="choose"/>
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<group col="8">
<group colspan="3">
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
@ -35,17 +40,6 @@
<field height="80" name="advice" nolabel="1" colspan="4"/>
</group>
</group>
<group colspan="8" col="8" states="choose">
<separator string="" colspan="8"/>
<label colspan="6" width="220"/>
<button icon="gtk-cancel" name="act_cancel" special="cancel" string="_Close" type="object"/>
<button icon="gtk-ok" name="act_getfile" string="_Export" type="object"/>
</group>
<group colspan="8" col="8" states="get">
<separator string="" colspan="8"/>
<label colspan="7" width="220"/>
<button icon="gtk-close" name="act_destroy" special="cancel" string="_Close" type="object"/>
</group>
</group>
</form>
</field>

View File

@ -9,16 +9,19 @@
<field name="arch" type="xml">
<form string="Import Translation" version="7.0">
<header>
<button name="import_lang" string="_Import" type="object" icon="gtk-ok"/>
<button special="cancel" string="_Close" icon="gtk-cancel"/>
<button name="import_lang" string="_Import" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<separator string="Import Translation" colspan="2"/>
<label nolabel="1" string="If you need another language than the official ones available, you can import a language pack from here. Other OpenERP languages than the official ones can be found on launchpad." colspan="2"/>
<group col="4">
<field name="name"/>
<field name="code"/>
<field name="data"/>
<field name="overwrite"/>
<group>
<separator string="Import Translation" colspan="2"/>
<label nolabel="1" string="If you need another language than the official ones available, you can import a language pack from here. Other OpenERP languages than the official ones can be found on launchpad." colspan="2"/>
<group col="4">
<field name="name"/>
<field name="code"/>
<field name="data"/>
<field name="overwrite"/>
</group>
</group>
</form>
</field>

View File

@ -7,7 +7,12 @@
<field name="model">base.language.install</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Load a Translation">
<form string="Load a Translation" version="7.0">
<header>
<button name="lang_install" string="Load" type="object" states="init" class="oe_highlight"/>
<label string="or" states="init"/>
<button string="Cancel" class="oe_link" special="cancel"/>
</header>
<group colspan="4" col="8">
<group colspan="1">
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
@ -30,17 +35,6 @@ You must change the preferences of the user and open a new menu to view the chan
</group>
</group>
</group>
<group colspan="8" col="8" states="init">
<separator string="" colspan="8"/>
<label colspan="6" width="220"/>
<button special="cancel" string="Cancel" icon="gtk-cancel" colspan="1"/>
<button name="lang_install" string="Load" type="object" icon="gtk-ok" colspan="1"/>
</group>
<group colspan="8" col="8" states="done">
<separator string="" colspan="8"/>
<label colspan="7" width="220"/>
<button special="cancel" string="Close" icon="gtk-ok"/>
</group>
</form>
</field>
</record>

View File

@ -9,7 +9,7 @@
<field name="arch" type="xml">
<form string="System Configuration Done" version="7.0">
<header>
<button special="cancel" string="_Ok"/>
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<label string="All pending configuration wizards have been executed. You may restart individual wizards via the list of configuration wizards."/>
</form>

View File

@ -7,7 +7,14 @@
<field name="model">base.module.import</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Import module">
<form string="Import module" version="7.0">
<header>
<button name="importzip" string="Import module" type="object" states="init" class="oe_highlight"/>
<label string="or" states="init"/>
<button name="action_module_open" string="Open Modules" type="object" states="done" class="oe_highlight"/>
<label string="or" states="done"/>
<button string="Cancel" class="oe_link" special="cancel"/>
</header>
<group col="8">
<group colspan="3" col="1">
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
@ -29,18 +36,6 @@ After importing a new module you can install it by clicking on the button "Insta
<label string="Module file successfully imported!" colspan="4"/>
</group>
</group>
<group colspan="8" col="8" states="init">
<separator string="" colspan="8"/>
<label colspan="6" width="220"/>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="importzip" string="Import module" type="object" icon="gtk-apply"/>
</group>
<group colspan="8" col="8" states="done">
<separator string="" colspan="8"/>
<label colspan="6" width="220"/>
<button special="cancel" string="Close" icon="gtk-ok"/>
<button name="action_module_open" string="Open Modules" type="object" icon="gtk-go-forward"/>
</group>
</group>
</form>
</field>

View File

@ -9,8 +9,9 @@
<field name="arch" type="xml">
<form string="Scan for new modules" version="7.0">
<header>
<button name="watch_dir" string="Check new modules" type="object" icon="gtk-ok"/>
<button special="cancel" string="Close" icon="gtk-cancel"/>
<button name="watch_dir" string="Check new modules" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<label string="This function will check if you installed new modules in the 'addons' path of your server installation."/>
</form>

View File

@ -7,7 +7,14 @@
<field name="model">base.module.update</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Update Module List">
<form string="Update Module List" version="7.0">
<header>
<button name="update_module" string="Update" type="object" states="init" class="oe_highlight"/>
<label string="or" states="init"/>
<button name="action_module_open" string="Open Modules" type="object" states="done" class="oe_highlight"/>
<label string="or" states="done"/>
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<group col="8">
<group colspan="3">
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
@ -28,18 +35,6 @@
<field name="add" colspan="4"/>
</group>
</group>
<group colspan="8" col="8" states="init">
<separator string="" colspan="8"/>
<label colspan="6" width="220"/>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="update_module" string="Update" type="object" icon="gtk-ok"/>
</group>
<group colspan="8" col="8" states="done">
<separator string="" colspan="8"/>
<label colspan="6" width="220"/>
<button special="cancel" string="Close" icon="gtk-ok"/>
<button name="action_module_open" string="Open Modules" type="object" icon="gtk-go-forward"/>
</group>
</group>
</form>
</field>

View File

@ -46,16 +46,19 @@ class base_module_upgrade(osv.osv_memory):
ids = self.get_module_list(cr, uid, context=context)
if not ids:
res['arch'] = '''<form string="Apply Scheduled Upgrades" version="7.0">
<header>
<button name="config" string="Start configuration" type="object" icon="gtk-ok"/>
<button special="cancel" string="Close" icon="gtk-cancel"/>
</header>
<separator string="System update completed" colspan="4"/>
<label align="0.0" string="The selected modules have been updated / installed !" colspan="4"/>
<label align="0.0" string="We suggest to reload the menu tab to see the new menus (Ctrl+T then Ctrl+R)." colspan="4"/>
</form>'''
res['arch'] = """
<form string="Apply Scheduled Upgrades" version="7.0">
<header>
<button name="config" string="Start configuration" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</header>
<separator string="System update completed"/>
<label string="The selected modules have been updated / installed !"/>
<newline/>
<label string="We suggest to reload the page to see the new menus."/>
</form>
"""
return res
def get_module_list(self, cr, uid, context=None):
@ -80,14 +83,14 @@ class base_module_upgrade(osv.osv_memory):
JOIN ir_module_module_dependency d ON (m.id = d.module_id)
LEFT JOIN ir_module_module m2 ON (d.name = m2.name)
WHERE m.id in %s and (m2.state IS NULL or m2.state IN %s)""",
(tuple(ids), ('uninstalled',)))
(tuple(ids), ('uninstalled',)))
unmet_packages = [x[0] for x in cr.fetchall()]
if unmet_packages:
raise osv.except_osv(_('Unmet dependency !'),
_('Following modules are not installed or unknown: %s') % ('\n\n' + '\n'.join(unmet_packages)))
ir_module.download(cr, uid, ids, context=context)
cr.commit() # save before re-creating cursor below
cr.commit() # save before re-creating cursor below
pooler.restart_pool(cr.dbname, update_module=True)

View File

@ -9,11 +9,12 @@
<field name="arch" type="xml">
<form string="System Update" version="7.0">
<header>
<button name="upgrade_module" string="Update" type="object" icon="gtk-go-forward"/>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="upgrade_module" string="Update" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</header>
<label string="Your system will be updated."/>
<label string="Note that this operation might take a few minutes."/>
<div><label string="Your system will be updated."/></div>
<div><label string="Note that this operation might take a few minutes."/></div>
<separator string="Modules to Update"/>
<field name="module_info"/>
</form>
@ -45,11 +46,12 @@
<field name="arch" type="xml">
<form string="Apply Scheduled Upgrades" version="7.0">
<header>
<button name="config" string="Start configuration" type="object" icon="gtk-ok"/>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="config" string="Start configuration" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</header>
<label string="The selected modules have been updated / installed !"/>
<label string="We suggest to reload the menu tab to see the new menus (Ctrl+T then Ctrl+R)."/>
<div><label string="The selected modules have been updated / installed !"/></div>
<div><label string="We suggest to reload the menu tab to see the new menus (Ctrl+T then Ctrl+R)."/></div>
</form>
</field>
</record>

View File

@ -6,7 +6,12 @@
<field name="model">base.update.translations</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Synchronize Terms">
<form string="Synchronize Terms" version="7.0">
<header>
<button name="act_update" string="Update" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</header>
<group col="8">
<group colspan="3">
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
@ -18,12 +23,6 @@
<separator string="Synchronize Translation" colspan="4"/>
<field name="lang" colspan="4"/>
</group>
<group colspan="8" col="8">
<separator string="" colspan="8"/>
<label colspan="6" width="220"/>
<button icon="gtk-cancel" name="act_cancel" special="cancel" string="Cancel" type="object"/>
<button icon="gtk-ok" name="act_update" string="Update" type="object"/>
</group>
</group>
</form>
</field>

View File

@ -24,30 +24,30 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Publisher Warranty Contract" version="7.0">
<header>
<button name="check_validity" string="Validate" type="object"
attrs="{'invisible':[('state','in',['valid', 'terminated', 'canceled'])]}"/>
<button name="check_validity" string="Refresh Validation Dates" type="object"
attrs="{'invisible':[('state','in',['unvalidated'])]}"/>
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<sheet>
<group col="3" colspan="4">
<group col="2">
<group col="3">
<group>
<field name="name"/>
</group>
<group col="2">
<group>
<field name="date_start"/>
<field name="date_stop"/>
<field name="check_support"/>
</group>
<group col="2">
<group>
<field name="state"/>
<field name="kind"/>
<field name="check_opw"/>
</group>
<group col="2" colspan="3">
<button name="check_validity" icon="camera_test.png
" string="Validate" type="object"
attrs="{'invisible':[('state','in',['valid', 'terminated', 'canceled'])]}"/>
<button name="check_validity" icon="camera_test.png" string="Refresh Validation Dates" type="object"
attrs="{'invisible':[('state','in',['unvalidated'])]}"/>
</group>
</group>
</sheet>
</sheet>
</form>
</field>
</record>
@ -93,7 +93,12 @@
<field name="model">publisher_warranty.contract.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Register a Contract">
<form string="Register a Contract" version="7.0">
<header>
<button name="action_validate" string="Register" type="object" states="draft" class="oe_highlight" />
<label string="or" states="draft"/>
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<group colspan="4" col="8">
<group colspan="1">
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
@ -115,17 +120,6 @@
</group>
</group>
</group>
<group colspan="8" col="8" states="draft">
<separator string="" colspan="8"/>
<label colspan="6" width="220"/>
<button special="cancel" string="Cancel" icon="gtk-cancel" colspan="1"/>
<button name="action_validate" string="Register" type="object" icon="gtk-apply" colspan="1"/>
</group>
<group colspan="8" col="8" states="finished">
<separator string="" colspan="8"/>
<label colspan="7" width="220"/>
<button special="cancel" string="Close" icon="gtk-ok"/>
</group>
</form>
</field>
</record>

View File

@ -7,10 +7,9 @@
<field name="arch" type="xml">
<form version="7.0">
<header>
<button name="action_next" type="object"
string="Apply" icon="gtk-go-forward" class="oe_highlight"/>
<button name="action_skip" type="object" special="cancel"
string="Cancel" icon="gtk-jump-to"/>
<button name="action_next" type="object" string="Apply" class="oe_highlight"/>
or
<button name="action_skip" type="object" special="cancel" string="Cancel" class="oe_link"/>
</header>
<group string="res_config_contents"/>
</form>
@ -24,10 +23,13 @@
<field name="arch" type="xml">
<form string="Next Configuration Step" version="7.0">
<header>
<button name="action_next" type="object"
string="Continue" icon="gtk-go-forward" class="oe_highlight"/>
<button name="action_next" type="object" string="Continue" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<field name="note"/>
<group>
<field name="note"/>
</group>
</form>
</field>
</record>
@ -39,10 +41,9 @@
<field name="arch" type="xml">
<form version="7.0">
<header>
<button name="action_next" type="object"
string="Install Modules" icon="gtk-go-forward" class="oe_highlight"/>
<button name="action_skip" type="object" special="cancel"
string="Cancel" icon="gtk-jump-to"/>
<button name="action_next" type="object" string="Install Modules" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<separator string="title" colspan="4"/>
</form>

View File

@ -45,7 +45,7 @@
<field name="search_view_id" ref="view_res_widget_search"/>
</record>
<menuitem action="res_widget_act_window" id="menu_res_widget_act_window" parent="base.next_id_2" />
<record id="res_widget_user_tree" model="ir.ui.view">
<field name="name">res.widget.user.tree</field>
<field name="model">res.widget.user</field>
@ -70,7 +70,7 @@
<field name="user_id"/>
<field name="sequence"/>
</group>
</sheet>
</sheet>
</form>
</field>
</record>
@ -89,10 +89,13 @@
<field name="arch" type="xml">
<form string="Widget Wizard" col="4" version="7.0">
<header>
<button name="res_widget_add" string="Add" type="object"/>
<button special="cancel" string="Cancel" icon="gtk-cancel" />
<button name="res_widget_add" string="Add" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<field name="widgets_list"/>
<group>
<field name="widgets_list"/>
</group>
</form>
</field>
</record>

View File

@ -677,6 +677,7 @@
<rng:optional><rng:attribute name="context"/></rng:optional>
<rng:optional><rng:attribute name="confirm"/></rng:optional>
<rng:optional><rng:attribute name="help"/></rng:optional>
<rng:optional><rng:attribute name="class"/></rng:optional>
<rng:optional><rng:attribute name="default_focus"/></rng:optional>
<rng:zeroOrMore>
<rng:choice>

View File

@ -1,5 +1,5 @@
.oe_module_vignette {
padding: 14px;
padding: 8px;
}
.oe_module_icon, .oe_module_desc {
display: inline-block;

View File

@ -1737,6 +1737,15 @@ class BaseModel(object):
# translate view
if 'lang' in context:
if node.text and node.text.strip():
trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.text.strip())
if trans:
node.text = trans
if node.tail and node.tail.strip():
trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.tail.strip())
if trans:
node.tail = trans
if node.get('string') and not result:
trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.get('string'))
if trans == node.get('string') and ('base_model_name' in context):
@ -1745,22 +1754,13 @@ class BaseModel(object):
trans = self.pool.get('ir.translation')._get_source(cr, user, context['base_model_name'], 'view', context['lang'], node.get('string'))
if trans:
node.set('string', trans)
if node.get('confirm'):
trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.get('confirm'))
if trans:
node.set('confirm', trans)
if node.get('sum'):
trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.get('sum'))
if trans:
node.set('sum', trans)
if node.get('help'):
trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.get('help'))
if trans:
node.set('help', trans)
if node.get('placeholder'):
trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.get('placeholder'))
if trans:
node.set('placeholder', trans)
for attr_name in ('confirm', 'sum', 'help', 'placeholder'):
attr_value = node.get(attr_name)
if attr_value:
trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], attr_value)
if trans:
node.set(attr_name, trans)
for f in node:
if children or (node.tag == 'field' and f.tag in ('filter','separator')):

View File

@ -38,11 +38,6 @@
<button name="generate_undefined" string="Undefined" type="object" icon="gtk-ok" colspan="1"/>
<label string="Server error-traceback"/>
</group>
<group colspan="8" col="8">
<separator string="" colspan="8"/>
<label colspan="6" width="220"/>
<button special="cancel" string="Cancel" icon="gtk-cancel" colspan="1"/>
</group>
</form>
</field>
</record>

View File

@ -501,6 +501,10 @@ def trans_parse_rml(de):
def trans_parse_view(de):
res = []
if de.text and de.text.strip():
res.append(de.text.strip().encode("utf8"))
if de.tail and de.tail.strip():
res.append(de.tail.strip().encode("utf8"))
if de.tag == 'attribute' and de.get("name") == 'string':
if de.text:
res.append(de.text.encode("utf8"))