mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
account_balance_line: Use existing field
This commit is contained in:
committed by
Mihai Fekete
parent
72588be744
commit
2fe20b172b
@@ -1,6 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2010-2014 Camptocamp - Vincent Renaville
|
||||
# Copyright 2016 Tecnativa - Vicent Cubells
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import models
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
# Copyright 2016 Tecnativa - Vicent Cubells
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
{
|
||||
'name': 'Balance on lines',
|
||||
'name': 'Balance on journal items',
|
||||
'summary': 'Display balance totals in move line view',
|
||||
'version': '9.0.1.0.0',
|
||||
'version': '9.0.1.1.0',
|
||||
'category': 'Accounting',
|
||||
'website': 'http://www.tecnativa.com,',
|
||||
'author': "Camptocamp,"
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2010-2014 Camptocamp - Vincent Renaville
|
||||
# Copyright 2016 Tecnativa - Vicent Cubells
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import account_move_line
|
||||
@@ -1,21 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2010-2014 Camptocamp - Vincent Renaville
|
||||
# Copyright 2016 Tecnativa - Vicent Cubells
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, fields, api
|
||||
import openerp.addons.decimal_precision as dp
|
||||
|
||||
|
||||
class AccountMoveLine(models.Model):
|
||||
_inherit = "account.move.line"
|
||||
|
||||
@api.multi
|
||||
@api.depends('credit', 'debit')
|
||||
def _line_balance(self):
|
||||
for line in self:
|
||||
line.line_balance = line.debit - line.credit
|
||||
|
||||
line_balance = fields.Float(
|
||||
compute='_line_balance', string='Balance', store=True,
|
||||
digits=dp.get_precision('Account'))
|
||||
@@ -2,7 +2,6 @@
|
||||
<odoo>
|
||||
|
||||
<record id="view_account_move_line_filter_balance" model="ir.ui.view">
|
||||
<field name="name">Journal Items add visibilty for balance</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
|
||||
<field name="priority" eval="9999"/>
|
||||
@@ -17,12 +16,11 @@
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="account_move_line_balance_custom">
|
||||
<field name="name">account_move_line_balance_custom</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="credit" position="after" >
|
||||
<field name="line_balance" sum="Total Balance" invisible="context.get('invisible_balance', True)"/>
|
||||
<field name="balance" sum="Total Balance" invisible="context.get('invisible_balance', True)"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user