Skip to content

Commit

Permalink
[MIG] account_payment_return: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
absal-smile committed Feb 6, 2025
1 parent 85fccc0 commit 96300b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion account_payment_return/models/payment_return.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _prepare_move_line(self, move, total_amount):
"debit": 0.0,
"credit": total_amount,
"account_id": self.payment_method_line_id.payment_account_id.id
or self.company_id.account_journal_payment_debit_account_id.id,
or self.company_id.account_journal_suspense_account_id.id,
"move_id": move.id,
"journal_id": move.journal_id.id,
}
Expand Down
2 changes: 1 addition & 1 deletion account_payment_return/tests/test_payment_return.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def test_payments_widget(self):
self.assertEqual(len(info["content"]), 2)
self.assertEqual(info["content"][1]["amount"], -500.0)

def test_reason_name_search(self):
def test_reason_search_display_name(self):
reason = self.env["payment.return.reason"]
line = self.payment_return.line_ids[0]
line.reason_id = reason.name_search("RTEST")[0]
Expand Down
17 changes: 7 additions & 10 deletions account_payment_return/views/payment_return_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
context="{'default_date': date}"
readonly="state in ['cancelled', 'done']"
>
<tree editable="top">
<list editable="top">
<field name="date" />
<field name="concept" />
<field name="reason_id" />
Expand Down Expand Up @@ -113,24 +113,21 @@
required="expense_account"
optional="show"
/>
</tree>
</list>
</field>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="message_ids" widget="mail_thread" />
</div>
<chatter />
</form>
</field>
</record>
<record model="ir.ui.view" id="payment_return_tree_view">
<field name="name">payment.return.tree</field>
<field name="model">payment.return</field>
<field name="type">tree</field>
<field name="type">list</field>
<field name="arch" type="xml">
<tree decoration-muted="state == 'cancelled'">
<list decoration-muted="state == 'cancelled'">
<field name="name" readonly="state in ['cancelled', 'done']" />
<field name="date" readonly="state in ['cancelled', 'done']" />
<field name="journal_id" readonly="state in ['cancelled', 'done']" />
Expand All @@ -141,7 +138,7 @@
/>
<field name="state" />
<field name="total_amount" sum="Total amount" />
</tree>
</list>
</field>
</record>
<record model="ir.ui.view" id="payment_return_search_view">
Expand Down Expand Up @@ -171,7 +168,7 @@
<record model="ir.actions.act_window" id="payment_return_action">
<field name="name">Customer Payment Returns</field>
<field name="res_model">payment.return</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>
<menuitem
id="payment_return_menu"
Expand Down

0 comments on commit 96300b4

Please sign in to comment.