<commit_before># -*- coding: utf-8 -*-

import odoo.addons.decimal_precision as dp
from odoo import models, fields, api
from odoo import tools


class report_auxiliary_accounting(models.Model):
    _name = 'report.auxiliary.accounting'
    _auto = False
    _description = u'辅助核算余额表'

    account_id = fields.Many2one('finance.account', u'会计科目')
    auxiliary_id = fields.Many2one(
        'auxiliary.financing', u'辅助核算', ondelete='restrict')
    debit = fields.Float(u'借方金额', digits=dp.get_precision('Amount'))
    credit = fields.Float(u'贷方金额', digits=dp.get_precision('Amount'))
    balance = fields.Float(u'余额', digits=dp.get_precision('Amount'))
    company_id = fields.Many2one(
        'res.company',
        string=u'公司',
        change_default=True,
        default=lambda self: self.env['res.company']._company_default_get())

    @api.multi
    def view_voucher_line_detail(self):
        return {
            'type': 'ir.actions.act_window',
            'res_model': 'voucher.line',
            'name': u"%s - %s 明细行" % (self.account_id.name, self.auxiliary_id.name),
            'view_type': 'form',
            'view_mode': 'tree',
            'domain': [('account_id', '=', self.account_id.id), ('auxiliary_id', '=', self.auxiliary_id.id)],
        }

    def init(self):
        cr = self._cr
        tools.drop_view_if_exists(cr, 'report_auxiliary_accounting')<commit_msg>[FIX]辅助核算余额表，按公司展开报 #1277<commit_after># -*- coding: utf-8 -*-

import odoo.addons.decimal_precision as dp
from odoo import models, fields, api
from odoo import tools


class report_auxiliary_accounting(models.Model):
    _name = 'report.auxiliary.accounting'
    _auto = False
    _description = u'辅助核算余额表'

    account_id = fields.Many2one('finance.account', u'会计科目')
    auxiliary_id = fields.Many2one(
        'auxiliary.financing', u'辅助核算', ondelete='restrict')
    debit = fields.Float(u'借方金额', digits=dp.get_precision('Amount'))
    credit = fields.Float(u'贷方金额', digits=dp.get_precision('Amount'))
    balance = fields.Float(u'余额', digits=dp.get_precision('Amount'))

    @api.multi
    def view_voucher_line_detail(self):
        return {
            'type': 'ir.actions.act_window',
            'res_model': 'voucher.line',
            'name': u"%s - %s 明细行" % (self.account_id.name, self.auxiliary_id.name),
            'view_type': 'form',
            'view_mode': 'tree',
            'domain': [('account_id', '=', self.account_id.id), ('auxiliary_id', '=', self.auxiliary_id.id)],
        }

    def init(self):
        cr = self._cr
        tools.drop_view_if_exists(cr, 'report_auxiliary_accounting')
{'fraction_non_alphanumeric': 0.15163147792706333, 'fraction_numerical': 0.004222648752399232, 'mean_word_length': 3.203225806451613, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '7650477', 'n_tokens_mistral': 960, 'n_tokens_neox': 966, 'n_words': 150}