Skip to content

Commit

Permalink
[15.0][MIG] account_invoice_refund_line_selection
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisOForgeFlow committed Jan 17, 2023
1 parent 59fbcd5 commit 0f52b69
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
1 change: 0 additions & 1 deletion account_invoice_refund_line_selection/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import wizards
from . import tests
2 changes: 1 addition & 1 deletion account_invoice_refund_line_selection/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Account invoice refund line",
"version": "14.0.1.0.2",
"version": "15.0.1.0.0",
"category": "Accounting & Finance",
"summary": "This module allows the user to refund specific lines in a invoice",
"author": "Creu Blanca, Odoo Community Association (OCA)",
Expand Down
24 changes: 20 additions & 4 deletions account_invoice_refund_line_selection/tests/test_refund_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def test_partial_refund_in_invoice(self):
active_model=self.in_invoice._name,
active_ids=self.in_invoice.ids,
)
.create({})
.create(
{
"journal_id": self.in_invoice.journal_id.id,
}
)
)
self.assertEqual(
reversal.selectable_invoice_lines_ids,
Expand Down Expand Up @@ -56,7 +60,11 @@ def test_total_refund_in_invoice(self):
active_model=self.in_invoice._name,
active_ids=self.in_invoice.ids,
)
.create({})
.create(
{
"journal_id": self.in_invoice.journal_id.id,
}
)
)
action = reversal.reverse_moves()
refund = self.env[action["res_model"]].browse(action["res_id"])
Expand All @@ -73,7 +81,11 @@ def test_partial_refund_out_invoice(self):
active_model=self.out_invoice._name,
active_ids=self.out_invoice.ids,
)
.create({})
.create(
{
"journal_id": self.out_invoice.journal_id.id,
}
)
)
self.assertEqual(
reversal.selectable_invoice_lines_ids,
Expand Down Expand Up @@ -102,7 +114,11 @@ def test_total_refund_out_invoice(self):
active_model=self.out_invoice._name,
active_ids=self.out_invoice.ids,
)
.create({})
.create(
{
"journal_id": self.out_invoice.journal_id.id,
}
)
)
action = reversal.reverse_moves()
refund = self.env[action["res_model"]].browse(action["res_id"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ def _prepare_default_reversal(self, move):
if self.refund_method == "refund_lines":
vals = res.copy()
vals["line_ids"] = [
(0, 0, li.copy_data({"move_id": False, "recompute_tax_line": True})[0])
(
0,
0,
li.with_context(include_business_fields=True).copy_data(
{"move_id": False, "recompute_tax_line": True}
)[0],
)
for li in self.line_ids
]
move = self.env["account.move"].new(vals)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
name="line_ids"
context="{'tree_view_ref': 'account.view_move_line_tree_grouped_sales_purchases'}"
>
<tree string="Invoice Lines">
<tree>
<field name="sequence" widget="handle" readonly="1" />
<field name="product_id" readonly="1" />
<field name="name" readonly="1" />
Expand Down

0 comments on commit 0f52b69

Please sign in to comment.