# -*- coding: utf-8 -*- from openerp.http import request from res_bank_payment_type import get_bank_payment_types from server_datetime import get_date _MODEL = 'res.bank.payments' ''' ''' def create_bank_payment_statement(data, currency_id, date, journal_id=None, partner_id=None, supplier_id=None): bank_payments_type_id = request.env['res.bank.payments.type'].get_bank_payments_type_id(journal_id) values = { 'bank_payments_type_id': bank_payments_type_id, 'bank_id': data.get('bank_id', None), 'currency_id': currency_id, 'date': date, 'customer_id': partner_id, 'number_cta': data.get('number_cta', None), 'number_cta_origin': data.get('number_cta_origin', None), 'name_holder': data.get('name_holder', None), 'number': data.get('number'), 'date_maturity': data.get('date_maturity', '') or get_date(), 'supplier_id': supplier_id, 'amount_total': data.get('amount', None) } request.env['res.bank.payments'].create(values)