Skip to content

[15.0][OU-FIX] hr_expense: Get payment_state directly#4448

Merged
pedrobaeza merged 1 commit into
OCA:15.0from
Tecnativa:15.0-ou_fix-hr_expense-compute_payment_state
Jun 3, 2024
Merged

[15.0][OU-FIX] hr_expense: Get payment_state directly#4448
pedrobaeza merged 1 commit into
OCA:15.0from
Tecnativa:15.0-ou_fix-hr_expense-compute_payment_state

Conversation

@pedrobaeza

Copy link
Copy Markdown
Member

Previous approach was too much aggressive, calling a very generic method that does a lot of stuff apart from recomputing payment_state, launching a rewrite of the lines with debit=0 and credit=0, which totally wrecks the accounting.

Now we have extracted the code for computing the payment state inside the migration script and manually written for each of the expenses moves.

@Tecnativa

Previous approach was too much aggressive, calling a very generic method
that does a lot of stuff apart from recomputing payment_state, launching
a rewrite of the lines with debit=0 and credit=0, which totally wrecks
the accounting.

Now we have extracted the code for computing the payment state inside
the migration script and manually written for each of the expenses
moves.
@pedrobaeza pedrobaeza added this to the 15.0 milestone Jun 3, 2024
@pedrobaeza

Copy link
Copy Markdown
Member Author

Tested on real migration.

@pedrobaeza pedrobaeza merged commit b04b27c into OCA:15.0 Jun 3, 2024
@pedrobaeza pedrobaeza deleted the 15.0-ou_fix-hr_expense-compute_payment_state branch June 3, 2024 11:03
@huguesdk

huguesdk commented Oct 4, 2024

Copy link
Copy Markdown
Member

this only sets the value of the payment_state field, but other fields must be updated too: always_tax_exigible, amount_residual, amount_residual_signed, amount_untaxed and amount_untaxed_signed. created #4577 to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants