Skip to content

Commit

Permalink
[IMP] sale_unreconciled: text
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronHForgeFlow committed Oct 10, 2023
1 parent 397f169 commit d39cc8e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion sale_unreconciled/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This module adds a new fields "Unreconciled" on Sales Orders, that allows
This module adds a new field "Unreconciled" on Sales Orders, that allows
to find SO's with unreconciled journal items related.

This module allows to reconcile those SO in a single click. In accounting
Expand Down
4 changes: 2 additions & 2 deletions sale_unreconciled/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Accountants will be able to find a filters in Sale Orders that shows
Accountants will be able to find a filter in Sale Orders that shows
outstanding balances in interim accounts. Also there is a link in the SO
to those outstanding journal items.

Locking the SO will automatically reconcile the outstanding balance for the
stock iterim accounts.
stock interim accounts.
29 changes: 19 additions & 10 deletions sale_unreconciled/tests/test_sale_unreconciled.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def setUpClass(cls):
cls.partner = cls.partner_obj.create({"name": "Test Vendor"})
# Create standard product:
cls.product = cls.product_obj.create(
{"name": "saled Product", "type": "product"}
{"name": "Sold Product", "type": "product"}
)
# Create product that uses a reconcilable stock input account.
cls.stock_journal = cls.env["account.journal"].create(
Expand Down Expand Up @@ -81,7 +81,16 @@ def setUpClass(cls):
)
cls.product_to_reconcile = cls.product_obj.create(
{
"name": "saled Product (To reconcile)",
"name": "sold Product (To reconcile)",
"type": "product",
"standard_price": 100,
"valuation": "real_time",
"categ_id": cls.product_categ.id,
}
)
cls.product_to_reconcile2 = cls.product_obj.create(
{
"name": "saled Product 2 (To reconcile)",
"type": "product",
"standard_price": 100,
"valuation": "real_time",
Expand Down Expand Up @@ -406,7 +415,7 @@ def test_04_sale_mrp_anglo_saxon(self):
sum(aml_output.mapped("credit")), 150, "GDNI missing or mismatching"
)
# Now checking that the stock entries for the finished product are
# created and not the component (decide if that is derisable)
# created and not the component (decide if that is desirable)
self.assertNotEqual(
aml.filtered(
lambda ml: ml.product_id == self.finished_product
Expand Down Expand Up @@ -436,19 +445,19 @@ def test_06_dropship_not_reconcile_sale_journal_items(self):
so.with_context(force_confirm_sale_order=True).action_confirm()
self._do_picking(so.picking_ids, fields.Datetime.now())
self.assertTrue(so.unreconciled)
# as long stock_dropshipping is not dependency, I force the SO to be in
# the journal items of the incoming
# stock_dropshipping is not a dependency, forcing the SO to be in the
# journal items of the incoming
incoming_name = incoming.name
incoming_ji = self.env["account.move.line"].search(
[("move_id.ref", "=", incoming_name)]
)
incoming_ji.write({"sale_line_id": so.order_line[0], "sale_order_id": so.id})
# then I lock the so to force reconciliation
# Lock the SO to force reconciliation
so.action_done()
so._compute_unreconciled()
self.assertFalse(so.unreconciled)
# the SO is reconciled and the stock interim deliverd account is not
# reconciled yet
# The SO is reconciled and the stock interim deliverd account is still
# not reconciled
for jii in incoming_ji:
self.assertFalse(jii.reconciled)

Expand Down Expand Up @@ -486,7 +495,7 @@ def test_07_multicompany(self):
so.action_done()
so._compute_unreconciled()
self.assertFalse(so.unreconciled)
# we check all the journals for the so have the same company
# check all the journals for the so have the same company
ji = self.env["account.move.line"].search(
[("sale_order_id", "=", so.id), ("move_id", "!=", invoice.id)]
)
Expand All @@ -504,7 +513,7 @@ def test_08_reconcile_by_product(self):
self._do_picking(so.picking_ids, fields.Datetime.now())
# Do not create invoices to force discrepancy
so.action_done()
# we check all the journals are balanced by product
# Check if all the journals are balanced by product
ji_s1 = self.env["account.move.line"].search(
[
("sale_order_id", "=", so.id),
Expand Down
2 changes: 1 addition & 1 deletion sale_unreconciled/views/res_config_settings_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
groups="base.group_multi_company"
/>
<div class="text-muted">
Reconcile S O upon locking
Reconcile SO upon locking
</div>
</div>
<br />
Expand Down

0 comments on commit d39cc8e

Please sign in to comment.