diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f82d91f --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# Python +__pycache__/ +*.py[cod] +*$py.class + +# Odoo +*.po +.ipynb_checkpoints/ + +# Editors +.vscode/ +.idea/ +*.swp +*.swo diff --git a/README.md b/README.md index b58adab..3b7fa08 100755 --- a/README.md +++ b/README.md @@ -238,6 +238,10 @@ For issues, questions, or contributions, please contact your system administrato ## Changelog +### Version 17.0.1.1.0 +- Fix: Prevent incorrect revaluation entries (STJ) on Vendor Bills when creating Credit Notes (Reversal). +- Fix: Restricted revaluation logic to strictly apply only when manually editing Vendor Bills, excluding system-triggered updates during reversals. + ### Version 17.0.1.0.0 - Initial release - Direct editing of price_subtotal on vendor bill lines diff --git a/models/__pycache__/account_move_line.cpython-312.pyc b/models/__pycache__/account_move_line.cpython-312.pyc index 81c9cf5..26b2f8c 100644 Binary files a/models/__pycache__/account_move_line.cpython-312.pyc and b/models/__pycache__/account_move_line.cpython-312.pyc differ diff --git a/models/account_move_line.py b/models/account_move_line.py index f3789b1..745a0e1 100755 --- a/models/account_move_line.py +++ b/models/account_move_line.py @@ -117,7 +117,10 @@ class AccountMoveLine(models.Model): if 'price_unit' in vals or 'quantity' in vals: for line in self: # Only for vendor bills and if linked to a PO line - if line.move_id.move_type in ('in_invoice', 'in_refund') and line.purchase_line_id: + # Fix: Do not sync if triggered by Credit Note creation (Reversal Wizard) + if line.move_id.move_type == 'in_invoice' and \ + line.purchase_line_id and \ + self.env.context.get('active_model') != 'account.move.reversal': po_line = line.purchase_line_id # 1. Sync Price