diff --git a/addons/account/account.py b/addons/account/account.py index 491c0ebc425..994e32e1e28 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1945,15 +1945,17 @@ class account_tax(osv.osv): return super(account_tax, self).write(cr, uid, ids, vals, context=context) def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): + if context is None: + context = {} journal_pool = self.pool.get('account.journal') - if context and context.has_key('type'): + if context.get('type'): if context.get('type') in ('out_invoice','out_refund'): args += [('type_tax_use','in',['sale','all'])] elif context.get('type') in ('in_invoice','in_refund'): args += [('type_tax_use','in',['purchase','all'])] - if context and context.has_key('journal_id'): + if context.get('journal_id'): journal = journal_pool.browse(cr, uid, context.get('journal_id')) if journal.type in ('sale', 'purchase'): args += [('type_tax_use','in',[journal.type,'all'])] diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 940ac543cc8..bd586cd8c87 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -457,7 +457,7 @@ - + diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index b48e842caf5..640ac90249b 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1020,10 +1020,14 @@ class account_move_line(osv.osv): part_rec_ids = [rec['reconcile_partial_id'][0] for rec in part_recs] unlink_ids += rec_ids unlink_ids += part_rec_ids + all_moves = obj_move_line.search(cr, uid, ['|',('reconcile_id', 'in', unlink_ids),('reconcile_partial_id', 'in', unlink_ids)]) + all_moves = list(set(all_moves) - set(move_ids)) if unlink_ids: if opening_reconciliation: obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconciliation': False}) obj_move_rec.unlink(cr, uid, unlink_ids) + if all_moves: + obj_move_line.reconcile_partial(cr, uid, all_moves, 'auto',context=context) return True def unlink(self, cr, uid, ids, context=None, check=True): diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index e518d8899b2..6e25c46168f 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -31,7 +31,7 @@ - + diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index 4cf12098fff..23a309c1dda 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -454,15 +454,10 @@ class account_bank_statement(osv.osv): _inherit = "account.bank.statement" _name = "account.bank.statement" - def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None): - account_move_line_pool = self.pool.get('account.move.line') - account_bank_statement_line_pool = self.pool.get('account.bank.statement.line') - st_line = account_bank_statement_line_pool.browse(cr, uid, st_line_id, context=context) - result = super(account_bank_statement,self).create_move_from_st_line(cr, uid, st_line_id, company_currency_id, st_line_number, context=context) - move = st_line.move_ids and st_line.move_ids[0] or False - if move: - for line in move.line_id: - account_move_line_pool.write(cr, uid, [line.id], {'analytics_id':st_line.analytics_id.id}, context=context) + def _prepare_bank_move_line(self, cr, uid, st_line, move_id, amount, company_currency_id, context=None): + result = super(account_bank_statement,self)._prepare_bank_move_line(cr, uid, st_line, + move_id, amount, company_currency_id, context=context) + result['analytics_id'] = st_line.analytics_id.id return result def button_confirm_bank(self, cr, uid, ids, context=None): diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 771c6e15bd8..c2e3758aae2 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -937,19 +937,17 @@ class account_voucher(osv.osv): def cancel_voucher(self, cr, uid, ids, context=None): reconcile_pool = self.pool.get('account.move.reconcile') move_pool = self.pool.get('account.move') - + move_line_pool = self.pool.get('account.move.line') for voucher in self.browse(cr, uid, ids, context=context): # refresh to make sure you don't unlink an already removed move voucher.refresh() - recs = [] for line in voucher.move_ids: if line.reconcile_id: - recs += [line.reconcile_id.id] - if line.reconcile_partial_id: - recs += [line.reconcile_partial_id.id] - - reconcile_pool.unlink(cr, uid, recs) - + move_lines = [move_line.id for move_line in line.reconcile_id.line_id] + move_lines.remove(line.id) + reconcile_pool.unlink(cr, uid, [line.reconcile_id.id]) + if len(move_lines) >= 2: + move_line_pool.reconcile_partial(cr, uid, move_lines, 'auto',context=context) if voucher.move_id: move_pool.button_cancel(cr, uid, [voucher.move_id.id]) move_pool.unlink(cr, uid, [voucher.move_id.id]) diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 0985914b659..6b23be6b97e 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -327,7 +327,7 @@ - + @@ -546,7 +546,7 @@ - + diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml index 60b5934ac53..b71eee4220b 100644 --- a/addons/crm/crm_phonecall_view.xml +++ b/addons/crm/crm_phonecall_view.xml @@ -176,7 +176,7 @@ - + diff --git a/addons/mail/mail_mail_view.xml b/addons/mail/mail_mail_view.xml index cf3dd1e8233..4fe3a5fff80 100644 --- a/addons/mail/mail_mail_view.xml +++ b/addons/mail/mail_mail_view.xml @@ -91,7 +91,7 @@ mail.mail - + diff --git a/addons/note/__openerp__.py b/addons/note/__openerp__.py index 2653c558923..e94a5f60181 100644 --- a/addons/note/__openerp__.py +++ b/addons/note/__openerp__.py @@ -27,8 +27,8 @@ This module allows users to create their own notes inside OpenERP ================================================================= -Use notes to write meeting minutes, organize ideas, organize personnal todo -lists, etc. Each user manages his own personnal Notes. Notes are available to +Use notes to write meeting minutes, organize ideas, organize personal todo +lists, etc. Each user manages his own personal Notes. Notes are available to their authors only, but they can share notes to others users so that several people can work on the same note in real time. It's very efficient to share meeting minutes. diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index 68c6712f530..e42024153c1 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -142,7 +142,7 @@ - + diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 209bad47495..9b43b2cdc12 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -273,7 +273,7 @@ - + @@ -300,7 +300,7 @@ - + diff --git a/addons/sale/sale_demo.xml b/addons/sale/sale_demo.xml index 4653058c7bd..0c6e92e86ff 100644 --- a/addons/sale/sale_demo.xml +++ b/addons/sale/sale_demo.xml @@ -324,7 +324,6 @@ Thanks! service 150.0 100.0 - produce diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 7e6d84a890b..30a644ec200 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -253,7 +253,7 @@ - + @@ -421,7 +421,7 @@ - + @@ -447,7 +447,7 @@ - + diff --git a/addons/sale_stock/sale_stock_demo.xml b/addons/sale_stock/sale_stock_demo.xml index 2e7b641659d..42c09b7e9f0 100644 --- a/addons/sale_stock/sale_stock_demo.xml +++ b/addons/sale_stock/sale_stock_demo.xml @@ -54,6 +54,10 @@ make_to_order + + produce + + diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 9a77f836f03..eb14287ed96 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -718,7 +718,6 @@ class stock_picking(osv.osv): default = {} default = default.copy() picking_obj = self.browse(cr, uid, id, context=context) - move_obj = self.pool.get('stock.move') if ('name' not in default) or (picking_obj.name == '/'): seq_obj_name = 'stock.picking.' + picking_obj.type default['name'] = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name) @@ -727,10 +726,6 @@ class stock_picking(osv.osv): if 'invoice_state' not in default and picking_obj.invoice_state == 'invoiced': default['invoice_state'] = '2binvoiced' res = super(stock_picking, self).copy(cr, uid, id, default, context) - if res: - picking_obj = self.browse(cr, uid, res, context=context) - for move in picking_obj.move_lines: - move_obj.write(cr, uid, [move.id], {'tracking_id': False, 'prodlot_id': False, 'move_history_ids2': [(6, 0, [])], 'move_history_ids': [(6, 0, [])]}) return res def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): @@ -1797,12 +1792,15 @@ class stock_move(osv.osv): _('Quantities, Units of Measure, Products and Locations cannot be modified on stock moves that have already been processed (except by the Administrator).')) return super(stock_move, self).write(cr, uid, ids, vals, context=context) - def copy(self, cr, uid, id, default=None, context=None): + def copy_data(self, cr, uid, id, default=None, context=None): if default is None: default = {} default = default.copy() - default.update({'move_history_ids2': [], 'move_history_ids': []}) - return super(stock_move, self).copy(cr, uid, id, default, context=context) + default.setdefault('tracking_id', False) + default.setdefault('prodlot_id', False) + default.setdefault('move_history_ids', []) + default.setdefault('move_history_ids2', []) + return super(stock_move, self).copy_data(cr, uid, id, default, context=context) def _auto_init(self, cursor, context=None): res = super(stock_move, self)._auto_init(cursor, context=context) diff --git a/addons/stock/wizard/stock_location_product.py b/addons/stock/wizard/stock_location_product.py index ef7c9848160..62f80edcb57 100644 --- a/addons/stock/wizard/stock_location_product.py +++ b/addons/stock/wizard/stock_location_product.py @@ -28,8 +28,8 @@ class stock_location_product(osv.osv_memory): _columns = { 'from_date': fields.datetime('From'), 'to_date': fields.datetime('To'), - 'type': fields.selection([('inventory','Analyse Current Inventory'), - ('period','Analyse a Period')], 'Analyse Type', required=True), + 'type': fields.selection([('inventory','Analyze current inventory'), + ('period','Analyze period')], 'Analysis Type', required=True), } def action_open_window(self, cr, uid, ids, context=None):