[MERGE] forward port of branch saas-3 up to 474eae9a43
This commit is contained in:
commit
5739aebfb1
|
@ -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:
|
||||
|
|
|
@ -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':
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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']}"/>
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -685,7 +685,7 @@ class Ecommerce(http.Controller):
|
|||
if not order:
|
||||
return {
|
||||
'state': 'error',
|
||||
'message': '<p>There seems to be an error with your request.</p>',
|
||||
'message': '<p>%s</p>' % _('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': '<p>There seems to be an error with your request.</p>',
|
||||
'message': '<p>%s</p>' % _('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 = '<p>Your payment has been received.</p>'
|
||||
message = '<p>%s</p>' % _('Your payment has been received.')
|
||||
elif state == 'cancel':
|
||||
message = '<p>The payment seems to have been canceled.</p>'
|
||||
message = '<p>%s</p>' % _('The payment seems to have been canceled.')
|
||||
elif state == 'pending' and tx.acquirer_id.validation == 'manual':
|
||||
message = '<p>Your transaction is waiting confirmation.</p>'
|
||||
message = '<p>%s</p>' % _('Your transaction is waiting confirmation.')
|
||||
if tx.acquirer_id.post_msg:
|
||||
message += tx.acquirer_id.post_msg
|
||||
else:
|
||||
message = '<p>Your transaction is waiting confirmation.</p>'
|
||||
message = '<p>%s</p>' % _('Your transaction is waiting confirmation.')
|
||||
validation = tx.acquirer_id.validation
|
||||
|
||||
return {
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -794,14 +794,14 @@
|
|||
|
||||
<div class="clearfix"/>
|
||||
|
||||
<div class="form-group col-lg-6" groups="sale.group_delivery_invoice_address">
|
||||
<div class="form-group col-lg-6">
|
||||
<label>
|
||||
<input type="checkbox" name="shipping_different" t-att-checked="shipping"/>
|
||||
<span>Ship to a different address</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="js_shipping row mb16" t-att-style="not shipping and 'display:none' or ''" groups="sale.group_delivery_invoice_address">
|
||||
<div class="js_shipping row mb16" t-att-style="not shipping and 'display:none' or ''">
|
||||
<h3 class="oe_shipping col-lg-12 mt16">Shipping Information</h3>
|
||||
|
||||
<div t-attf-class="form-group #{error.get('shipping_name') and 'has-error' or ''} col-lg-6">
|
||||
|
@ -945,7 +945,7 @@
|
|||
<div>
|
||||
<a href="/shop/checkout"><span class="fa fa-arrow-right"/> Change Address</a>
|
||||
</div>
|
||||
<t groups="sale.group_delivery_invoice_address">
|
||||
<t>
|
||||
<h4 class="mt32">Ship To:</h4>
|
||||
<t t-if="website_sale_order.partner_shipping_id and website_sale_order.partner_shipping_id.id != website_sale_order.partner_invoice_id.id">
|
||||
<div t-field="order.partner_shipping_id" t-field-options='{
|
||||
|
@ -1034,7 +1034,7 @@
|
|||
"widget": "contact",
|
||||
"fields": ["address", "name", "phone", "email"]
|
||||
}'/>
|
||||
<t groups="sale.group_delivery_invoice_address">
|
||||
<t>
|
||||
<h4 class="mt32">Ship To:</h4>
|
||||
<t t-if="order.partner_shipping_id and order.partner_shipping_id.id != order.partner_invoice_id.id">
|
||||
<div t-field="order.partner_shipping_id" t-field-options='{
|
||||
|
|
|
@ -303,10 +303,10 @@ class ir_values(osv.osv):
|
|||
(SELECT company_id from res_users where id = %%s)
|
||||
)
|
||||
%s
|
||||
ORDER BY v.user_id, u.company_id"""
|
||||
ORDER BY v.user_id, u.company_id, v.key2"""
|
||||
params = ('default', model, uid, uid)
|
||||
if condition:
|
||||
query %= 'AND v.key2 = %s'
|
||||
query %= 'AND (v.key2 = %s OR v.key2 IS NULL)'
|
||||
params += (condition[:200],)
|
||||
else:
|
||||
query %= 'AND v.key2 is NULL'
|
||||
|
|
Loading…
Reference in New Issue