Skip to content

Commit

Permalink
[MIG] account_check_deposit from v17 to v18
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-via committed Dec 5, 2024
1 parent de2c1d7 commit 55af165
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 34 deletions.
4 changes: 2 additions & 2 deletions account_check_deposit/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ Usage
=====

When you receive a check that pays a customer invoice, you can go to
that invoice and click on the button *Register Payment* and select the
*Checks Received* journal as *Journal*.
that invoice and click on the button *Pay* and select the *Checks
Received* journal as *Journal*.

When you want to deposit checks to the bank, go to the menu *Invoicing >
Customers > Checks Deposits*, create a new check deposit and set the
Expand Down
14 changes: 10 additions & 4 deletions account_check_deposit/models/account_check_deposit.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,19 @@ def _prepare_move_vals(self):
if line.payment_method_id.code == "manual" and line.payment_account_id:
counterpart_account_id = line.payment_account_id.id
break
# inspired by _get_outstanding_account() on account.payment
if not counterpart_account_id:
counterpart_account_id = (
self.company_id.account_journal_payment_debit_account_id.id
)
chart_template = self.with_context(
allowed_company_ids=self.company_id.root_id.ids
).env["account.chart.template"]
counterpart_account_id = chart_template.ref(
"account_journal_payment_debit_account_id", raise_if_not_found=False
).id
if not counterpart_account_id:
counterpart_account_id = self.company_id.transfer_account_id.id
if not counterpart_account_id:
raise UserError(
_("Missing 'Outstanding Receipts Account' on the company '%s'.")
_("Missing 'Internal Transfer' account on the company '%s'.")
% self.company_id.display_name
)

Expand Down
2 changes: 1 addition & 1 deletion account_check_deposit/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
When you receive a check that pays a customer invoice, you can go to
that invoice and click on the button *Register Payment* and select the
that invoice and click on the button *Pay* and select the
*Checks Received* journal as *Journal*.

When you want to deposit checks to the bank, go to the menu *Invoicing
Expand Down
4 changes: 2 additions & 2 deletions account_check_deposit/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<p>When you receive a check that pays a customer invoice, you can go to
that invoice and click on the button <em>Register Payment</em> and select the
<em>Checks Received</em> journal as <em>Journal</em>.</p>
that invoice and click on the button <em>Pay</em> and select the <em>Checks
Received</em> journal as <em>Journal</em>.</p>
<p>When you want to deposit checks to the bank, go to the menu <em>Invoicing &gt;
Customers &gt; Checks Deposits</em>, create a new check deposit and set the
journal <em>Checks Received</em> and select the bank account on which you want
Expand Down
40 changes: 15 additions & 25 deletions account_check_deposit/views/account_check_deposit_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
context="{'currency': currency_id,
'journal_id': journal_id}"
>
<tree>
<list>
<field name="date" />
<field name="date_maturity" optional="hide" />
<field name="journal_id" optional="hide" />
Expand All @@ -123,37 +123,32 @@
sum="1"
optional="hide"
/>
<field name="currency_id" invisible="1" />
<field name="company_currency_id" invisible="1" />
<field name="full_reconcile_id" optional="show" />
</tree>
<field name="currency_id" column_invisible="1" />
<field
name="company_currency_id"
column_invisible="1"
/>
<field name="matching_number" optional="show" />
</list>
</field>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
</div>
<chatter />
</form>
</field>
</record>
<record id="account_check_deposit_view_tree" model="ir.ui.view">
<field name="name">account.check.deposit.tree</field>
<field name="name">account.check.deposit.list</field>
<field name="model">account.check.deposit</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="name" decoration-bf="1" />
<field name="deposit_date" />
<field name="journal_id" />
<field name="journal_id" optional="hide" />
<field name="bank_journal_id" />
<field name="check_count" />
<field name="total_amount" decoration-bf="1" />
<field
name="currency_id"
groups="base.group_multi_currency"
optional="show"
/>
<field name="currency_id" column_invisible="1" />
<field
name="company_id"
groups="base.group_multi_company"
Expand All @@ -165,7 +160,7 @@
decoration-info="state == 'draft'"
decoration-success="state == 'done'"
/>
</tree>
</list>
</field>
</record>
<record id="view_check_deposit_search" model="ir.ui.view">
Expand All @@ -192,11 +187,6 @@
string="Deposit Date"
context="{'group_by': 'deposit_date'}"
/>
<filter
name="journal_groupby"
string="Check Journal"
context="{'group_by': 'journal_id'}"
/>
<filter
name="bank_journal_id_groupby"
string="Bank Account"
Expand All @@ -219,7 +209,7 @@
<record id="action_check_deposit_tree" model="ir.actions.act_window">
<field name="name">Checks Deposits</field>
<field name="res_model">account.check.deposit</field>
<field name="view_mode">tree,form,pivot</field>
<field name="view_mode">list,form,pivot</field>
</record>
<menuitem
action="action_check_deposit_tree"
Expand Down

0 comments on commit 55af165

Please sign in to comment.