[MERGE] forward port of branch saas-4 up to a361947
This commit is contained in:
commit
73d39a0c8c
|
@ -702,7 +702,9 @@ class account_analytic_account(osv.osv):
|
||||||
|
|
||||||
def _prepare_invoice_lines(self, cr, uid, contract, fiscal_position_id, context=None):
|
def _prepare_invoice_lines(self, cr, uid, contract, fiscal_position_id, context=None):
|
||||||
fpos_obj = self.pool.get('account.fiscal.position')
|
fpos_obj = self.pool.get('account.fiscal.position')
|
||||||
fiscal_position = fpos_obj.browse(cr, uid, fiscal_position_id, context=context)
|
fiscal_position = None
|
||||||
|
if fiscal_position_id:
|
||||||
|
fiscal_position = fpos_obj.browse(cr, uid, fiscal_position_id, context=context)
|
||||||
invoice_lines = []
|
invoice_lines = []
|
||||||
for line in contract.recurring_invoice_line_ids:
|
for line in contract.recurring_invoice_line_ids:
|
||||||
|
|
||||||
|
|
|
@ -221,9 +221,9 @@ class email_template(osv.osv):
|
||||||
help="Optional translation language (ISO code) to select when sending out an email. "
|
help="Optional translation language (ISO code) to select when sending out an email. "
|
||||||
"If not set, the english version will be used. "
|
"If not set, the english version will be used. "
|
||||||
"This should usually be a placeholder expression "
|
"This should usually be a placeholder expression "
|
||||||
"that provides the appropriate language code, e.g. "
|
"that provides the appropriate language, e.g. "
|
||||||
"${object.partner_id.lang.code}.",
|
"${object.partner_id.lang}.",
|
||||||
placeholder="${object.partner_id.lang.code}"),
|
placeholder="${object.partner_id.lang}"),
|
||||||
'user_signature': fields.boolean('Add Signature',
|
'user_signature': fields.boolean('Add Signature',
|
||||||
help="If checked, the user's signature will be appended to the text version "
|
help="If checked, the user's signature will be appended to the text version "
|
||||||
"of the message"),
|
"of the message"),
|
||||||
|
|
|
@ -177,7 +177,7 @@ class event_event(osv.osv):
|
||||||
'name': fields.char('Event Name', size=64, required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}),
|
'name': fields.char('Event Name', size=64, required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}),
|
||||||
'user_id': fields.many2one('res.users', 'Responsible User', readonly=False, states={'done': [('readonly', True)]}),
|
'user_id': fields.many2one('res.users', 'Responsible User', readonly=False, states={'done': [('readonly', True)]}),
|
||||||
'type': fields.many2one('event.type', 'Type of Event', readonly=False, states={'done': [('readonly', True)]}),
|
'type': fields.many2one('event.type', 'Type of Event', readonly=False, states={'done': [('readonly', True)]}),
|
||||||
'seats_max': fields.integer('Maximum Avalaible Seats', oldname='register_max', help="You can for each event define a maximum registration level. If you have too much registrations you are not able to confirm your event. (put 0 to ignore this rule )", readonly=True, states={'draft': [('readonly', False)]}),
|
'seats_max': fields.integer('Maximum Available Seats', oldname='register_max', help="You can for each event define a maximum registration level. If you have too much registrations you are not able to confirm your event. (put 0 to ignore this rule )", readonly=True, states={'draft': [('readonly', False)]}),
|
||||||
'seats_min': fields.integer('Minimum Reserved Seats', oldname='register_min', help="You can for each event define a minimum registration level. If you do not enough registrations you are not able to confirm your event. (put 0 to ignore this rule )", readonly=True, states={'draft': [('readonly', False)]}),
|
'seats_min': fields.integer('Minimum Reserved Seats', oldname='register_min', help="You can for each event define a minimum registration level. If you do not enough registrations you are not able to confirm your event. (put 0 to ignore this rule )", readonly=True, states={'draft': [('readonly', False)]}),
|
||||||
'seats_reserved': fields.function(_get_seats, oldname='register_current', string='Reserved Seats', type='integer', multi='seats_reserved',
|
'seats_reserved': fields.function(_get_seats, oldname='register_current', string='Reserved Seats', type='integer', multi='seats_reserved',
|
||||||
store={'event.registration': (_get_events_from_registrations, ['state'], 10),
|
store={'event.registration': (_get_events_from_registrations, ['state'], 10),
|
||||||
|
|
|
@ -215,7 +215,7 @@ class event_ticket(osv.osv):
|
||||||
'deadline': fields.date("Sales End"),
|
'deadline': fields.date("Sales End"),
|
||||||
'is_expired': fields.function(_is_expired, type='boolean', string='Is Expired'),
|
'is_expired': fields.function(_is_expired, type='boolean', string='Is Expired'),
|
||||||
'price': fields.float('Price'),
|
'price': fields.float('Price'),
|
||||||
'seats_max': fields.integer('Maximum Avalaible Seats', oldname='register_max', help="You can for each event define a maximum registration level. If you have too much registrations you are not able to confirm your event. (put 0 to ignore this rule )"),
|
'seats_max': fields.integer('Maximum Available Seats', oldname='register_max', help="You can for each event define a maximum registration level. If you have too much registrations you are not able to confirm your event. (put 0 to ignore this rule )"),
|
||||||
'seats_reserved': fields.function(_get_seats, string='Reserved Seats', type='integer', multi='seats_reserved'),
|
'seats_reserved': fields.function(_get_seats, string='Reserved Seats', type='integer', multi='seats_reserved'),
|
||||||
'seats_available': fields.function(_get_seats, string='Available Seats', type='integer', multi='seats_reserved'),
|
'seats_available': fields.function(_get_seats, string='Available Seats', type='integer', multi='seats_reserved'),
|
||||||
'seats_unconfirmed': fields.function(_get_seats, string='Unconfirmed Seat Reservations', type='integer', multi='seats_reserved'),
|
'seats_unconfirmed': fields.function(_get_seats, string='Unconfirmed Seat Reservations', type='integer', multi='seats_reserved'),
|
||||||
|
|
|
@ -223,9 +223,7 @@ class report_custom(report_rml):
|
||||||
elif data['model']=='ir.ui.menu':
|
elif data['model']=='ir.ui.menu':
|
||||||
for id in data['form']['depts']:
|
for id in data['form']['depts']:
|
||||||
dept = obj_dept.browse(cr, uid, id, context=context)
|
dept = obj_dept.browse(cr, uid, id, context=context)
|
||||||
cr.execute("""SELECT id FROM hr_employee \
|
emp_ids = obj_emp.search(cr, uid, [('department_id', '=', id)], context=context)
|
||||||
WHERE department_id = %s""", (id,))
|
|
||||||
emp_ids = [x[0] for x in cr.fetchall()]
|
|
||||||
if emp_ids==[]:
|
if emp_ids==[]:
|
||||||
continue
|
continue
|
||||||
dept_done=0
|
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_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_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_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_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_location_user,stock.location.user,model_stock_location,base.group_user,1,0,0,0
|
||||||
access_stock_picking_user,stock.picking user,model_stock_picking,stock.group_stock_user,1,1,1,1
|
access_stock_picking_user,stock.picking user,model_stock_picking,stock.group_stock_user,1,1,1,1
|
||||||
|
|
|
|
@ -124,7 +124,7 @@ class WebsiteCrmPartnerAssign(http.Controller):
|
||||||
context=request.context) # todo in trunk: order="grade_id DESC, implemented_count DESC", offset=pager['offset'], limit=self._references_per_page
|
context=request.context) # todo in trunk: order="grade_id DESC, implemented_count DESC", offset=pager['offset'], limit=self._references_per_page
|
||||||
partners = partner_obj.browse(request.cr, SUPERUSER_ID, partner_ids, request.context)
|
partners = partner_obj.browse(request.cr, SUPERUSER_ID, partner_ids, request.context)
|
||||||
# remove me in trunk
|
# remove me in trunk
|
||||||
partners.sort(key=lambda x: (-1 * (x.grade_id and x.grade_id.id or 0), len(x.implemented_partner_ids)), reverse=True)
|
partners.sort(key=lambda x: (x.grade_id.sequence if x.grade_id else 0, len([i for i in x.implemented_partner_ids if i.website_published])), reverse=True)
|
||||||
partners = partners[pager['offset']:pager['offset'] + self._references_per_page]
|
partners = partners[pager['offset']:pager['offset'] + self._references_per_page]
|
||||||
|
|
||||||
google_map_partner_ids = ','.join(map(str, [p.id for p in partners]))
|
google_map_partner_ids = ','.join(map(str, [p.id for p in partners]))
|
||||||
|
|
|
@ -17,7 +17,7 @@ class WebsiteResPartner(osv.Model):
|
||||||
'Website Partner Full Description'
|
'Website Partner Full Description'
|
||||||
),
|
),
|
||||||
'website_short_description': fields.text(
|
'website_short_description': fields.text(
|
||||||
'Website artner Short Description'
|
'Website Partner Short Description'
|
||||||
),
|
),
|
||||||
# hack to allow using plain browse record in qweb views
|
# hack to allow using plain browse record in qweb views
|
||||||
'self': fields.function(_get_ids, type='many2one', relation=_name),
|
'self': fields.function(_get_ids, type='many2one', relation=_name),
|
||||||
|
|
|
@ -151,7 +151,7 @@ class ir_model(osv.osv):
|
||||||
if result and result[0] == 'v':
|
if result and result[0] == 'v':
|
||||||
cr.execute('DROP view %s' % (model_pool._table,))
|
cr.execute('DROP view %s' % (model_pool._table,))
|
||||||
elif result and result[0] == 'r':
|
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
|
return True
|
||||||
|
|
||||||
def unlink(self, cr, user, ids, context=None):
|
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'):
|
if column_name and (result and result[0] == 'r'):
|
||||||
cr.execute('ALTER table "%s" DROP column "%s" cascade' % (model._table, field.name))
|
cr.execute('ALTER table "%s" DROP column "%s" cascade' % (model._table, field.name))
|
||||||
model._columns.pop(field.name, None)
|
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
|
return True
|
||||||
|
|
||||||
def unlink(self, cr, user, ids, context=None):
|
def unlink(self, cr, user, ids, context=None):
|
||||||
|
|
|
@ -3072,7 +3072,10 @@ class BaseModel(object):
|
||||||
|
|
||||||
def _m2m_raise_or_create_relation(self, cr, f):
|
def _m2m_raise_or_create_relation(self, cr, f):
|
||||||
m2m_tbl, col1, col2 = f._sql_names(self)
|
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,))
|
cr.execute("SELECT relname FROM pg_class WHERE relkind IN ('r','v') AND relname=%s", (m2m_tbl,))
|
||||||
if not cr.dictfetchall():
|
if not cr.dictfetchall():
|
||||||
if f._obj not in self.pool:
|
if f._obj not in self.pool:
|
||||||
|
|
Loading…
Reference in New Issue