Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] [account_statement_base account_reconcile_oca] make statements listed and editable #637

Merged
merged 2 commits into from Mar 17, 2024

Conversation

lk-eska
Copy link

@lk-eska lk-eska commented Mar 11, 2024

Currently there is no way to list or edit bank statement lines. this PR brings this feature to account_statement_base account_reconcile_oca modules.

@OCA-git-bot
Copy link
Contributor

Hi @alexis-via, @etobella,
some modules you are maintaining are being modified, check this out!

Copy link
Member

@etobella etobella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small comment and we can proceed

@@ -325,11 +326,12 @@
<field
name="context"
>{'default_journal_id': active_id, 'view_ref': 'account_reconcile_oca.bank_statement_line_form_reconcile_view'}</field>
<field name="view_mode">tree</field>
<field name="view_mode">tree,kanban</field>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<field name="view_mode">tree,kanban</field>
<field name="view_mode">kanban,tree</field>

Copy link
Member

@etobella etobella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order is important, as the default loaded view is tree now

<field
name="view_ids"
eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('bank_statement_line_reconcile_view')})]"
(0, 0, {'view_mode': 'tree', 'view_id': ref('account_statement_base.account_bank_statement_line_tree')}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the order, first the kanban please 😉

<field
name="view_ids"
eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('bank_statement_line_reconcile_view')})]"
(0, 0, {'view_mode': 'tree', 'view_id': ref('account_statement_base.account_bank_statement_line_tree')}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the order, first the kanban please 😉

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just sent a fix.

@pedrobaeza
Copy link
Member

I haven't checked yet, but statement lines shouldn't be editable once the statement is published (just in case this is favoring other behavior).

@etobella
Copy link
Member

@pedrobaeza I had the same concern, but I tested it on runboat and an error was raised when editing reconciled moves 😃

@pedrobaeza
Copy link
Member

Then isn't better to not allow to edit such reconciled entries?

@lk-eska
Copy link
Author

lk-eska commented Mar 12, 2024

Odoo doesn't allow you to change reconciled entries so there is no such concern.

The real problem is not having edit/delete capability on the statements. How to change or delete them if you imported wrong? How to set foreign currency and foreign currency amount? Is it possible to do it somewhere else?

@pedrobaeza
Copy link
Member

Odoo doesn't allow you to change reconciled entries so there is no such concern.

What I mean is UX. According to what I'm understanding, the interface will let you change data in reconciled lines, but at the saving time, it will rise an error. What I'm talking about is to directly avoid to change such data for the reconciled entries.

@lk-eska
Copy link
Author

lk-eska commented Mar 12, 2024

How do we allow editing some of the lines conditionally? (on tree editable mode) We can improve UX if this is possible. It works on enterprise similarly by the way.

@etobella
Copy link
Member

etobella commented Mar 12, 2024

In 16 you should do: attrs="{'readonly': [('is_reconciled', '=', True)]}" on the view for each field

@lk-eska
Copy link
Author

lk-eska commented Mar 14, 2024

In 16 you should do: attrs="{'readonly': [('is_reconciled', '=', True)]}" on the view for each field

I added this to this PR.

@etobella
Copy link
Member

Can you squash your commits and a use a proper commit message?

Thanks 😉

@lk-eska
Copy link
Author

lk-eska commented Mar 14, 2024

There should be "Squash & Merge" option for accepting a PR?

@pedrobaeza
Copy link
Member

No, the bot can't squash, so it should be done manually.

@etobella
Copy link
Member

etobella commented Mar 14, 2024

I checked and with this new tree view, we can unlink the items. It is right that we can unlink lines that are not reconciled, but with this we were able to unlink reconciled lines. Can you add a validation on the unlink in order avoid this?

@HaraldPanten
Copy link
Contributor

I checked and with this new tree view, we can unlink the items. It is right that we can unlink lines that are not reconciled, but with this we were able to unlink reconciled lines. Can you add a validation on the unlink in order avoid this?

Hi @lk-eska @pedrobaeza I think that it should be fixed before merging this PR. Deleting reconciled items in the tree view should be forbidden. If you want, we can manage this PR keeping you as author.

Let us know, please.

@lk-eska
Copy link
Author

lk-eska commented Mar 14, 2024

No, the bot can't squash, so it should be done manually.

I squashed them into one commit.

@lk-eska
Copy link
Author

lk-eska commented Mar 14, 2024

I checked and with this new tree view, we can unlink the items. It is right that we can unlink lines that are not reconciled, but with this we were able to unlink reconciled lines. Can you add a validation on the unlink in order avoid this?

Hi @lk-eska @pedrobaeza I think that it should be fixed before merging this PR. Deleting reconciled items in the tree view should be forbidden. If you want, we can manage this PR keeping you as author.

Let us know, please.

Deleting a statement line (unless it is reconciled with an invoice) is standard behavior in enterprise. This is not a bug but a feature and all enterprise users live with it without complaining. I think we are getting beyond the scope of this pull request. Not that I care about authorship but if you think this is required you can create your own PR fixing it once this gets merged.

@etobella
Copy link
Member

@lk-eska It is already nice to delete not reconciled lines, but right now,we are able to delete reconciled lines.

@lk-eska
Copy link
Author

lk-eska commented Mar 14, 2024

I can't do it in runboat if it is reconciled with an invoice:

image

It can be deleted if it is reconciled manually and it makes sense.

@etobella
Copy link
Member

But only with reconciled items with invoices

You can see here what happens... Obviously, this is not right

movie.mp4

@lk-eska
Copy link
Author

lk-eska commented Mar 14, 2024

But only with reconciled items with invoices

You can see here what happens... Obviously, this is not right
movie.mp4

It is deleting the generated account move so I see no problem here. Why bother unreconciling it when you can skip that step?

@etobella
Copy link
Member

I understand that a reconciled move should never be deleted, as it is posted.

So, IMO it is not a desired behavior.

@HaraldPanten
Copy link
Contributor

What about payments related to reconciled account moves like manual ones? For example like the ones that we create in the initial balance, or the ones coming from payrolls? Is that a desired behaviour?

@lk-eska
Copy link
Author

lk-eska commented Mar 14, 2024

What about payments related to reconciled account moves like manual ones? For example like the ones that we create in the initial balance, or the ones coming from payrolls? Is that a desired behaviour?

I haven't tested all possible use cases but I assume it allows deletion if it is not reconciled with another move. It should cover most of your questions. IMO, deleting is not a big deal if it is a standalone entry.

@HaraldPanten
Copy link
Contributor

What about payments related to reconciled account moves like manual ones? For example like the ones that we create in the initial balance, or the ones coming from payrolls? Is that a desired behaviour?

I haven't tested all possible use cases but I assume it allows deletion if it is not reconciled with another move. It should cover most of your questions. IMO, deleting is not a big deal if it is a standalone entry.

Hi, I'm starting to think that you're right. I've tested V15 and the functionality is the same as here (I think). In V15 you can delete reconciled bank statement lines as well.

@pedrobaeza
Copy link
Member

In V15 you can delete reconciled bank statement lines as well.

AFAIK, that's not possible. What are the steps you do for that?

@lk-eska
Copy link
Author

lk-eska commented Mar 15, 2024

I think there is a confusion when we say reconciled. Let me clarify:

  1. reconciled with another entry such as invoice (deletion is not possible)
  2. directly creating a new entry such as manual expense entry (deletion is possible)

@HaraldPanten
Copy link
Contributor

HaraldPanten commented Mar 15, 2024

These are my steps in V15:

  1. Create a bank statement with a bank statement line of -15$.
  2. Validate the statement.
  3. Go to the reconciliation view.
  4. Make a manual operation an send these -15$ to any expenses account.
  5. Go to the operations view (see screenshot).

Captura de Pantalla 2024-03-15 a las 11 53 48

  1. Select the reconciled line in the tree view and try to delete it from the tree view.

Captura de Pantalla 2024-03-15 a las 11 54 00

  1. Users can delete it without any restriction.

@pedrobaeza @etobella I think it's not correct, but it seems it has been working like that for several years. WDYT?

@HaraldPanten
Copy link
Contributor

I think there is a confusion when we say reconciled. Let me clarify:

  1. reconciled with another entry such as invoice (deletion is not possible)
  2. directly creating a new entry such as manual expense entry (deletion is possible)

Yep. That's it.

Copy link
Contributor

@HaraldPanten HaraldPanten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manual operations can be deleted, but reconciled statement lines (with invoices or other payable/receivable accounts like customers/vendors in the starting balance) can't be deleted once they're reconciled.

IMHO, this pull request is functionally correct. LGTM.

@pedrobaeza
Copy link
Member

OK, analyzing it, it seems congruent with the new v16 approach:

  • Statement lines can be created without statement.
  • You can add a new statement line in any moment, so deleting the line it's not limiting you forcing to create a new statement.

Anyway, I think we should add a protection over lines belonging to an statement, as if you remove a line, your balances won't fit and you won't be able to add the line in the same statement. What do you think? I'm thinking in statements imported from banks, where the transaction list should be unalterable at that level.

@HaraldPanten
Copy link
Contributor

OK, analyzing it, it seems congruent with the new v16 approach:

  • Statement lines can be created without statement.
  • You can add a new statement line in any moment, so deleting the line it's not limiting you forcing to create a new statement.

Anyway, I think we should add a protection over lines belonging to an statement, as if you remove a line, your balances won't fit and you won't be able to add the line in the same statement. What do you think? I'm thinking in statements imported from banks, where the transaction list should be unalterable at that level.

I agree, but shouldn't we work in this new IMP/FIX in a new PR?

@pedrobaeza pedrobaeza added this to the 16.0 milestone Mar 15, 2024
@lk-eska
Copy link
Author

lk-eska commented Mar 15, 2024

Can we merge this now?

@etobella
Copy link
Member

Yes, I added a proper commit message and splitted them between both modules (Sorry for making you merge them, because they were two modules and I didn't notice that)

For the next time, remember to use proper commits message https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#L1114-L1167

As you can see, I kept your authorship and no modification on the code

If it is ok for you the applied changes, I can proceed with merge

@HaraldPanten
Copy link
Contributor

But I still see 2 different commits. Is that correct, @etobella ?

@etobella
Copy link
Member

Yes, two modules are modified.

@lk-eska
Copy link
Author

lk-eska commented Mar 16, 2024

No problem @etobella ! You can merge it.

Copy link
Member

@etobella etobella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot
Copy link
Contributor

@etobella The merge process could not start, because command git fetch --quiet --force --prune https://github.com/OCA/account-reconcile 'refs/heads/*:refs/heads/*' failed with output:

fatal: unable to access 'https://github.com/OCA/account-reconcile/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

@etobella
Copy link
Member

Trying again

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-637-by-etobella-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 50c037b into OCA:16.0 Mar 17, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 7ad0b37. Thanks a lot for contributing to OCA. ❤️

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

Successfully merging this pull request may close these issues.

None yet

5 participants