<commit_before># -*- coding: utf-8 -*-
from openerp import api, models, _


class account_tax_settlement(models.Model):
    _inherit = 'account.tax.settlement'

    @api.multi
    def settlement_pay(self):
        self.ensure_one()
        view_id = self.env['ir.model.data'].xmlid_to_res_id(
            'account_voucher.view_vendor_receipt_dialog_form')
        return {
            'name': _("Pay Settlement"),
            'view_mode': 'form',
            'view_id': view_id,
            'view_type': 'form',
            'res_model': 'account.voucher',
            'type': 'ir.actions.act_window',
            'nodestroy': True,
            'target': 'new',
            'domain': '[]',
            'context': {
                'payment_expected_currency': self.company_id.currency_id.id,
                'default_partner_id': self.partner_id.id,
                'default_amount': self.residual,
                'default_reference': self.name,
                'close_after_process': True,
                # 'invoice_type': self.type,
                # 'invoice_id': self.id,
                'default_type': 'payment',
                'type': 'payment'
            }
        }<commit_msg>IMP on settlement<commit_after># -*- coding: utf-8 -*-
from openerp import api, models


class account_tax_settlement(models.Model):
    _inherit = 'account.tax.settlement'

    @api.multi
    def settlement_pay(self):
        self.ensure_one()
        return self.move_id.with_context(
            from_settlement=True).create_voucher('payment')
{'fraction_non_alphanumeric': 0.12964169381107493, 'fraction_numerical': 0.0013029315960912053, 'mean_word_length': 2.011764705882353, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3398005', 'n_tokens_mistral': 480, 'n_tokens_neox': 459, 'n_words': 78}