summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorMartin Trigaux <mat@openerp.com>2014-07-22 13:39:15 +0200
committerMartin Trigaux <mat@openerp.com>2014-07-22 13:39:15 +0200
commit1f878f152a2c2900eb1e740f752f7fe7e7c19b08 (patch)
tree9816af5c5807a1b14463acbda2448a3bfb0a40b6 /addons
parentf9170a04fba1fecd27f89ce67d556836de42fa4a (diff)
parent680f9554b449e1b0fb95aa4149e7a2612438a250 (diff)
[MERGE] forward port of branch 7.0 up to 680f955
Diffstat (limited to 'addons')
-rw-r--r--addons/account/account_move_line.py2
-rw-r--r--addons/crm/crm_phonecall.py1
-rw-r--r--addons/hr_payroll/hr_payroll.py2
-rw-r--r--addons/procurement/wizard/schedulers_all.py16
-rw-r--r--addons/project/project_view.xml2
-rw-r--r--addons/sale/wizard/sale_make_invoice_advance.py1
6 files changed, 21 insertions, 3 deletions
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 71654912ac0..450b6ba25a6 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 aab9657ae5d..41538508e78 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'
@@ -45,7 +49,17 @@ 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.db.cursor()
+ new_cr = pooler.get_db(cr.dbname).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 @@
</h1>
<group>
<group>
- <field name="project_id" domain="[('state', '!=', 'close')]" on_change="onchange_project(project_id)" context="{'default_use_tasks':1}"/>
+ <field name="project_id" domain="[('state','not in', ('close', 'cancelled'))]" on_change="onchange_project(project_id)" context="{'default_use_tasks':1}"/>
<field name="user_id"
options='{"no_open": True}'
context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'project.group_project_user']}"/>
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'),