diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index d1186396b12..3483472fb30 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1027,6 +1027,8 @@ class account_move_line(osv.osv): all_moves = list(set(all_moves) - set(move_ids)) if unlink_ids: if opening_reconciliation: + raise osv.except_osv(_('Warning!'), + _('Opening Entries have already been generated. Please run "Cancel Closing Entries" wizard to cancel those entries and then run this wizard.')) obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconciliation': False}) obj_move_rec.unlink(cr, uid, unlink_ids) if len(all_moves) >= 2: diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index 19bc98c585a..941b4d4b0be 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -140,6 +140,7 @@ class crm_phonecall(osv.osv): 'partner_phone' : call.partner_phone, 'partner_mobile' : call.partner_mobile, 'priority': call.priority, + 'opportunity_id': call.opportunity_id and call.opportunity_id.id or False, } new_id = self.create(cr, uid, vals, context=context) if action == 'log': diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 3c01847f812..51dc67dd22f 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -379,7 +379,7 @@ class hr_payslip(osv.osv): #OR if it starts between the given dates clause_2 = ['&',('date_start', '<=', date_to),('date_start','>=', date_from)] #OR if it starts before the date_from and finish after the date_end (or never finish) - clause_3 = [('date_start','<=', date_from),'|',('date_end', '=', False),('date_end','>=', date_to)] + clause_3 = ['&',('date_start','<=', date_from),'|',('date_end', '=', False),('date_end','>=', date_to)] clause_final = [('employee_id', '=', employee.id),'|','|'] + clause_1 + clause_2 + clause_3 contract_ids = contract_obj.search(cr, uid, clause_final, context=context) return contract_ids diff --git a/addons/procurement/wizard/schedulers_all.py b/addons/procurement/wizard/schedulers_all.py index c0f1cfcc2df..59712d951c4 100644 --- a/addons/procurement/wizard/schedulers_all.py +++ b/addons/procurement/wizard/schedulers_all.py @@ -19,10 +19,14 @@ # ############################################################################## +import logging import threading +from openerp import pooler, SUPERUSER_ID, tools from openerp.osv import fields, osv +_logger = logging.getLogger(__name__) + class procurement_compute_all(osv.osv_memory): _name = 'procurement.order.compute.all' _description = 'Compute all schedulers' @@ -46,6 +50,16 @@ class procurement_compute_all(osv.osv_memory): proc_obj = self.pool.get('procurement.order') #As this function is in a new thread, i need to open a new cursor, because the old one may be closed new_cr = self.pool.cursor() + scheduler_cron_id = self.pool['ir.model.data'].get_object_reference(new_cr, SUPERUSER_ID, 'procurement', 'ir_cron_scheduler_action')[1] + # Avoid to run the scheduler multiple times in the same time + try: + with tools.mute_logger('openerp.sql_db'): + new_cr.execute("SELECT id FROM ir_cron WHERE id = %s FOR UPDATE NOWAIT", (scheduler_cron_id,)) + except Exception: + _logger.info('Attempt to run procurement scheduler aborted, as already running') + new_cr.rollback() + new_cr.close() + return {} for proc in self.browse(new_cr, uid, ids, context=context): proc_obj.run_scheduler(new_cr, uid, automatic=proc.automatic, use_new_cursor=new_cr.dbname,\ context=context) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index f1583097496..91b807197e8 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -381,7 +381,7 @@ - + diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index c3f1d6cade4..3d8cc3e6997 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -37,6 +37,7 @@ class sale_advance_payment_inv(osv.osv_memory): Use Some Order Lines to invoice a selection of the sales order lines."""), 'qtty': fields.float('Quantity', digits=(16, 2), required=True), 'product_id': fields.many2one('product.product', 'Advance Product', + domain=[('type', '=', 'service')], help="""Select a product of type service which is called 'Advance Product'. You may have to create it and set it as a default value on this field."""), 'amount': fields.float('Advance Amount', digits_compute= dp.get_precision('Account'), diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 938f1877731..75262b7af90 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -685,7 +685,7 @@ class Ecommerce(http.Controller): if not order: return { 'state': 'error', - 'message': '

There seems to be an error with your request.

', + 'message': '

%s

' % _('There seems to be an error with your request.'), } tx_ids = request.registry['payment.transaction'].search( @@ -697,7 +697,7 @@ class Ecommerce(http.Controller): if order.amount_total: return { 'state': 'error', - 'message': '

There seems to be an error with your request.

', + 'message': '

%s

' % _('There seems to be an error with your request.'), } else: state = 'done' @@ -707,15 +707,15 @@ class Ecommerce(http.Controller): tx = request.registry['payment.transaction'].browse(cr, uid, tx_ids[0], context=context) state = tx.state if state == 'done': - message = '

Your payment has been received.

' + message = '

%s

' % _('Your payment has been received.') elif state == 'cancel': - message = '

The payment seems to have been canceled.

' + message = '

%s

' % _('The payment seems to have been canceled.') elif state == 'pending' and tx.acquirer_id.validation == 'manual': - message = '

Your transaction is waiting confirmation.

' + message = '

%s

' % _('Your transaction is waiting confirmation.') if tx.acquirer_id.post_msg: message += tx.acquirer_id.post_msg else: - message = '

Your transaction is waiting confirmation.

' + message = '

%s

' % _('Your transaction is waiting confirmation.') validation = tx.acquirer_id.validation return { diff --git a/addons/website_sale/models/product_characteristics.py b/addons/website_sale/models/product_characteristics.py index ae641184db3..84eebdcd73b 100644 --- a/addons/website_sale/models/product_characteristics.py +++ b/addons/website_sale/models/product_characteristics.py @@ -66,6 +66,7 @@ class attributes_value(osv.Model): class attributes_product(osv.Model): _name = "product.attribute.line" _order = 'attribute_id, value_id, value' + _rec_name = 'attribute_id' _columns = { 'value': fields.float('Numeric Value'), 'value_id': fields.many2one('product.attribute.value', 'Textual Value'), diff --git a/addons/website_sale/views/website_sale.xml b/addons/website_sale/views/website_sale.xml index 027ee6be08b..381d7b71f7f 100644 --- a/addons/website_sale/views/website_sale.xml +++ b/addons/website_sale/views/website_sale.xml @@ -794,14 +794,14 @@
-
+
-
+

Shipping Information

@@ -945,7 +945,7 @@ - +

Ship To:

- +

Ship To: