diff --git a/addons/account/wizard/account_validate_account_move.py b/addons/account/wizard/account_validate_account_move.py index 297f3445606..7a7a74be04b 100644 --- a/addons/account/wizard/account_validate_account_move.py +++ b/addons/account/wizard/account_validate_account_move.py @@ -34,7 +34,7 @@ class validate_account_move(osv.osv_memory): if context is None: context = {} data = self.read(cr, uid, ids[0], context=context) - ids_move = obj_move.search(cr, uid, [('state','=','draft'),('journal_id','in',tuple(data['journal_ids'])),('period_id','in',tuple(data['period_ids']))]) + ids_move = obj_move.search(cr, uid, [('state','=','draft'),('journal_id','in',tuple(data['journal_ids'])),('period_id','in',tuple(data['period_ids']))], order='date') if not ids_move: raise osv.except_osv(_('Warning!'), _('Specified journals do not have any account move entries in draft state for the specified periods.')) obj_move.button_validate(cr, uid, ids_move, context=context) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 5d0ed8297c2..b6781360c41 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -732,13 +732,17 @@ class account_voucher(osv.osv): total_credit = 0.0 total_debit = 0.0 - account_type = 'receivable' + account_type = None + if context.get('account_id'): + account_type = self.pool['account.account'].browse(cr, uid, context['account_id'], context=context).type if ttype == 'payment': - account_type = 'payable' + if not account_type: + account_type = 'payable' total_debit = price or 0.0 else: total_credit = price or 0.0 - account_type = 'receivable' + if not account_type: + account_type = 'receivable' if not context.get('move_line_ids', False): ids = move_line_pool.search(cr, uid, [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)], context=context) @@ -827,9 +831,9 @@ class account_voucher(osv.osv): else: default['value']['line_dr_ids'].append(rs) - if ttype == 'payment' and len(default['value']['line_cr_ids']) > 0: + if len(default['value']['line_cr_ids']) > 0: default['value']['pre_line'] = 1 - elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0: + elif len(default['value']['line_dr_ids']) > 0: default['value']['pre_line'] = 1 default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price, ttype) return default diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index 41d3c6fc1f6..b7ea4b8fc71 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -213,10 +213,10 @@ - + - + onchange_amount(amount) @@ -230,7 +230,7 @@ - + @@ -241,7 +241,7 @@ - + diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index 12a1cec79f4..db37a7ac505 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -1123,7 +1123,7 @@ class calendar_event(osv.Model): def get_end_date(data): if data.get('end_date'): - data['end_date_new'] = ''.join((re.compile('\d')).findall(data.get('end_date'))) + 'T235959Z' + data['end_date_new'] = ''.join((re.compile('\d')).findall(data.get('end_date'))) + 'T235959' return (data.get('end_type') == 'count' and (';COUNT=' + str(data.get('count'))) or '') +\ ((data.get('end_date_new') and data.get('end_type') == 'end_date' and (';UNTIL=' + data.get('end_date_new'))) or '') diff --git a/addons/l10n_pa/__openerp__.py b/addons/l10n_pa/__openerp__.py index 05e7ad5aefc..792c3de07ea 100644 --- a/addons/l10n_pa/__openerp__.py +++ b/addons/l10n_pa/__openerp__.py @@ -44,8 +44,6 @@ Con la ColaboraciĆ³n de ], "demo_xml": [ ], - "data": [ - ], "active": False, "installable": True, "certificate" : "", diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 2bb29433643..3480ab47221 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -517,7 +517,8 @@ class pos_order(osv.osv): # Keep only new orders submitted_references = [o['data']['name'] for o in orders] - existing_orders = self.search_read(cr, uid, domain=[('pos_reference', 'in', submitted_references)], fields=['pos_reference'], context=context) + existing_order_ids = self.search(cr, uid, [('pos_reference', 'in', submitted_references)], context=context) + existing_orders = self.read(cr, uid, existing_order_ids, ['pos_reference'], context=context) existing_references = set([o['pos_reference'] for o in existing_orders]) orders_to_save = [o for o in orders if o['data']['name'] not in existing_references] diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index 5e3f8b54752..1e7076d9c8f 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -439,7 +439,8 @@ class procurement_order(osv.osv): if len(to_cancel): move_obj.action_cancel(cr, uid, to_cancel) if len(to_assign): - move_obj.write(cr, uid, to_assign, {'state': 'assigned'}) + move_obj.write(cr, uid, to_assign, {'state': 'confirmed'}) + move_obj.action_assign(cr, uid, to_assign) self.write(cr, uid, ids, {'state': 'cancel'}) for id in ids: workflow.trg_trigger(uid, 'procurement.order', id, cr) diff --git a/addons/project/project.py b/addons/project/project.py index eea20be48a9..66b00e03f82 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -287,7 +287,9 @@ class project(osv.osv): "- Followers Only: employees see only the followed tasks or issues; if portal\n" " is activated, portal users see the followed tasks or issues."), 'state': fields.selection([('template', 'Template'),('draft','New'),('open','In Progress'), ('cancelled', 'Cancelled'),('pending','Pending'),('close','Closed')], 'Status', required=True,), - 'doc_count':fields.function(_get_attached_docs, string="Number of documents attached", type='int') + 'doc_count': fields.function( + _get_attached_docs, string="Number of documents attached", type='integer' + ) } def _get_type_common(self, cr, uid, context):