~camptocamp/openerp-swiss-localization/7.0-pending-merge

« back to all changes in this revision

Viewing changes to l10n_ch_payment_slip/wizard/bvr_import.py

  • Committer: nicolas.bessi at camptocamp
  • Author(s): romain.deheele at camptocamp
  • Date: 2013-09-23 07:15:24 UTC
  • mfrom: (177.1.11 multi-payment-bvr)
  • Revision ID: nicolas.bessi@camptocamp.com-20130923071524-sv1b3qa46ocug3dr
[MRG]release 7.2 adds support of multi payments term BVR.
Adds a new report that will allows to print BVR from invoice using account.move.line So if there is many payment terms many BVR will be print per invoice.
The previous report is kept but deprecated.
A new field is addes on account.move.line transaction_ref.
Changes to manage bvr_reference and transaction_ref depending on payment terms are automatic

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
                records.append(record)
119
119
        return records
120
120
 
 
121
    #deprecated
121
122
    def _create_voucher_from_record(self, cursor, uid, record,
122
123
                                    statement, line_ids, context=None):
123
124
        """Create a voucher with voucher line"""
227
228
                                             ('account_id.type', 'in', ['receivable', 'payable']),
228
229
                                             ('journal_id.type', '=', 'sale')],
229
230
                                            order='date desc', context=context)
 
231
            #for multiple payments
 
232
            if not line_ids:
 
233
                line_ids = move_line_obj.search(cursor, uid,
 
234
                                                [('transaction_ref', '=', reference),
 
235
                                                ('reconcile_id', '=', False),
 
236
                                                ('account_id.type', 'in', ['receivable', 'payable']),
 
237
                                                ('journal_id.type', '=', 'sale')],
 
238
                                                order='date desc', context=context)
230
239
            if not line_ids:
231
240
                line_ids = self._reconstruct_invoice_ref(cursor, uid, reference, None)
232
241
            if line_ids and voucher_enabled: