mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[FIX] account_banking_make_deposit
This commit is contained in:
@@ -114,14 +114,14 @@ class DepositTicket(models.Model):
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def get_move_line(self, deposit, type):
|
||||
def get_move_line(self, deposit, line_type):
|
||||
return {
|
||||
'type': type,
|
||||
'type': line_type,
|
||||
'name': deposit.name or '/',
|
||||
'debit': type == 'dest' and deposit.amount or 0.0,
|
||||
'credit': type == 'src' and deposit.amount or 0.0,
|
||||
'debit': line_type == 'dest' and deposit.amount or 0.0,
|
||||
'credit': line_type == 'src' and deposit.amount or 0.0,
|
||||
'account_id': (
|
||||
type == 'src' and
|
||||
line_type == 'src' and
|
||||
deposit.deposit_from_account_id.id or
|
||||
deposit.deposit_to_account_id.id
|
||||
),
|
||||
@@ -165,7 +165,7 @@ class DepositTicket(models.Model):
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def _get_amount(self):
|
||||
def _compute_amount(self):
|
||||
for deposit in self:
|
||||
total = 0.0
|
||||
for line in deposit.ticket_line_ids:
|
||||
@@ -272,7 +272,7 @@ class DepositTicket(models.Model):
|
||||
states={'done': [('readonly', True)]},
|
||||
)
|
||||
amount = fields.Float(
|
||||
'Amount', compute='_get_amount',
|
||||
'Amount', compute='_compute_amount',
|
||||
digits=dp.get_precision('Account'),
|
||||
help=(
|
||||
"Calculates the Total of All Deposit Lines - "
|
||||
@@ -280,7 +280,7 @@ class DepositTicket(models.Model):
|
||||
),
|
||||
)
|
||||
count_total = fields.Float(
|
||||
'Total Items', compute='_get_amount',
|
||||
'Total Items', compute='_compute_amount',
|
||||
help="Counts the total # of line items in the deposit ticket."
|
||||
)
|
||||
state = fields.Selection(
|
||||
|
||||
@@ -1,28 +1,27 @@
|
||||
<odoo>
|
||||
|
||||
<!-- Journal Item -->
|
||||
<record id="view_account_move_line_deposit_id" model="ir.ui.view">
|
||||
<field name="name">account.move.line.deposit.id</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="journal_id" position="after">
|
||||
<field name="deposit_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_move_line_deposit_id" model="ir.ui.view">
|
||||
<field name="name">account.move.line.deposit.id</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="journal_id" position="after">
|
||||
<field name="deposit_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_move_line_form_deposit_id" model="ir.ui.view">
|
||||
<field name="name">account.move.line.form.deposit.id</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_form"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="statement_id" position="after">
|
||||
<field name="deposit_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_move_line_form_deposit_id" model="ir.ui.view">
|
||||
<field name="name">account.move.line.form.deposit.id</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_form"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="statement_id" position="after">
|
||||
<field name="deposit_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</odoo>
|
||||
|
||||
@@ -80,7 +80,6 @@ class AddDepositItems(models.TransientModel):
|
||||
@api.multi
|
||||
def unselect_all(self):
|
||||
"""Unselect all the deposit item lines in the wizard."""
|
||||
"""Select all the deposit item lines in the wizard."""
|
||||
deposit_items_line = self.env['deposit.items.line']
|
||||
line_ids = deposit_items_line.search([(
|
||||
'deposit_items_id', '=', self.id)])
|
||||
|
||||
Reference in New Issue
Block a user