[IMP] hr,mail,product,project,base: use @auto_join=True on _inherits FK field
This can give a performance boost on large databases and should not be a concern in terms of access control as the inheritance already grants access to the parent records.
This commit is contained in:
parent
935c476664
commit
2bbff57691
|
@ -207,7 +207,7 @@ class hr_employee(osv.osv):
|
|||
'parent_id': fields.many2one('hr.employee', 'Manager'),
|
||||
'category_ids': fields.many2many('hr.employee.category', 'employee_category_rel', 'emp_id', 'category_id', 'Tags'),
|
||||
'child_ids': fields.one2many('hr.employee', 'parent_id', 'Subordinates'),
|
||||
'resource_id': fields.many2one('resource.resource', 'Resource', ondelete='cascade', required=True),
|
||||
'resource_id': fields.many2one('resource.resource', 'Resource', ondelete='cascade', required=True, auto_join=True),
|
||||
'coach_id': fields.many2one('hr.employee', 'Coach'),
|
||||
'job_id': fields.many2one('hr.job', 'Job Title'),
|
||||
# image: all image fields are base64 encoded and PIL-supported
|
||||
|
|
|
@ -44,7 +44,7 @@ class mail_mail(osv.Model):
|
|||
_rec_name = 'subject'
|
||||
|
||||
_columns = {
|
||||
'mail_message_id': fields.many2one('mail.message', 'Message', required=True, ondelete='cascade'),
|
||||
'mail_message_id': fields.many2one('mail.message', 'Message', required=True, ondelete='cascade', auto_join=True),
|
||||
'state': fields.selection([
|
||||
('outgoing', 'Outgoing'),
|
||||
('sent', 'Sent'),
|
||||
|
|
|
@ -40,7 +40,7 @@ class res_users(osv.Model):
|
|||
_columns = {
|
||||
'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="restrict", required=True,
|
||||
help="Email address internally associated with this user. Incoming "\
|
||||
"emails will appear in the user's notifications.", copy=False),
|
||||
"emails will appear in the user's notifications.", copy=False, auto_join=True),
|
||||
'display_groups_suggestions': fields.boolean("Display Groups Suggestions"),
|
||||
}
|
||||
|
||||
|
|
|
@ -904,7 +904,7 @@ class product_product(osv.osv):
|
|||
'partner_ref' : fields.function(_product_partner_ref, type='char', string='Customer ref'),
|
||||
'default_code' : fields.char('Internal Reference', select=True),
|
||||
'active': fields.boolean('Active', help="If unchecked, it will allow you to hide the product without removing it."),
|
||||
'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade", select=True),
|
||||
'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade", select=True, auto_join=True),
|
||||
'ean13': fields.char('EAN13 Barcode', size=13, help="International Article Number used for product identification."),
|
||||
'name_template': fields.related('product_tmpl_id', 'name', string="Template Name", type='char', store={
|
||||
'product.template': (_get_name_template_ids, ['name'], 10),
|
||||
|
|
|
@ -227,7 +227,11 @@ class project(osv.osv):
|
|||
_columns = {
|
||||
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the project without removing it."),
|
||||
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of Projects."),
|
||||
'analytic_account_id': fields.many2one('account.analytic.account', 'Contract/Analytic', help="Link this project to an analytic account if you need financial management on projects. It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc.", ondelete="cascade", required=True),
|
||||
'analytic_account_id': fields.many2one(
|
||||
'account.analytic.account', 'Contract/Analytic',
|
||||
help="Link this project to an analytic account if you need financial management on projects. "
|
||||
"It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc.",
|
||||
ondelete="cascade", required=True, auto_join=True),
|
||||
'members': fields.many2many('res.users', 'project_user_rel', 'project_id', 'uid', 'Project Members',
|
||||
help="Project's members are users who can have an access to the tasks related to this project.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}),
|
||||
'tasks': fields.one2many('project.task', 'project_id', "Task Activities"),
|
||||
|
|
|
@ -166,7 +166,7 @@ class res_users(osv.osv):
|
|||
'login_date': fields.date('Latest connection', select=1),
|
||||
'partner_id': fields.many2one('res.partner', required=True,
|
||||
string='Related Partner', ondelete='restrict',
|
||||
help='Partner-related data of the user'),
|
||||
help='Partner-related data of the user', auto_join=True),
|
||||
'login': fields.char('Login', size=64, required=True,
|
||||
help="Used to log into the system"),
|
||||
'password': fields.char('Password', size=64, invisible=True, copy=False,
|
||||
|
|
Loading…
Reference in New Issue