[merge] from trunk
bzr revid: xmo@tinyerp.com-20091207144452-lwnkx46om3a21b94 bzr revid: xmo@tinyerp.com-20091208151256-lq7n9r51e99pfkxg bzr revid: xmo@tinyerp.com-20091210111114-zoaop8nqhpfd8j22 bzr revid: xmo@tinyerp.com-20091211090051-9und4m828igz0q54 bzr revid: xmo@tinyerp.com-20091214083220-ki7zuginy2467h4h bzr revid: xmo@tinyerp.com-20091214132934-p732a77qq6zo261s
This commit is contained in:
commit
d980d96150
|
@ -46,6 +46,7 @@
|
|||
'module/module_report.xml',
|
||||
'res/res_request_view.xml',
|
||||
'res/res_lang_view.xml',
|
||||
'res/res_company_view.xml',
|
||||
'res/partner/partner_report.xml',
|
||||
'res/partner/partner_view.xml',
|
||||
'res/partner/partner_wizard.xml',
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
<form string="Users">
|
||||
<field name="password" password="True" readonly="0"/>
|
||||
<label colspan="4" string="Please note that you will have to logout and relog if you change your password."/>
|
||||
<field name="company"/>
|
||||
<field name="company_id" widget="selection"/>
|
||||
<field name="context_lang" completion="1" readonly="0"/>
|
||||
<field name="context_tz" completion="1" readonly="0" colspan="4"/>
|
||||
<newline/>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -150,8 +150,12 @@
|
|||
<tree string="Sequences">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="active"/>
|
||||
<field name="company_id"/>
|
||||
<field name="number_next"/>
|
||||
<field name="number_increment"/>
|
||||
<field name="prefix"/>
|
||||
<field name="padding"/>
|
||||
<field name="active"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -428,6 +432,11 @@
|
|||
<menuitem action="ir_action_wizard" id="menu_ir_action_wizard" parent="base.next_id_6"/>
|
||||
|
||||
<!-- Companies -->
|
||||
<menuitem id="menu_res_company_global"
|
||||
parent="base.menu_administration"
|
||||
name="Companies"
|
||||
sequence="5"/>
|
||||
|
||||
<record id="action_res_company_tree" model="ir.actions.act_window">
|
||||
<field name="name">Company's Structure</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -435,7 +444,7 @@
|
|||
<field name="domain">[('parent_id','=',False)]</field>
|
||||
<field name="view_type">tree</field>
|
||||
</record>
|
||||
<menuitem action="action_res_company_tree" id="menu_action_res_company_tree" parent="base.menu_users" sequence="16"/>
|
||||
<menuitem action="action_res_company_tree" id="menu_action_res_company_tree" parent="base.menu_res_company_global" sequence="16"/>
|
||||
|
||||
<record id="action_res_company_form" model="ir.actions.act_window">
|
||||
<field name="name">Companies</field>
|
||||
|
@ -443,7 +452,7 @@
|
|||
<field name="res_model">res.company</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
<menuitem action="action_res_company_form" id="menu_action_res_company_form" parent="menu_action_res_company_tree"/>
|
||||
<menuitem action="action_res_company_form" id="menu_action_res_company_form" parent="base.menu_res_company_global"/>
|
||||
|
||||
<!-- User Roles -->
|
||||
<record id="action_res_users" model="ir.actions.act_window">
|
||||
|
@ -1128,8 +1137,8 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Record rules">
|
||||
<field name="model_id"/>
|
||||
<field name="global"/>
|
||||
<field name="model_id" select="1"/>
|
||||
<field name="global" select="1"/>
|
||||
<field colspan="4" name="name"/>
|
||||
<group col="6" colspan="4" expand="1">
|
||||
<field colspan="6" name="rules" nolabel="1"/>
|
||||
|
|
|
@ -29,12 +29,7 @@ import re
|
|||
import copy
|
||||
import sys
|
||||
|
||||
try:
|
||||
from xml import dom, xpath
|
||||
except ImportError:
|
||||
sys.stderr.write("ERROR: Import xpath module\n")
|
||||
sys.stderr.write("ERROR: Try to install the old python-xml package\n")
|
||||
sys.exit(2)
|
||||
from xml import dom
|
||||
|
||||
class actions(osv.osv):
|
||||
_name = 'ir.actions.actions'
|
||||
|
@ -350,7 +345,7 @@ class ir_model_fields(osv.osv):
|
|||
'complete_name': fields.char('Complete Name', size=64, select=1),
|
||||
}
|
||||
|
||||
def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=80):
|
||||
def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
|
||||
return super(ir_model_fields, self).name_search(cr, uid, name, args, operator, context, limit)
|
||||
# def get_fields(cr, uid, field, rel):
|
||||
# result = []
|
||||
|
|
|
@ -40,7 +40,7 @@ class Country(osv.osv):
|
|||
]
|
||||
|
||||
def name_search(self, cr, user, name='', args=None, operator='ilike',
|
||||
context=None, limit=80):
|
||||
context=None, limit=100):
|
||||
if not args:
|
||||
args=[]
|
||||
if not context:
|
||||
|
@ -81,7 +81,7 @@ class CountryState(osv.osv):
|
|||
help='The state code in three chars.\n', required=True),
|
||||
}
|
||||
def name_search(self, cr, user, name='', args=None, operator='ilike',
|
||||
context=None, limit=80):
|
||||
context=None, limit=100):
|
||||
if not args:
|
||||
args = []
|
||||
if not context:
|
||||
|
|
|
@ -199,7 +199,7 @@ class res_partner(osv.osv):
|
|||
res = [(r['id'], r[rec_name]) for r in self.read(cr, uid, ids, [rec_name], context)]
|
||||
return res
|
||||
|
||||
def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=80):
|
||||
def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
|
||||
if not args:
|
||||
args=[]
|
||||
if not context:
|
||||
|
@ -317,7 +317,7 @@ class res_partner_address(osv.osv):
|
|||
res.append((r['id'], addr.strip() or '/'))
|
||||
return res
|
||||
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
|
||||
if not args:
|
||||
args=[]
|
||||
if not context:
|
||||
|
|
|
@ -96,7 +96,6 @@
|
|||
<field name="function"/>
|
||||
<newline/>
|
||||
<group string="Postal Address" colspan="2" col="2">
|
||||
<field name="type" select="2" />
|
||||
<field name="street" select="2"/>
|
||||
<field name="street2"/>
|
||||
<field name="zip" select="2"/>
|
||||
|
@ -105,6 +104,7 @@
|
|||
<field name="state_id" select="2"/>
|
||||
</group>
|
||||
<group string="Communication" colspan="2" col="2">
|
||||
<field name="type" select="2" />
|
||||
<field name="phone"/>
|
||||
<field name="fax"/>
|
||||
<field name="mobile" select="2"/>
|
||||
|
@ -255,12 +255,14 @@
|
|||
<page string="General">
|
||||
<field colspan="4" mode="form,tree" name="address" nolabel="1" select="1" height="260">
|
||||
<form string="Partner Contacts">
|
||||
<group colspan="4" col="4">
|
||||
<field name="name" select="2"/>
|
||||
<field domain="[('domain', '=', 'contact')]" name="title" string="Type"/>
|
||||
<field name="function"/>
|
||||
<field name="type" select="2" colspan="4"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group string="Postal Address" colspan="2" col="4">
|
||||
<field name="type" select="2" colspan="4"/>
|
||||
<field name="street" select="2" colspan="4"/>
|
||||
<field name="street2" colspan="4"/>
|
||||
<field name="zip" select="2"/>
|
||||
|
@ -295,7 +297,7 @@
|
|||
<field name="website" widget="url"/>
|
||||
<field name="date" select="2"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="company_id" groups="base.group_extended" widget="selection"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<newline/>
|
||||
</page>
|
||||
<page string="History">
|
||||
|
@ -322,9 +324,10 @@
|
|||
<filter string="Customers" icon="terp-partner" domain="[('customer','=',1)]" help="Customer Partners"/>
|
||||
<filter string="Suppliers" icon="terp-partner" domain="[('supplier','=',1)]" help="Supplier Partners"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select='1'/>
|
||||
<field name="country" select='1'/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="country" select="1"/>
|
||||
<field name="address" select="1"/>
|
||||
<field name="category_id" select="1"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
|
|
@ -19,13 +19,58 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields,osv
|
||||
from osv import osv
|
||||
from osv import fields
|
||||
import os
|
||||
import tools
|
||||
from tools.translate import _
|
||||
|
||||
|
||||
class multi_company_default(osv.osv):
|
||||
"""
|
||||
Manage multi company default value
|
||||
"""
|
||||
_name = 'multi_company.default'
|
||||
_description = 'Default multi company'
|
||||
_order = 'company_id,sequence,id'
|
||||
|
||||
_columns = {
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'name': fields.char('Name', size=32, required=True, help='Name it to easily find a record'),
|
||||
'company_id': fields.many2one('res.company', 'Main Company', required=True,
|
||||
help='Company where the user is connected'),
|
||||
'company_dest_id': fields.many2one('res.company', 'Default Company', required=True,
|
||||
help='Company to store the current record'),
|
||||
'object_id': fields.many2one('ir.model', 'Object', required=True,
|
||||
help='Object affect by this rules'),
|
||||
'expression': fields.char('Expression', size=32, required=True,
|
||||
help='Expression, must be True to match'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'expression': lambda *a: 'True',
|
||||
'sequence': lambda *a: 100,
|
||||
}
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
"""
|
||||
Add (copy) in the name when duplicate record
|
||||
"""
|
||||
if not context:
|
||||
context = {}
|
||||
if not default:
|
||||
default = {}
|
||||
company = self.browse(cr, uid, id, context=context)
|
||||
default = default.copy()
|
||||
default['name'] = company.name + _(' (copy)')
|
||||
return super(multi_company_default, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
multi_company_default()
|
||||
|
||||
|
||||
class res_company(osv.osv):
|
||||
_name = "res.company"
|
||||
|
||||
_description = 'Companies'
|
||||
_columns = {
|
||||
'name': fields.char('Company Name', size=64, required=True),
|
||||
'parent_id': fields.many2one('res.company', 'Parent Company', select=True),
|
||||
|
@ -38,11 +83,23 @@ class res_company(osv.osv):
|
|||
'rml_header2' : fields.text('RML Internal Header'),
|
||||
'logo' : fields.binary('Logo'),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', required=True),
|
||||
'currency_ids': fields.one2many('res.currency', 'company_id', 'Currency')
|
||||
'currency_ids': fields.one2many('res.currency', 'company_id', 'Currency'),
|
||||
'user_ids': fields.many2many('res.users', 'res_company_users_rel', 'cid', 'user_id', 'Accepted Users')
|
||||
}
|
||||
|
||||
|
||||
def _company_default_get(self, cr, uid, object=False, context={}):
|
||||
def _company_default_get(self, cr, uid, object=False, context=None):
|
||||
"""
|
||||
Check if the object for this company have a default value
|
||||
"""
|
||||
if not context:
|
||||
context = {}
|
||||
proxy = self.pool.get('multi_company.default')
|
||||
ids = proxy.search(cr, uid, [('object_id.model', '=', object)])
|
||||
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}):
|
||||
return rule.company_dest_id.id
|
||||
return self.pool.get('res.users').browse(cr, uid, uid).company_id.id
|
||||
|
||||
def _get_child_ids(self, cr, uid, uid2, context={}):
|
||||
|
@ -175,6 +232,5 @@ class res_company(osv.osv):
|
|||
|
||||
res_company()
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_inventory_tree" model="ir.ui.view">
|
||||
<field name="name">multi_company.default.tree</field>
|
||||
<field name="model">multi_company.default</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="priority" eval="8"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Multi Company">
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="object_id"/>
|
||||
<field name="expression" />
|
||||
<field name="sequence"/>
|
||||
<field name="company_dest_id"/>
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_inventory_form" model="ir.ui.view">
|
||||
<field name="name">multi_company.default.form</field>
|
||||
<field name="model">multi_company.default</field>
|
||||
<field name="type">form</field>
|
||||
<field name="priority" eval="8"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Multi Company">
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" colspan="6"/>
|
||||
<separator string="Matching" colspan="6"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="object_id"/>
|
||||
<field name="company_dest_id"/>
|
||||
<separator string="Condition" colspan="6"/>
|
||||
<field name="expression" colspan="4"/>
|
||||
<field name="sequence"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_inventory_search" model="ir.ui.view">
|
||||
<field name="name">multi_company.default.search</field>
|
||||
<field name="model">multi_company.default</field>
|
||||
<field name="type">search</field>
|
||||
<field name="priority" eval="8"/>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Multi Company">
|
||||
<field name="name" select="1"/>
|
||||
<field name="company_id" select="1" widget="selection"/>
|
||||
<field name="company_dest_id" select="1" widget="selection"/>
|
||||
<field name="object_id" select="1"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_inventory_form" model="ir.actions.act_window">
|
||||
<field name="name">Default Company per Object</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">multi_company.default</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="search_view_id" ref="view_inventory_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_custom_multicompany"
|
||||
name="Multi company"
|
||||
parent="base.menu_custom"
|
||||
sequence="50"/>
|
||||
|
||||
<menuitem id="menu_action_inventory_form"
|
||||
action="action_inventory_form"
|
||||
parent="menu_custom_multicompany"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
@ -123,7 +123,7 @@ class res_currency(osv.osv):
|
|||
else:
|
||||
return (from_amount * rate)
|
||||
|
||||
def name_search(self, cr, uid, name, args=[], operator='ilike', context={}, limit=80):
|
||||
def name_search(self, cr, uid, name, args=[], operator='ilike', context={}, limit=100):
|
||||
args2 = args[:]
|
||||
if name:
|
||||
args += [('name', operator, name)]
|
||||
|
|
|
@ -57,12 +57,22 @@
|
|||
</field>
|
||||
</record>
|
||||
<record id="res_request-act" model="ir.actions.act_window">
|
||||
<field name="name">Requests</field>
|
||||
<field name="name">My Requests</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.request</field>
|
||||
<field name="view_id" eval="False"/>
|
||||
</record>
|
||||
<menuitem id="next_id_12" name="Requests" parent="base.next_id_4"/><menuitem action="res_request-act" id="menu_res_request_act" parent="next_id_12"/>
|
||||
<menuitem id="next_id_12" name="Requests" parent="base.next_id_4"/>
|
||||
<menuitem action="res_request-act" id="menu_res_request_act" parent="next_id_12"/>
|
||||
|
||||
<record id="res_request-closed" model="ir.actions.act_window">
|
||||
<field name="name">My Closed Requests</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.request</field>
|
||||
<field name="domain">[('active','=',False)]</field>
|
||||
<field name="view_id" eval="False"/>
|
||||
</record>
|
||||
<menuitem action="res_request-closed" id="next_id_12_close" parent="menu_res_request_act"/>
|
||||
|
||||
<record id="res_request_link-view" model="ir.ui.view">
|
||||
<field name="name">res.request.link.form</field>
|
||||
|
|
|
@ -140,7 +140,7 @@ class users(osv.osv):
|
|||
'groups_id': fields.many2many('res.groups', 'res_groups_users_rel', 'uid', 'gid', 'Groups'),
|
||||
'roles_id': fields.many2many('res.roles', 'res_roles_users_rel', 'uid', 'rid', 'Roles'),
|
||||
'rules_id': fields.many2many('ir.rule.group', 'user_rule_group_rel', 'user_id', 'rule_group_id', 'Rules'),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
'company_id': fields.many2one('res.company', 'Company', help="The company this user is currently working on.", required=True),
|
||||
'company_ids':fields.many2many('res.company','res_company_users_rel','user_id','cid','Accepted Companies'),
|
||||
'context_lang': fields.selection(_lang_get, 'Language', required=True),
|
||||
'context_tz': fields.selection(_tz_get, 'Timezone', size=64),
|
||||
|
@ -209,9 +209,6 @@ class users(osv.osv):
|
|||
ok=False
|
||||
if ok:
|
||||
uid = 1
|
||||
context_company=values.get('company',False)
|
||||
if context_company:
|
||||
values.update({'company_id':context_company})
|
||||
res = super(users, self).write(cr, uid, ids, values, *args, **argv)
|
||||
self.company_get.clear_cache(cr.dbname)
|
||||
# Restart the cache on the company_get method
|
||||
|
@ -224,7 +221,7 @@ class users(osv.osv):
|
|||
raise osv.except_osv(_('Can not remove root user!'), _('You can not remove the admin user as it is used internally for resources created by OpenERP (updates, module installation, ...)'))
|
||||
return super(users, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=80):
|
||||
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100):
|
||||
if not args:
|
||||
args=[]
|
||||
if not context:
|
||||
|
@ -280,6 +277,16 @@ class users(osv.osv):
|
|||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
|
||||
def _check_company(self, cursor, user, ids):
|
||||
for user in self.browse(cursor, user, ids):
|
||||
if user.company_ids and (user.company_id.id not in map(lambda x: x.id, user.company_ids)):
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_company, 'This user can not connect using this company !', ['company_id']),
|
||||
]
|
||||
users()
|
||||
|
||||
class groups2(osv.osv): ##FIXME: Is there a reason to inherit this object ?
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
</record>
|
||||
|
||||
<record model="res.groups" id="group_multi_company">
|
||||
<field name="name">MultiCompany/Manager</field>
|
||||
<field name="name">Multi Companies</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
|
@ -75,6 +75,41 @@
|
|||
<field eval="[(6,0,[ref('base.group_system')])]" name="groups_id"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.rule.group" id="res_partner_address_rule_group">
|
||||
<field name="name">res.partner.address company</field>
|
||||
<field name="model_id" ref="model_res_partner_address"/>
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record model="ir.rule" id="res_partner_address_comp_rule">
|
||||
<field name="field_id" search="[('model','=','res.partner.address'),('name','=','company_id')]" model="ir.model.fields"/>
|
||||
<field name="rule_group" ref="res_partner_address_rule_group"/>
|
||||
<field name="domain_force">[('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.rule.group" id="res_partner_rule_group">
|
||||
<field name="name">res.partner company</field>
|
||||
<field name="model_id" ref="model_res_partner"/>
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record model="ir.rule" id="res_partner_comp_rule">
|
||||
<field name="field_id" search="[('model','=','res.partner'),('name','=','company_id')]" model="ir.model.fields"/>
|
||||
<field name="rule_group" ref="res_partner_rule_group"/>
|
||||
<field name="domain_force">[('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.rule.group" id="multi_company_default_rule_group">
|
||||
<field name="name">Multi_company_default company</field>
|
||||
<field name="model_id" ref="model_multi_company_default"/>
|
||||
<field name="global" eval="True"/>
|
||||
</record>
|
||||
<record model="ir.rule" id="multi_company_default_comp_rule">
|
||||
<field name="field_id" search="[('model','=','multi_company.default'),('name','=','company_id')]" model="ir.model.fields"/>
|
||||
<field name="rule_group" ref="multi_company_default_rule_group"/>
|
||||
<field name="domain_force">[('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
|
|
@ -132,3 +132,5 @@
|
|||
"access_maintenance_group_user","maintenance_contract group_user","model_maintenance_contract","group_maintenance_manager",1,1,1,1
|
||||
"access_maintenance_contract_module","maintenance.contract.module","model_maintenance_contract_module","group_maintenance_manager",1,1,1,1
|
||||
"access_maintenance_contract_wizard","maintenance.contract.wizard","model_maintenance_contract_wizard","group_maintenance_manager",1,1,1,1
|
||||
"access_multi_company_default user","multi_company_default User","model_multi_company_default","group_user",1,0,0,0
|
||||
"access_multi_company_default manager","multi_company_default Manager","model_multi_company_default","group_erp_manager",1,1,1,1
|
||||
|
|
|
|
@ -208,8 +208,8 @@ def drop_db(uri, dbname):
|
|||
def make_links(uri, uid, dbname, source, destination, module, user, pwd):
|
||||
if module in ('base','quality_integration_server'):
|
||||
return True
|
||||
if not os.path.islink(destination + '/' + module):
|
||||
if not os.path.isdir(destination + '/' + module):
|
||||
if os.path.islink(destination + '/' + module):
|
||||
os.unlink(destination + '/' + module)
|
||||
for path in source:
|
||||
if os.path.isdir(path + '/' + module):
|
||||
os.symlink(path + '/' + module, destination + '/' + module)
|
||||
|
@ -221,7 +221,6 @@ def make_links(uri, uid, dbname, source, destination, module, user, pwd):
|
|||
dep_datas = execute(obj_conn, 'execute', dbname, uid, pwd, 'ir.module.module.dependency', 'read', data['dependencies_id'],['name'])
|
||||
for dep_data in dep_datas:
|
||||
make_links(uri, uid, dbname, source, destination, dep_data['name'], user, pwd)
|
||||
return True
|
||||
return False
|
||||
|
||||
def install_module(uri, dbname, modules, addons='', extra_addons='', user='admin', pwd='admin'):
|
||||
|
|
|
@ -225,7 +225,7 @@ class Logger(object):
|
|||
|
||||
try:
|
||||
msg = tools.ustr(msg).strip()
|
||||
if level in (LOG_ERROR,LOG_CRITICAL) and tools.config.get_misc('debug','env_info',True):
|
||||
if level in (LOG_ERROR,LOG_CRITICAL) and tools.config.get_misc('debug','env_info',False):
|
||||
msg = common().exp_get_server_environment() + "\n" + msg
|
||||
|
||||
result = msg.split('\n')
|
||||
|
|
|
@ -59,6 +59,7 @@ class expression(object):
|
|||
' FROM "%s"' \
|
||||
' WHERE "%s" in (%s)' % (s, f, w, ','.join(['%s']*len(subids))),
|
||||
subids)
|
||||
res.extend([r[0] for r in cr.fetchall()])
|
||||
else:
|
||||
cr.execute('SELECT distinct("%s")' \
|
||||
' FROM "%s" where "%s" is not null' % (s, f, s)),
|
||||
|
|
|
@ -785,6 +785,9 @@ class related(function):
|
|||
self.arg = arg
|
||||
self._relations = []
|
||||
super(related, self).__init__(self._fnct_read, arg, self._fnct_write, fnct_inv_arg=arg, method=True, fnct_search=self._fnct_search, **args)
|
||||
if self.store is True:
|
||||
# TODO: improve here to change self.store = {...} according to related objects
|
||||
pass
|
||||
|
||||
def _field_get2(self, cr, uid, obj, context={}):
|
||||
if self._relations:
|
||||
|
|
|
@ -211,6 +211,8 @@ class browse_record(object):
|
|||
raise except_orm('NoDataError', 'Field %s in %s%s'%(name,self._table_name,str(ids)))
|
||||
# create browse records for 'remote' objects
|
||||
for data in datas:
|
||||
if len(str(data['id']).split('-')) > 1:
|
||||
data['id'] = int(str(data['id']).split('-')[0])
|
||||
for n, f in ffields:
|
||||
if f._type in ('many2one', 'one2one'):
|
||||
if data[n]:
|
||||
|
@ -1049,9 +1051,10 @@ class orm_template(object):
|
|||
attrs = {'views': views}
|
||||
if node.get('widget') and node.get('widget') == 'selection':
|
||||
# We can not use the 'string' domain has it is defined according to the record !
|
||||
dom = None
|
||||
dom = []
|
||||
if column._domain and not isinstance(column._domain, (str, unicode)):
|
||||
dom = column._domain
|
||||
dom += eval(node.get('domain','[]'), {'uid':user, 'time':time})
|
||||
attrs['selection'] = self.pool.get(relation).name_search(cr, user, '', dom, context=context)
|
||||
if (node.get('required') and not int(node.get('required'))) or not column.required:
|
||||
attrs['selection'].append((False,''))
|
||||
|
@ -1451,7 +1454,7 @@ class orm_template(object):
|
|||
def name_get(self, cr, user, ids, context=None):
|
||||
raise _('The name_get method is not implemented on this object !')
|
||||
|
||||
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=80):
|
||||
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100):
|
||||
raise _('The name_search method is not implemented on this object !')
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
|
@ -2315,7 +2318,7 @@ class orm(orm_template):
|
|||
if isinstance(ids, (int, long)):
|
||||
select = [ids]
|
||||
else:
|
||||
select = map(int,ids)
|
||||
select = ids
|
||||
|
||||
select = map(lambda x: isinstance(x,dict) and x['id'] or x, select)
|
||||
result = self._read_flat(cr, user, select, fields, context, load)
|
||||
|
@ -2348,7 +2351,7 @@ class orm(orm_template):
|
|||
context = {}
|
||||
if not ids:
|
||||
return []
|
||||
|
||||
ids = map(lambda x:int(x), ids)
|
||||
if fields_to_read == None:
|
||||
fields_to_read = self._columns.keys()
|
||||
|
||||
|
@ -3163,6 +3166,7 @@ class orm(orm_template):
|
|||
','.join(tables) +qu1 + limit_str + offset_str, qu2)
|
||||
res = cr.fetchall()
|
||||
return res[0][0]
|
||||
|
||||
# execute the "main" query to fetch the ids we were searching for
|
||||
cr.execute('select %s.id from ' % self._table + ','.join(tables) +qu1+' order by '+order_by+limit_str+offset_str, qu2)
|
||||
res = cr.fetchall()
|
||||
|
@ -3189,7 +3193,7 @@ class orm(orm_template):
|
|||
return [(r['id'], tools.ustr(r[self._rec_name])) for r in self.read(cr, user, ids,
|
||||
[self._rec_name], context, load='_classic_write')]
|
||||
|
||||
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=80):
|
||||
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100):
|
||||
if not args:
|
||||
args = []
|
||||
if not context:
|
||||
|
|
|
@ -102,7 +102,7 @@ def _eval_xml(self,node, pool, cr, uid, idref, context=None):
|
|||
return eval(a_eval, idref2)
|
||||
except:
|
||||
logger = netsvc.Logger()
|
||||
logger.notifyChannel("init", netsvc.LOG_WARNING, 'could eval(%s) for %s in %s, please get back and fix it!' % (a_eval,node.getAttribute('name'),context))
|
||||
logger.notifyChannel("init", netsvc.LOG_WARNING, 'could eval(%s) for %s in %s, please get back and fix it!' % (a_eval,node.get('name'),context))
|
||||
return ""
|
||||
if t == 'xml':
|
||||
def _process(s, idref):
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
# Catalan translation for openobject-server
|
||||
# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
|
||||
# This file is distributed under the same license as the openobject-server package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-server\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2009-08-24 22:41+0300\n"
|
||||
"PO-Revision-Date: 2009-12-13 17:50+0000\n"
|
||||
"Last-Translator: Jordi Esteve - http://www.zikzakmedia.com "
|
||||
"<jesteve@zikzakmedia.com>\n"
|
||||
"Language-Team: Catalan <ca@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2009-12-14 04:35+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. Type: string
|
||||
#. Description
|
||||
#: ../openerp-server.templates:1001
|
||||
msgid "Dedicated system account for the Open ERP server:"
|
||||
msgstr "Compte del sistema dedicat pel servidor OpenERP:"
|
||||
|
||||
#. Type: string
|
||||
#. Description
|
||||
#: ../openerp-server.templates:1001
|
||||
msgid ""
|
||||
"The Open ERP server must use a dedicated account for its operation so that "
|
||||
"the system's security is not compromised by running it with superuser "
|
||||
"privileges."
|
||||
msgstr ""
|
||||
"El servidor OpenERP ha d'utilitzar un compte dedicat pel seu funcionament, "
|
||||
"de tal manera que la seguretat del sistema no es vegi compromesa per la seva "
|
||||
"utilització amb privilegis d'administració."
|
||||
|
||||
#. Type: string
|
||||
#. Description
|
||||
#: ../openerp-server.templates:1001
|
||||
msgid "Please choose that account's username."
|
||||
msgstr "Esculliu un nom d'usuari pel compte."
|
|
@ -8,13 +8,14 @@ msgstr ""
|
|||
"Project-Id-Version: openerp-server 5.0.1-0-2\n"
|
||||
"Report-Msgid-Bugs-To: openerp-server@packages.debian.org\n"
|
||||
"POT-Creation-Date: 2009-08-24 22:41+0300\n"
|
||||
"PO-Revision-Date: 2009-11-26 07:45+0000\n"
|
||||
"Last-Translator: Fernando González de Requena <Unknown>\n"
|
||||
"PO-Revision-Date: 2009-12-13 17:49+0000\n"
|
||||
"Last-Translator: Jordi Esteve - http://www.zikzakmedia.com "
|
||||
"<jesteve@zikzakmedia.com>\n"
|
||||
"Language-Team: Spanish <debian-l10n-spanish@lists.debian.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2009-11-27 04:51+0000\n"
|
||||
"X-Launchpad-Export-Date: 2009-12-14 04:35+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. Type: string
|
||||
|
@ -31,7 +32,7 @@ msgid ""
|
|||
"the system's security is not compromised by running it with superuser "
|
||||
"privileges."
|
||||
msgstr ""
|
||||
"El servidor de Open ERP debe utilizar una cuenta dedicada para su "
|
||||
"El servidor OpenERP debe utilizar una cuenta dedicada para su "
|
||||
"funcionamiento, de tal modo que la seguridad del sistema no se vea "
|
||||
"comprometida por su utilización con privilegios de administración."
|
||||
|
||||
|
@ -39,4 +40,4 @@ msgstr ""
|
|||
#. Description
|
||||
#: ../openerp-server.templates:1001
|
||||
msgid "Please choose that account's username."
|
||||
msgstr "Elija un nombre de usuario para esa cuenta."
|
||||
msgstr "Elija un nombre de usuario para la cuenta."
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
# Polish translation for openobject-server
|
||||
# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
|
||||
# This file is distributed under the same license as the openobject-server package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-server\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2009-08-24 22:41+0300\n"
|
||||
"PO-Revision-Date: 2009-12-08 06:13+0000\n"
|
||||
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
|
||||
"Language-Team: Polish <pl@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2009-12-09 04:31+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. Type: string
|
||||
#. Description
|
||||
#: ../openerp-server.templates:1001
|
||||
msgid "Dedicated system account for the Open ERP server:"
|
||||
msgstr "Konto dedykowane serwerowi OpenERP"
|
||||
|
||||
#. Type: string
|
||||
#. Description
|
||||
#: ../openerp-server.templates:1001
|
||||
msgid ""
|
||||
"The Open ERP server must use a dedicated account for its operation so that "
|
||||
"the system's security is not compromised by running it with superuser "
|
||||
"privileges."
|
||||
msgstr ""
|
||||
"Serwer OpenERP musi używać dedykowanego konta do swoich operacji, aby nie "
|
||||
"obniżać bezpieczeństwa systemu przez stosowanie uprawnień superusera."
|
||||
|
||||
#. Type: string
|
||||
#. Description
|
||||
#: ../openerp-server.templates:1001
|
||||
msgid "Please choose that account's username."
|
||||
msgstr "Wybierz nazę użytkownika dla konta."
|
|
@ -7,20 +7,20 @@ msgstr ""
|
|||
"Project-Id-Version: openerp-server 5.0.1-0-2\n"
|
||||
"Report-Msgid-Bugs-To: openerp-server@packages.debian.org\n"
|
||||
"POT-Creation-Date: 2009-08-24 22:41+0300\n"
|
||||
"PO-Revision-Date: 2009-11-26 07:45+0000\n"
|
||||
"Last-Translator: Américo Monteiro <Unknown>\n"
|
||||
"PO-Revision-Date: 2009-12-10 06:04+0000\n"
|
||||
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
|
||||
"Language-Team: Portuguese <traduz@debianpt.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2009-11-27 04:51+0000\n"
|
||||
"X-Launchpad-Export-Date: 2009-12-11 04:34+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. Type: string
|
||||
#. Description
|
||||
#: ../openerp-server.templates:1001
|
||||
msgid "Dedicated system account for the Open ERP server:"
|
||||
msgstr "Conta dedicada do sistema para o servidor Open ERP:"
|
||||
msgstr "Conta de sistema dedicada para o servidor Open ERP:"
|
||||
|
||||
#. Type: string
|
||||
#. Description
|
||||
|
@ -30,12 +30,12 @@ msgid ""
|
|||
"the system's security is not compromised by running it with superuser "
|
||||
"privileges."
|
||||
msgstr ""
|
||||
"O servidor Open ERP tem que usar uma conta dedicada para as suas operações, "
|
||||
"isto para que a segurança do sistema não seja comprometida ao corrê-lo com "
|
||||
"O servidor Open ERP tem de usar uma conta dedicada para as suas operações, "
|
||||
"para que a segurança do sistema não seja comprometida ao corrê-lo com "
|
||||
"privilégios de superutilizador."
|
||||
|
||||
#. Type: string
|
||||
#. Description
|
||||
#: ../openerp-server.templates:1001
|
||||
msgid "Please choose that account's username."
|
||||
msgstr "Por favor escolha o nome dessa conta."
|
||||
msgstr "Por favor escolha o nome de utilizador para essa conta."
|
||||
|
|
4
setup.py
4
setup.py
|
@ -58,6 +58,7 @@ required_modules = [
|
|||
('pychart', 'pychart module'),
|
||||
('pydot', 'pydot module'),
|
||||
('lxml', 'lxml module: pythonic libxml2 and libxslt bindings'),
|
||||
('mako','Mako templating library'),
|
||||
]
|
||||
|
||||
def check_modules():
|
||||
|
@ -183,7 +184,7 @@ options = {
|
|||
"packages": ["lxml", "lxml.builder", "lxml._elementpath", "lxml.etree",
|
||||
"lxml.objectify", "decimal", "xml", "xml.dom", "xml.xpath",
|
||||
"encodings","mx.DateTime","wizard","pychart","PIL", "pyparsing",
|
||||
"pydot","asyncore","asynchat", "reportlab", "vobject",
|
||||
"pydot","asyncore","asynchat", "reportlab", "vobject","mako",
|
||||
"HTMLParser", "select"],
|
||||
"excludes" : ["Tkconstants","Tkinter","tcl"],
|
||||
}
|
||||
|
@ -217,6 +218,7 @@ setup(name = name,
|
|||
'openerp-server.report.render.rml2html',
|
||||
'openerp-server.report.render.rml2txt',
|
||||
'openerp-server.report.render.html2html',
|
||||
'openerp-server.report.render.makohtml2html',
|
||||
'openerp-server.wizard',
|
||||
'openerp-server.report.render.odt2odt',
|
||||
'openerp-server.workflow'] + \
|
||||
|
|
Loading…
Reference in New Issue