Fabien Pinckaers
2009-12-22 12:45:59 +01:00
5 changed files with 127 additions and 119 deletions
+86 -82
View File
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.6\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-12-09 10:13:57+0000\n"
"PO-Revision-Date: 2009-12-10 07:54+0000\n"
"POT-Creation-Date: 2009-12-18 08:39:22+0000\n"
"PO-Revision-Date: 2009-12-18 08:39:22+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -189,11 +189,6 @@ msgstr ""
msgid "Number of Modules"
msgstr ""
#. module: base
#: help:multi_company.default,company_dest_id:0
msgid "Company to store the current record"
msgstr ""
#. module: base
#: field:res.partner.bank.type.field,size:0
msgid "Max. Size"
@@ -718,6 +713,12 @@ msgstr ""
msgid "Iran"
msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.res_request-act
#: model:ir.ui.menu,name:base.menu_res_request_act
msgid "My Requests"
msgstr ""
#. module: base
#: field:ir.sequence,name:0
#: field:ir.sequence.type,name:0
@@ -1063,6 +1064,11 @@ msgstr ""
msgid "Fixed Width"
msgstr ""
#. module: base
#: model:res.company,overdue_msg:base.main_company
msgid "Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting department at (+32).81.81.37.00."
msgstr ""
#. module: base
#: selection:ir.ui.menu,icon:0
msgid "terp-calendar"
@@ -1098,13 +1104,8 @@ msgid "7. %H:%M:%S ==> 18:25:20"
msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.action_partner_form
#: model:ir.ui.menu,name:base.menu_base_partner
#: model:ir.ui.menu,name:base.menu_partner_form
#: view:res.partner:0
#: view:res.partner.category:0
#: field:res.partner.category,partner_ids:0
msgid "Partners"
#: help:res.users,company_id:0
msgid "The company this user is currently working on."
msgstr ""
#. module: base
@@ -1303,6 +1304,11 @@ msgstr ""
msgid "Groups"
msgstr ""
#. module: base
#: constraint:res.users:0
msgid "This user can not connect using this company !"
msgstr ""
#. module: base
#: model:res.country,name:base.bz
msgid "Belize"
@@ -1515,6 +1521,12 @@ msgstr ""
msgid "Field Mappings"
msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.res_request-closed
#: model:ir.ui.menu,name:base.next_id_12_close
msgid "My Closed Requests"
msgstr ""
#. module: base
#: model:ir.ui.menu,name:base.menu_custom
msgid "Customization"
@@ -1571,11 +1583,6 @@ msgstr ""
msgid "Iteration Actions"
msgstr ""
#. module: base
#: help:multi_company.default,company_id:0
msgid "Company where the user is connected"
msgstr ""
#. module: base
#: field:maintenance.contract,date_stop:0
msgid "Ending Date"
@@ -1778,11 +1785,6 @@ msgstr ""
msgid "Dependencies"
msgstr ""
#. module: base
#: field:multi_company.default,company_id:0
msgid "Main Company"
msgstr ""
#. module: base
#: field:ir.report.custom.fields,bgcolor:0
msgid "Background Color"
@@ -1898,6 +1900,12 @@ msgstr ""
msgid "Module"
msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.action_res_bank_form
#: model:ir.ui.menu,name:base.menu_action_res_bank_form
msgid "Bank List"
msgstr ""
#. module: base
#: field:ir.attachment,description:0
#: field:ir.module.module,description:0
@@ -2261,11 +2269,6 @@ msgstr ""
msgid "6. %d, %m ==> 05, 12"
msgstr ""
#. module: base
#: help:multi_company.default,expression:0
msgid "Expression, must be True to match"
msgstr ""
#. module: base
#: help:res.partner,customer:0
msgid "Check this box if the partner is a customer."
@@ -2370,11 +2373,6 @@ msgstr ""
msgid "Summary"
msgstr ""
#. module: base
#: field:multi_company.default,expression:0
msgid "Expression"
msgstr ""
#. module: base
#: help:ir.actions.server,subject:0
msgid "Specify the subject. You can use fields from the object, e.g. `Hello [[ object.partner_id.name ]]`"
@@ -2960,6 +2958,7 @@ msgstr ""
#. module: base
#: field:ir.rule,field_id:0
#: selection:ir.translation,type:0
#: field:multi_company.default,field_id:0
msgid "Field"
msgstr ""
@@ -3025,7 +3024,6 @@ msgstr ""
#: field:ir.rule.group,name:0
#: field:ir.values,name:0
#: field:maintenance.contract.module,name:0
#: field:multi_company.default,name:0
#: field:res.bank,name:0
#: field:res.config.view,name:0
#: field:res.lang,name:0
@@ -3546,8 +3544,6 @@ msgid "Signal (button Name)"
msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.action_res_bank_form
#: model:ir.ui.menu,name:base.menu_action_res_bank_form
#: view:res.bank:0
#: field:res.partner,bank_ids:0
msgid "Banks"
@@ -3806,6 +3802,7 @@ msgid "On Multiple Doc."
msgstr ""
#. module: base
#: model:ir.ui.menu,name:base.menu_base_config_contact
#: field:res.partner,address:0
#: view:res.partner.address:0
msgid "Contacts"
@@ -3816,11 +3813,6 @@ msgstr ""
msgid "Faroe Islands"
msgstr ""
#. module: base
#: help:multi_company.default,object_id:0
msgid "Object affect by this rules"
msgstr ""
#. module: base
#: model:ir.actions.wizard,name:base.wizard_upgrade
#: model:ir.ui.menu,name:base.menu_wizard_upgrade
@@ -4204,11 +4196,6 @@ msgstr ""
msgid "French (CH) / Français (CH)"
msgstr ""
#. module: base
#: model:ir.model,name:base.model_res_company
msgid "List of Company"
msgstr ""
#. module: base
#: selection:ir.ui.menu,icon:0
msgid "STOCK_NEW"
@@ -4319,6 +4306,11 @@ msgstr ""
msgid "res.partner.event"
msgstr ""
#. module: base
#: field:res.company,user_ids:0
msgid "Accepted Users"
msgstr ""
#. module: base
#: selection:ir.ui.menu,icon:0
msgid "STOCK_UNDERLINE"
@@ -4436,13 +4428,6 @@ msgstr ""
msgid "iCal id"
msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.action_partner_function_form
#: model:ir.ui.menu,name:base.menu_partner_function_form
#: view:res.partner.function:0
msgid "Partner Functions"
msgstr ""
#. module: base
#: wizard_view:res.partner.sms_send,init:0
msgid "Bulk SMS send"
@@ -4575,11 +4560,6 @@ msgstr ""
msgid "Full"
msgstr ""
#. module: base
#: field:multi_company.default,company_dest_id:0
msgid "Default Company"
msgstr ""
#. module: base
#: model:res.country,name:base.as
msgid "American Samoa"
@@ -4817,6 +4797,7 @@ msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.action_res_company_form
#: model:ir.ui.menu,name:base.menu_action_res_company_form
#: model:ir.ui.menu,name:base.menu_res_company_global
#: view:res.company:0
msgid "Companies"
msgstr ""
@@ -5242,9 +5223,10 @@ msgid "Active Partner Events"
msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.action_rule
#: model:ir.ui.menu,name:base.menu_action_rule
msgid "Record Rules"
#: model:ir.actions.act_window,name:base.action_partner_function_form
#: model:ir.ui.menu,name:base.menu_partner_function_form
#: view:res.partner.function:0
msgid "Contact Functions"
msgstr ""
#. module: base
@@ -5537,8 +5519,6 @@ msgid "Martinique (French)"
msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.res_request-act
#: model:ir.ui.menu,name:base.menu_res_request_act
#: model:ir.ui.menu,name:base.next_id_12
#: view:res.request:0
msgid "Requests"
@@ -5795,6 +5775,11 @@ msgstr ""
msgid "Rounding factor"
msgstr ""
#. module: base
#: model:ir.model,name:base.model_res_company
msgid "res.company"
msgstr ""
#. module: base
#: wizard_view:module.upgrade,end:0
#: wizard_view:module.upgrade,start:0
@@ -5875,6 +5860,11 @@ msgstr ""
msgid "Hour 00->24: %(h24)s"
msgstr ""
#. module: base
#: help:multi_company.default,field_id:0
msgid "Select field property"
msgstr ""
#. module: base
#: field:res.request.history,date_sent:0
msgid "Date sent"
@@ -5894,7 +5884,6 @@ msgstr ""
#: view:ir.sequence:0
#: field:ir.ui.menu,sequence:0
#: field:ir.ui.view_sc,sequence:0
#: field:multi_company.default,sequence:0
#: field:res.partner.bank,sequence:0
#: field:wizard.ir.model.menu.create.line,sequence:0
msgid "Sequence"
@@ -5959,6 +5948,11 @@ msgstr ""
msgid "Parent"
msgstr ""
#. module: base
#: view:multi_company.default:0
msgid "Returning"
msgstr ""
#. module: base
#: field:ir.actions.act_window,res_model:0
#: field:ir.actions.report.custom,model:0
@@ -5977,7 +5971,6 @@ msgstr ""
#: selection:ir.translation,type:0
#: field:ir.ui.view,model:0
#: field:ir.values,model_id:0
#: field:multi_company.default,object_id:0
#: field:res.request.link,object:0
#: field:wizard.ir.model.menu.create,model_id:0
#: field:workflow.triggers,model:0
@@ -6674,6 +6667,17 @@ msgstr ""
msgid "Landscape"
msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.action_partner_form
#: model:ir.ui.menu,name:base.menu_base_config_partner
#: model:ir.ui.menu,name:base.menu_base_partner
#: model:ir.ui.menu,name:base.menu_partner_form
#: view:res.partner:0
#: view:res.partner.category:0
#: field:res.partner.category,partner_ids:0
msgid "Partners"
msgstr ""
#. module: base
#: model:ir.ui.menu,name:base.menu_administration
msgid "Administration"
@@ -6888,11 +6892,6 @@ msgstr ""
msgid "Second field should be figures"
msgstr ""
#. module: base
#: help:multi_company.default,name:0
msgid "Name it to easily find a record"
msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.action_model_grid_security
#: model:ir.ui.menu,name:base.menu_ir_access_grid
@@ -7015,11 +7014,6 @@ msgstr ""
msgid "Bank Accounts"
msgstr ""
#. module: base
#: model:ir.model,name:base.model_multi_company_default
msgid "Default multi company"
msgstr ""
#. module: base
#: view:res.request:0
msgid "Send"
@@ -7108,12 +7102,6 @@ msgstr ""
msgid "https://translations.launchpad.net/openobject"
msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.action_partner_title
#: model:ir.ui.menu,name:base.menu_partner_title
msgid "Titles"
msgstr ""
#. module: base
#: field:ir.actions.todo,start_date:0
msgid "Start Date"
@@ -7185,6 +7173,11 @@ msgstr ""
msgid "Delete Permission"
msgstr ""
#. module: base
#: model:ir.model,name:base.model_multi_company_default
msgid "multi_company.default"
msgstr ""
#. module: base
#: selection:workflow.activity,join_mode:0
#: selection:workflow.activity,split_mode:0
@@ -7441,6 +7434,11 @@ msgstr ""
msgid "Rwanda"
msgstr ""
#. module: base
#: constraint:res.partner:0
msgid "The VAT doesn't seem to be correct."
msgstr ""
#. module: base
#: selection:ir.report.custom.fields,operation:0
msgid "Calculate Sum"
@@ -7578,6 +7576,12 @@ msgstr ""
msgid "ir.actions.server"
msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.action_rule
#: model:ir.ui.menu,name:base.menu_action_rule
msgid "Record Rules"
msgstr ""
#. module: base
#: view:ir.actions.report.custom:0
msgid "Report custom"
+1 -12
View File
@@ -25,17 +25,6 @@ from osv import osv,fields
# Properties
# -------------------------------------------------------------------------
def _models_get2(self, cr, uid, context={}):
obj = self.pool.get('ir.model.fields')
ids = obj.search(cr, uid, [('view_load','=',1)])
res = []
done = {}
for o in obj.browse(cr, uid, ids, context=context):
if o.relation not in done:
res.append( [o.relation, o.relation])
done[o.relation] = True
return res
def _models_get(self, cr, uid, context={}):
obj = self.pool.get('ir.model.fields')
ids = obj.search(cr, uid, [('view_load','=',1)])
@@ -51,7 +40,7 @@ class ir_property(osv.osv):
_name = 'ir.property'
_columns = {
'name': fields.char('Name', size=128),
'value': fields.reference('Value', selection=_models_get2, size=128),
'value': fields.char('Value', size=128),
'res_id': fields.reference('Resource', selection=_models_get, size=128),
'company_id': fields.many2one('res.company', 'Company'),
'fields_id': fields.many2one('ir.model.fields', 'Fields', ondelete='cascade', required=True)
+10 -2
View File
@@ -45,6 +45,7 @@ class multi_company_default(osv.osv):
help='Object affect by this rules'),
'expression': fields.char('Expression', size=32, required=True,
help='Expression, must be True to match'),
'field_id': fields.many2one('ir.model.fields', 'Field', help='Select field property'),
}
_defaults = {
@@ -88,7 +89,7 @@ class res_company(osv.osv):
}
def _company_default_get(self, cr, uid, object=False, context=None):
def _company_default_get(self, cr, uid, object=False, field=False, context=None):
"""
Check if the object for this company have a default value
"""
@@ -96,7 +97,14 @@ class res_company(osv.osv):
context = {}
user_company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
proxy = self.pool.get('multi_company.default')
ids = proxy.search(cr, uid, [('object_id.model', '=', object), ('company_id','=',user_company_id)])
args = [
('object_id.model', '=', object),
]
if field:
args.append(('field_id.name','=',field))
else:
args.append(('field_id','=',False))
ids = proxy.search(cr, uid, args)
for rule in proxy.browse(cr, uid, ids, context):
user = self.pool.get('res.users').browse(cr, uid, uid)
if eval(rule.expression, {'context': context, 'user': user}):
+4 -1
View File
@@ -11,6 +11,7 @@
<tree string="Multi Company">
<field name="company_id" groups="base.group_multi_company"/>
<field name="object_id"/>
<field name="field_id"/>
<field name="expression" />
<field name="sequence"/>
<field name="company_dest_id"/>
@@ -30,10 +31,12 @@
<separator string="Matching" colspan="6"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="object_id"/>
<field name="company_dest_id"/>
<field name="field_id" domain="[('model_id','=',object_id)]"/>
<separator string="Condition" colspan="6"/>
<field name="expression" colspan="4"/>
<field name="sequence"/>
<separator string="Returning" colspan="6"/>
<field name="company_dest_id"/>
</group>
</form>
</field>
+26 -22
View File
@@ -856,9 +856,12 @@ class property(function):
if nid:
default_val = property.browse(cr, uid, nid[0], context).value
company_id = obj.pool.get('res.users').company_get(cr, uid, uid)
company_id = obj.pool.get('res.company')._company_default_get(cr, uid, obj._name, prop, context=context)
res = False
newval = (id_val and obj_dest+','+str(id_val)) or False
if val[0]:
newval = (id_val and obj_dest+','+str(id_val)) or False
else:
newval = id_val or False
if (newval != default_val) and newval:
propdef = obj.pool.get('ir.model.fields').browse(cr, uid,
definition_id, context=context)
@@ -892,27 +895,28 @@ class property(function):
for id in ids:
res[id] = default_val
for prop in property.browse(cr, uid, nids):
res[int(prop.res_id.split(',')[1])] = (prop.value and \
int(prop.value.split(',')[1])) or False
obj = obj.pool.get(self._obj)
to_check = res.values()
if default_val and default_val not in to_check:
to_check += [default_val]
existing_ids = obj.search(cr, uid, [('id', 'in', to_check)])
for id, res_id in res.items():
if res_id not in existing_ids:
cr.execute('DELETE FROM ir_property WHERE value=%s', ((obj._name+','+str(res_id)),))
res[id] = default_val
names = dict(obj.name_get(cr, uid, existing_ids, context))
for r in res.keys():
if res[r] and res[r] in names:
res[r] = (res[r], names[res[r]])
if prop.value.find(',') >= 0:
res[int(prop.res_id.split(',')[1])] = (prop.value and \
int(prop.value.split(',')[1])) or False
else:
res[r] = False
res[int(prop.res_id.split(',')[1])] = prop.value or ''
if self._obj:
obj = obj.pool.get(self._obj)
to_check = res.values()
if default_val and default_val not in to_check:
to_check += [default_val]
existing_ids = obj.search(cr, uid, [('id', 'in', to_check)])
for id, res_id in res.items():
if res_id not in existing_ids:
cr.execute('DELETE FROM ir_property WHERE value=%s', ((obj._name+','+str(res_id)),))
res[id] = default_val
names = dict(obj.name_get(cr, uid, existing_ids, context))
for r in res.keys():
if res[r] and res[r] in names:
res[r] = (res[r], names[res[r]])
else:
res[r] = False
return res
def _field_get(self, cr, uid, model_name, prop):