# -*- coding: utf-8 -*-
##############################################################################
#
#    Odoo, Open Source Management Solution
#    Copyright (C) 2016 Prime Consulting SA, Cape Verde (<http://prime.cv>).
#
##############################################################################

from odoo import models, fields, api

class AccountMove(models.Model):
    _inherit = "account.move"

    @api.multi
    @api.depends('line_ids.debit', 'line_ids.credit')
    def _move_credit_compute(self):
        for move in self:
            total = 0.0
            for line in move.line_ids:
                total += line.credit
            move.move_credit = total
    move_credit = fields.Monetary(compute='_move_credit_compute', store=True)
