[MERGE] forward port of branch 7.0 up to revid 10037 mat@openerp.com-20140507133552-v4qsdp7qdp9iwewi
bzr revid: chs@openerp.com-20140507153348-g2qw61dkxvps13br
This commit is contained in:
commit
1953aa442f
|
@ -1026,7 +1026,7 @@ class account_move_line(osv.osv):
|
||||||
if opening_reconciliation:
|
if opening_reconciliation:
|
||||||
obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconciliation': False})
|
obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconciliation': False})
|
||||||
obj_move_rec.unlink(cr, uid, unlink_ids)
|
obj_move_rec.unlink(cr, uid, unlink_ids)
|
||||||
if all_moves:
|
if len(all_moves) >= 2:
|
||||||
obj_move_line.reconcile_partial(cr, uid, all_moves, 'auto',context=context)
|
obj_move_line.reconcile_partial(cr, uid, all_moves, 'auto',context=context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
<field name="name" />
|
<field name="name" />
|
||||||
<field name="client_id" />
|
<field name="client_id" />
|
||||||
<field name="enabled" />
|
<field name="enabled" />
|
||||||
|
<field name="body" />
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="auth_endpoint" />
|
<field name="auth_endpoint" />
|
||||||
|
|
|
@ -227,6 +227,12 @@ class hr_employee(osv.osv):
|
||||||
'color': 0,
|
'color': 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def copy_data(self, cr, uid, ids, default=None, context=None):
|
||||||
|
if default is None:
|
||||||
|
default = {}
|
||||||
|
default.update({'child_ids': False})
|
||||||
|
return super(hr_employee, self).copy_data(cr, uid, ids, default, context=context)
|
||||||
|
|
||||||
def create(self, cr, uid, data, context=None):
|
def create(self, cr, uid, data, context=None):
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
|
@ -380,18 +386,23 @@ class hr_department(osv.osv):
|
||||||
res.append((record['id'], name))
|
res.append((record['id'], name))
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def copy(self, cr, uid, ids, default=None, context=None):
|
def copy_data(self, cr, uid, ids, default=None, context=None):
|
||||||
if default is None:
|
if default is None:
|
||||||
default = {}
|
default = {}
|
||||||
default = default.copy()
|
|
||||||
default['member_ids'] = []
|
default['member_ids'] = []
|
||||||
return super(hr_department, self).copy(cr, uid, ids, default, context=context)
|
return super(hr_department, self).copy_data(cr, uid, ids, default, context=context)
|
||||||
|
|
||||||
|
|
||||||
class res_users(osv.osv):
|
class res_users(osv.osv):
|
||||||
_name = 'res.users'
|
_name = 'res.users'
|
||||||
_inherit = 'res.users'
|
_inherit = 'res.users'
|
||||||
|
|
||||||
|
def copy_data(self, cr, uid, ids, default=None, context=None):
|
||||||
|
if default is None:
|
||||||
|
default = {}
|
||||||
|
default.update({'employee_ids': False})
|
||||||
|
return super(res_users, self).copy_data(cr, uid, ids, default, context=context)
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'employee_ids': fields.one2many('hr.employee', 'user_id', 'Related employees'),
|
'employee_ids': fields.one2many('hr.employee', 'user_id', 'Related employees'),
|
||||||
}
|
}
|
||||||
|
|
|
@ -402,6 +402,9 @@ class hr_attendance(osv.osv):
|
||||||
employee = employee_obj.browse(cr, uid, employee_id, context=context)
|
employee = employee_obj.browse(cr, uid, employee_id, context=context)
|
||||||
tz = employee.user_id.partner_id.tz
|
tz = employee.user_id.partner_id.tz
|
||||||
|
|
||||||
|
if not date:
|
||||||
|
date = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
|
||||||
|
|
||||||
att_tz = timezone(tz or 'utc')
|
att_tz = timezone(tz or 'utc')
|
||||||
|
|
||||||
attendance_dt = datetime.strptime(date, DEFAULT_SERVER_DATETIME_FORMAT)
|
attendance_dt = datetime.strptime(date, DEFAULT_SERVER_DATETIME_FORMAT)
|
||||||
|
|
|
@ -420,14 +420,14 @@ class mail_thread(osv.AbstractModel):
|
||||||
fol_obj.unlink(cr, SUPERUSER_ID, fol_ids, context=context)
|
fol_obj.unlink(cr, SUPERUSER_ID, fol_ids, context=context)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def copy(self, cr, uid, id, default=None, context=None):
|
def copy_data(self, cr, uid, id, default=None, context=None):
|
||||||
# avoid tracking multiple temporary changes during copy
|
# avoid tracking multiple temporary changes during copy
|
||||||
context = dict(context or {}, mail_notrack=True)
|
context = dict(context or {}, mail_notrack=True)
|
||||||
|
|
||||||
default = default or {}
|
default = default or {}
|
||||||
default['message_ids'] = []
|
default['message_ids'] = []
|
||||||
default['message_follower_ids'] = []
|
default['message_follower_ids'] = []
|
||||||
return super(mail_thread, self).copy(cr, uid, id, default=default, context=context)
|
return super(mail_thread, self).copy_data(cr, uid, id, default=default, context=context)
|
||||||
|
|
||||||
#------------------------------------------------------
|
#------------------------------------------------------
|
||||||
# Automatically log tracked fields
|
# Automatically log tracked fields
|
||||||
|
|
|
@ -34,14 +34,14 @@ class project_configuration(osv.TransientModel):
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_default_alias_domain(self, cr, uid, ids, context=None):
|
def get_default_alias_domain(self, cr, uid, ids, context=None):
|
||||||
alias_domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "mail.catchall.domain", context=context)
|
alias_domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "mail.catchall.domain", default=None, context=context)
|
||||||
if not alias_domain:
|
if alias_domain is None:
|
||||||
domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "web.base.url", context=context)
|
domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "web.base.url", context=context)
|
||||||
try:
|
try:
|
||||||
alias_domain = urlparse.urlsplit(domain).netloc.split(':')[0]
|
alias_domain = urlparse.urlsplit(domain).netloc.split(':')[0]
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
return {'alias_domain': alias_domain}
|
return {'alias_domain': alias_domain or False}
|
||||||
|
|
||||||
def set_alias_domain(self, cr, uid, ids, context=None):
|
def set_alias_domain(self, cr, uid, ids, context=None):
|
||||||
config_parameters = self.pool.get("ir.config_parameter")
|
config_parameters = self.pool.get("ir.config_parameter")
|
||||||
|
|
|
@ -2307,7 +2307,9 @@ class stock_move(osv.osv):
|
||||||
|
|
||||||
# if product is set to average price and a specific value was entered in the picking wizard,
|
# if product is set to average price and a specific value was entered in the picking wizard,
|
||||||
# we use it
|
# we use it
|
||||||
if move.product_id.cost_method == 'average' and move.price_unit:
|
if move.location_dest_id.usage != 'internal' and move.product_id.cost_method == 'average':
|
||||||
|
reference_amount = qty * move.product_id.standard_price
|
||||||
|
elif move.product_id.cost_method == 'average' and move.price_unit:
|
||||||
reference_amount = qty * move.price_unit
|
reference_amount = qty * move.price_unit
|
||||||
reference_currency_id = move.price_currency_id.id or reference_currency_id
|
reference_currency_id = move.price_currency_id.id or reference_currency_id
|
||||||
|
|
||||||
|
|
|
@ -62,14 +62,14 @@ class sale_order(osv.osv):
|
||||||
message = False
|
message = False
|
||||||
partner = self.pool.get('res.partner').browse(cr, uid, part, context=context)
|
partner = self.pool.get('res.partner').browse(cr, uid, part, context=context)
|
||||||
if partner.sale_warn != 'no-message':
|
if partner.sale_warn != 'no-message':
|
||||||
if partner.sale_warn == 'block':
|
|
||||||
raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.sale_warn_msg)
|
|
||||||
title = _("Warning for %s") % partner.name
|
title = _("Warning for %s") % partner.name
|
||||||
message = partner.sale_warn_msg
|
message = partner.sale_warn_msg
|
||||||
warning = {
|
warning = {
|
||||||
'title': title,
|
'title': title,
|
||||||
'message': message,
|
'message': message,
|
||||||
}
|
}
|
||||||
|
if partner.sale_warn == 'block':
|
||||||
|
return {'value': {'partner_id': False}, 'warning': warning}
|
||||||
|
|
||||||
result = super(sale_order, self).onchange_partner_id(cr, uid, ids, part, context=context)
|
result = super(sale_order, self).onchange_partner_id(cr, uid, ids, part, context=context)
|
||||||
|
|
||||||
|
@ -90,14 +90,15 @@ class purchase_order(osv.osv):
|
||||||
message = False
|
message = False
|
||||||
partner = self.pool.get('res.partner').browse(cr, uid, part)
|
partner = self.pool.get('res.partner').browse(cr, uid, part)
|
||||||
if partner.purchase_warn != 'no-message':
|
if partner.purchase_warn != 'no-message':
|
||||||
if partner.purchase_warn == 'block':
|
|
||||||
raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.purchase_warn_msg)
|
|
||||||
title = _("Warning for %s") % partner.name
|
title = _("Warning for %s") % partner.name
|
||||||
message = partner.purchase_warn_msg
|
message = partner.purchase_warn_msg
|
||||||
warning = {
|
warning = {
|
||||||
'title': title,
|
'title': title,
|
||||||
'message': message
|
'message': message
|
||||||
}
|
}
|
||||||
|
if partner.purchase_warn == 'block':
|
||||||
|
return {'value': {'partner_id': False}, 'warning': warning}
|
||||||
|
|
||||||
result = super(purchase_order, self).onchange_partner_id(cr, uid, ids, part)
|
result = super(purchase_order, self).onchange_partner_id(cr, uid, ids, part)
|
||||||
|
|
||||||
if result.get('warning',False):
|
if result.get('warning',False):
|
||||||
|
@ -123,15 +124,16 @@ class account_invoice(osv.osv):
|
||||||
message = False
|
message = False
|
||||||
partner = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
partner = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||||
if partner.invoice_warn != 'no-message':
|
if partner.invoice_warn != 'no-message':
|
||||||
if partner.invoice_warn == 'block':
|
|
||||||
raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.invoice_warn_msg)
|
|
||||||
|
|
||||||
title = _("Warning for %s") % partner.name
|
title = _("Warning for %s") % partner.name
|
||||||
message = partner.invoice_warn_msg
|
message = partner.invoice_warn_msg
|
||||||
warning = {
|
warning = {
|
||||||
'title': title,
|
'title': title,
|
||||||
'message': message
|
'message': message
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if partner.invoice_warn == 'block':
|
||||||
|
return {'value': {'partner_id': False}, 'warning': warning}
|
||||||
|
|
||||||
result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id,
|
result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id,
|
||||||
date_invoice=date_invoice, payment_term=payment_term,
|
date_invoice=date_invoice, payment_term=payment_term,
|
||||||
partner_bank_id=partner_bank_id, company_id=company_id)
|
partner_bank_id=partner_bank_id, company_id=company_id)
|
||||||
|
@ -154,14 +156,15 @@ class stock_picking(osv.osv):
|
||||||
title = False
|
title = False
|
||||||
message = False
|
message = False
|
||||||
if partner.picking_warn != 'no-message':
|
if partner.picking_warn != 'no-message':
|
||||||
if partner.picking_warn == 'block':
|
|
||||||
raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.picking_warn_msg)
|
|
||||||
title = _("Warning for %s") % partner.name
|
title = _("Warning for %s") % partner.name
|
||||||
message = partner.picking_warn_msg
|
message = partner.picking_warn_msg
|
||||||
warning = {
|
warning = {
|
||||||
'title': title,
|
'title': title,
|
||||||
'message': message
|
'message': message
|
||||||
}
|
}
|
||||||
|
if partner.picking_warn == 'block':
|
||||||
|
return {'value': {'partner_id': False}, 'warning': warning}
|
||||||
|
|
||||||
result = super(stock_picking, self).onchange_partner_in(cr, uid, ids, partner_id, context)
|
result = super(stock_picking, self).onchange_partner_in(cr, uid, ids, partner_id, context)
|
||||||
if result.get('warning',False):
|
if result.get('warning',False):
|
||||||
warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
|
warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
|
||||||
|
@ -183,14 +186,15 @@ class stock_picking_in(osv.osv):
|
||||||
title = False
|
title = False
|
||||||
message = False
|
message = False
|
||||||
if partner.picking_warn != 'no-message':
|
if partner.picking_warn != 'no-message':
|
||||||
if partner.picking_warn == 'block':
|
|
||||||
raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.picking_warn_msg)
|
|
||||||
title = _("Warning for %s") % partner.name
|
title = _("Warning for %s") % partner.name
|
||||||
message = partner.picking_warn_msg
|
message = partner.picking_warn_msg
|
||||||
warning = {
|
warning = {
|
||||||
'title': title,
|
'title': title,
|
||||||
'message': message
|
'message': message
|
||||||
}
|
}
|
||||||
|
if partner.picking_warn == 'block':
|
||||||
|
return {'value': {'partner_id': False}, 'warning': warning}
|
||||||
|
|
||||||
result = super(stock_picking_in, self).onchange_partner_in(cr, uid, ids, partner_id, context)
|
result = super(stock_picking_in, self).onchange_partner_in(cr, uid, ids, partner_id, context)
|
||||||
if result.get('warning',False):
|
if result.get('warning',False):
|
||||||
warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
|
warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
|
||||||
|
@ -209,14 +213,15 @@ class stock_picking_out(osv.osv):
|
||||||
title = False
|
title = False
|
||||||
message = False
|
message = False
|
||||||
if partner.picking_warn != 'no-message':
|
if partner.picking_warn != 'no-message':
|
||||||
if partner.picking_warn == 'block':
|
|
||||||
raise osv.except_osv(_('Alert for %s!') % (partner.name), partner.picking_warn_msg)
|
|
||||||
title = _("Warning for %s") % partner.name
|
title = _("Warning for %s") % partner.name
|
||||||
message = partner.picking_warn_msg
|
message = partner.picking_warn_msg
|
||||||
warning = {
|
warning = {
|
||||||
'title': title,
|
'title': title,
|
||||||
'message': message
|
'message': message
|
||||||
}
|
}
|
||||||
|
if partner.picking_warn == 'block':
|
||||||
|
return {'value': {'partner_id': False}, 'warning': warning}
|
||||||
|
|
||||||
result = super(stock_picking_out, self).onchange_partner_in(cr, uid, ids, partner_id, context)
|
result = super(stock_picking_out, self).onchange_partner_in(cr, uid, ids, partner_id, context)
|
||||||
if result.get('warning',False):
|
if result.get('warning',False):
|
||||||
warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
|
warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title']
|
||||||
|
@ -256,12 +261,12 @@ class sale_order_line(osv.osv):
|
||||||
message = False
|
message = False
|
||||||
|
|
||||||
if product_info.sale_line_warn != 'no-message':
|
if product_info.sale_line_warn != 'no-message':
|
||||||
if product_info.sale_line_warn == 'block':
|
|
||||||
raise osv.except_osv(_('Alert for %s!') % (product_info.name), product_info.sale_line_warn_msg)
|
|
||||||
title = _("Warning for %s") % product_info.name
|
title = _("Warning for %s") % product_info.name
|
||||||
message = product_info.sale_line_warn_msg
|
message = product_info.sale_line_warn_msg
|
||||||
warning['title'] = title
|
warning['title'] = title
|
||||||
warning['message'] = message
|
warning['message'] = message
|
||||||
|
if product_info.sale_line_warn == 'block':
|
||||||
|
return {'value': {'product_id': False}, 'warning': warning}
|
||||||
|
|
||||||
result = super(sale_order_line, self).product_id_change( cr, uid, ids, pricelist, product, qty,
|
result = super(sale_order_line, self).product_id_change( cr, uid, ids, pricelist, product, qty,
|
||||||
uom, qty_uos, uos, name, partner_id,
|
uom, qty_uos, uos, name, partner_id,
|
||||||
|
@ -288,12 +293,12 @@ class purchase_order_line(osv.osv):
|
||||||
message = False
|
message = False
|
||||||
|
|
||||||
if product_info.purchase_line_warn != 'no-message':
|
if product_info.purchase_line_warn != 'no-message':
|
||||||
if product_info.purchase_line_warn == 'block':
|
|
||||||
raise osv.except_osv(_('Alert for %s!') % (product_info.name), product_info.purchase_line_warn_msg)
|
|
||||||
title = _("Warning for %s") % product_info.name
|
title = _("Warning for %s") % product_info.name
|
||||||
message = product_info.purchase_line_warn_msg
|
message = product_info.purchase_line_warn_msg
|
||||||
warning['title'] = title
|
warning['title'] = title
|
||||||
warning['message'] = message
|
warning['message'] = message
|
||||||
|
if product_info.purchase_line_warn == 'block':
|
||||||
|
return {'value': {'product_id': False}, 'warning': warning}
|
||||||
|
|
||||||
result = super(purchase_order_line, self).onchange_product_id(cr, uid, ids, pricelist, product, qty, uom,
|
result = super(purchase_order_line, self).onchange_product_id(cr, uid, ids, pricelist, product, qty, uom,
|
||||||
partner_id, date_order, fiscal_position_id)
|
partner_id, date_order, fiscal_position_id)
|
||||||
|
|
Loading…
Reference in New Issue