diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py index e66c3a9d523..92d84e05c26 100644 --- a/addons/account/report/account_partner_ledger.py +++ b/addons/account/report/account_partner_ledger.py @@ -28,6 +28,7 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header): def __init__(self, cr, uid, name, context=None): super(third_party_ledger, self).__init__(cr, uid, name, context=context) + self.init_bal_sum = 0.0 self.localcontext.update({ 'time': time, 'lines': self.lines, @@ -152,8 +153,10 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header): (partner.id, tuple(self.account_ids), tuple(move_state))) res = self.cr.dictfetchall() sum = 0.0 + if self.initial_balance: + sum = self.init_bal_sum for r in res: - sum = r['debit'] - r['credit'] + sum += r['debit'] - r['credit'] r['progress'] = sum full_account.append(r) return full_account @@ -178,7 +181,9 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header): " " + RECONCILE_TAG + " "\ "AND " + self.init_query + " ", (partner.id, tuple(move_state), tuple(self.account_ids))) - return self.cr.fetchall() + res = self.cr.fetchall() + self.init_bal_sum = res[0][2] + return res def _sum_debit_partner(self, partner): move_state = ['draft','posted'] @@ -414,4 +419,4 @@ report_sxw.report_sxw('report.account.third_party_ledger_other', 'res.partner', 'addons/account/report/account_partner_ledger_other.rml',parser=third_party_ledger, header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_sequence/__openerp__.py b/addons/account_sequence/__openerp__.py index 28c7ac44e7f..966cbcbc8ca 100644 --- a/addons/account_sequence/__openerp__.py +++ b/addons/account_sequence/__openerp__.py @@ -37,4 +37,4 @@ 'certificate': '', } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_sequence/account_sequence.py b/addons/account_sequence/account_sequence.py index c61720f857b..309bf3bc803 100644 --- a/addons/account_sequence/account_sequence.py +++ b/addons/account_sequence/account_sequence.py @@ -26,7 +26,7 @@ class account_move(osv.osv): _inherit = 'account.move' _columns = { - 'internal_sequence_number': fields.char('Internal Sequence Number', size=64, readonly=True), + 'internal_sequence_number': fields.char('Internal Number', size=64, readonly=True, help='Internal Sequence Number'), } def post(self, cr, uid, ids, context=None): @@ -34,7 +34,6 @@ class account_move(osv.osv): res = super(account_move, self).post(cr, uid, ids, context=context) seq_no = False for line in self.browse(cr, uid, ids): - # Todo: if there is not internal seq defined on journal raise error ? if line.journal_id.internal_sequence: seq_no = obj_sequence.get_id(cr, uid, line.journal_id.internal_sequence.id, context=context) if seq_no: @@ -52,4 +51,11 @@ class account_journal(osv.osv): account_journal() +class account_move_line(osv.osv): + _inherit = "account.move.line" + + _columns = { + 'internal_sequence_number': fields.related('move_id','internal_sequence_number', type='char', relation='account.move', help='Internal Sequence Number', string='Internal Number'), + } +account_move_line() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_sequence/account_sequence.xml b/addons/account_sequence/account_sequence.xml index 26a458fc8d1..dd9c1a36cd4 100644 --- a/addons/account_sequence/account_sequence.xml +++ b/addons/account_sequence/account_sequence.xml @@ -2,29 +2,80 @@ - - account.move.form.inherit - account.move - form - - - - + + account.move.form.inherit + account.move + form + + + + + + + + + + account.journal.form.inherit + account.journal + form + + + + + + + + + + account.move.tree.inherit + account.move + tree + + + + + - - - - - account.journal.form.inherit - account.journal - form - - - - + + + + view.move.search.inherit + account.move + + + + + + + - - + + + + view.move.line.form.inherit + account.move.line + + + + + + + + + + + + view.move.line.search.inherit + account.move.line + + + + + + + + + diff --git a/addons/account_sequence/account_sequence_data.xml b/addons/account_sequence/account_sequence_data.xml index f5d1117f51d..0059f7d41a9 100644 --- a/addons/account_sequence/account_sequence_data.xml +++ b/addons/account_sequence/account_sequence_data.xml @@ -1,15 +1,56 @@ - - + Internal Sequence Journal - account.journal - 1 + account.journal + 1 - + - + + + + + + Internal Number + internal_sequence_number + + + + + + + Internal Number + internal_sequence_number + + + + + + + Internal Number + internal_sequence_number + + + + + + + Internal Number + internal_sequence_number + + + + + + + Internal Number + internal_sequence_number + + + - \ No newline at end of file + + diff --git a/addons/point_of_sale/account_statement_demo.xml b/addons/point_of_sale/account_statement_demo.xml index 3862c3c97cb..c4850ded0a3 100644 --- a/addons/point_of_sale/account_statement_demo.xml +++ b/addons/point_of_sale/account_statement_demo.xml @@ -13,7 +13,7 @@ - + Bancontact Journal diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 8bee8a4245c..b4b2ff9cb9f 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -752,6 +752,7 @@ class pos_order(osv.osv): 'period_id': period, 'tax_code_id': tax_code_id, 'tax_amount': tax_amount, + 'partner_id': order.partner_id and order.partner_id.id or False }, context=context) # For each remaining tax with a code, whe create a move line @@ -817,6 +818,7 @@ class pos_order(osv.osv): or 0.0, 'journal_id': order.sale_journal.id, 'period_id': period, + 'partner_id': order.partner_id and order.partner_id.id or False }, context=context)) diff --git a/addons/point_of_sale/wizard/pos_add_product.py b/addons/point_of_sale/wizard/pos_add_product.py index a44ab52f1c9..dfbb96a4514 100644 --- a/addons/point_of_sale/wizard/pos_add_product.py +++ b/addons/point_of_sale/wizard/pos_add_product.py @@ -79,7 +79,6 @@ class add_product(osv.osv_memory): this = self.browse(cr, uid, ids[0], context) order_obj.add_product(cr, uid, record_id, this.product_id.id, this.quantity, context=context) - obj = order_obj.browse(cr, uid, record_id, context=context) order_obj.write(cr, uid, [record_id], {'state': 'done'}, context=context) return { 'name': _('Make Payment'),