[MERGE] forward port of branch 7.0 up to 6e96ffd
This commit is contained in:
commit
a35aec2a0b
|
@ -221,9 +221,9 @@ class email_template(osv.osv):
|
|||
help="Optional translation language (ISO code) to select when sending out an email. "
|
||||
"If not set, the english version will be used. "
|
||||
"This should usually be a placeholder expression "
|
||||
"that provides the appropriate language code, e.g. "
|
||||
"${object.partner_id.lang.code}.",
|
||||
placeholder="${object.partner_id.lang.code}"),
|
||||
"that provides the appropriate language, e.g. "
|
||||
"${object.partner_id.lang}.",
|
||||
placeholder="${object.partner_id.lang}"),
|
||||
'user_signature': fields.boolean('Add Signature',
|
||||
help="If checked, the user's signature will be appended to the text version "
|
||||
"of the message"),
|
||||
|
|
|
@ -223,9 +223,7 @@ class report_custom(report_rml):
|
|||
elif data['model']=='ir.ui.menu':
|
||||
for id in data['form']['depts']:
|
||||
dept = obj_dept.browse(cr, uid, id, context=context)
|
||||
cr.execute("""SELECT id FROM hr_employee \
|
||||
WHERE department_id = %s""", (id,))
|
||||
emp_ids = [x[0] for x in cr.fetchall()]
|
||||
emp_ids = obj_emp.search(cr, uid, [('department_id', '=', id)], context=context)
|
||||
if emp_ids==[]:
|
||||
continue
|
||||
dept_done=0
|
||||
|
|
|
@ -3,7 +3,7 @@ access_stock_incoterms_all,stock.incoterms all,model_stock_incoterms,,1,0,0,0
|
|||
access_stock_incoterms_manager,stock.incoterms manager,model_stock_incoterms,stock.group_stock_manager,1,1,1,1
|
||||
access_stock_warehouse_manager,stock.warehouse.manager,model_stock_warehouse,stock.group_stock_manager,1,1,1,1
|
||||
access_stock_warehouse_user,stock.warehouse.user,model_stock_warehouse,base.group_user,1,0,0,0
|
||||
access_stock_location__partner_manager,stock.location.partner.manager,model_stock_location,base.group_partner_manager,1,1,1,1
|
||||
access_stock_location__partner_manager,stock.location.partner.manager,model_stock_location,base.group_partner_manager,1,0,0,0
|
||||
access_stock_location_manager,stock.location.manager,model_stock_location,stock.group_stock_manager,1,1,1,1
|
||||
access_stock_location_user,stock.location.user,model_stock_location,base.group_user,1,0,0,0
|
||||
access_stock_journal_user,stock.journal.user,model_stock_journal,base.group_user,1,0,0,0
|
||||
|
|
|
|
@ -151,7 +151,7 @@ class ir_model(osv.osv):
|
|||
if result and result[0] == 'v':
|
||||
cr.execute('DROP view %s' % (model_pool._table,))
|
||||
elif result and result[0] == 'r':
|
||||
cr.execute('DROP TABLE %s' % (model_pool._table,))
|
||||
cr.execute('DROP TABLE %s CASCADE' % (model_pool._table,))
|
||||
return True
|
||||
|
||||
def unlink(self, cr, user, ids, context=None):
|
||||
|
@ -312,6 +312,14 @@ class ir_model_fields(osv.osv):
|
|||
if column_name and (result and result[0] == 'r'):
|
||||
cr.execute('ALTER table "%s" DROP column "%s" cascade' % (model._table, field.name))
|
||||
model._columns.pop(field.name, None)
|
||||
|
||||
# remove m2m relation table for custom fields
|
||||
# we consider the m2m relation is only one way as it's not possible
|
||||
# to specify the relation table in the interface for custom fields
|
||||
# TODO master: maybe use ir.model.relations for custom fields
|
||||
if field.state == 'manual' and field.ttype == 'many2many':
|
||||
rel_name = self.pool[field.model]._all_columns[field.name].column._rel
|
||||
cr.execute('DROP table "%s"' % (rel_name))
|
||||
return True
|
||||
|
||||
def unlink(self, cr, user, ids, context=None):
|
||||
|
|
|
@ -3035,7 +3035,10 @@ class BaseModel(object):
|
|||
|
||||
def _m2m_raise_or_create_relation(self, cr, f):
|
||||
m2m_tbl, col1, col2 = f._sql_names(self)
|
||||
self._save_relation_table(cr, m2m_tbl)
|
||||
# do not create relations for custom fields as they do not belong to a module
|
||||
# they will be automatically removed when dropping the corresponding ir.model.field
|
||||
if not f.string.startswith('x_'):
|
||||
self._save_relation_table(cr, m2m_tbl)
|
||||
cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (m2m_tbl,))
|
||||
if not cr.dictfetchall():
|
||||
if f._obj not in self.pool:
|
||||
|
|
|
@ -143,7 +143,7 @@ class configmanager(object):
|
|||
# WEB
|
||||
# TODO move to web addons after MetaOption merge
|
||||
group = optparse.OptionGroup(parser, "Web interface Configuration")
|
||||
group.add_option("--db-filter", dest="dbfilter", default='.*',
|
||||
group.add_option("--db-filter", dest="dbfilter", my_default='.*',
|
||||
help="Filter listed database", metavar="REGEXP")
|
||||
parser.add_option_group(group)
|
||||
|
||||
|
|
Loading…
Reference in New Issue