Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions purchase_unreconciled/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from . import purchase_order
from . import company
from . import res_config_settings
from . import account_move
from . import account_move_line
7 changes: 7 additions & 0 deletions purchase_unreconciled/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from odoo import fields, models


class AccountMove(models.Model):
_inherit = "account.move"

purchase_order_writeoff = fields.Boolean()
3 changes: 2 additions & 1 deletion purchase_unreconciled/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _get_writeoff_amounts(self):
same_curr,
)

def _create_writeoff(self, writeoff_vals):
def _create_po_writeoff(self, writeoff_vals):
(
amount_writeoff,
amount_writeoff_curr,
Expand Down Expand Up @@ -72,6 +72,7 @@ def _create_writeoff(self, writeoff_vals):
"journal_id": writeoff_vals["journal_id"],
"currency_id": writeoff_vals.get("currency_id", False),
"line_ids": [(0, 0, write_off_vals), (0, 0, counter_part)],
"purchase_order_writeoff": True,
}
)
if writeoff_vals.get("purchase_order_id", False):
Expand Down
2 changes: 1 addition & 1 deletion purchase_unreconciled/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def action_reconcile(self):
writeoff_vals = self._get_purchase_writeoff_vals(
unreconciled_items_group, purchase_line_id, product_id
)
writeoff_to_reconcile = unreconciled_items_group._create_writeoff(
writeoff_to_reconcile = unreconciled_items_group._create_po_writeoff(
writeoff_vals
)
all_writeoffs |= writeoff_to_reconcile
Expand Down