account-invoicing icon indicating copy to clipboard operation
account-invoicing copied to clipboard

[13.0][IMP] account_product_move

Open ntsirintanis opened this issue 2 years ago • 5 comments

ntsirintanis avatar Apr 14 '22 10:04 ntsirintanis

@NL66278 @thomaspaulb @lfreeke @gfcapalbo

ntsirintanis avatar Apr 19 '22 07:04 ntsirintanis

@NL66278 the main problem here is that I am not sure how to reverse the automatically created journal entries, when reversing the account.move that generated them...

ntsirintanis avatar May 24 '22 13:05 ntsirintanis

I am not quite happy with the name of the module, nor with the names of some of the models. I think the central concept of this module is that certain products bring with them certain journal items (account move lines).

So I would propose: account_product_move_template for the module and for the tamplate linked to the product (template) account_product_move_template_line for the lines (items) in this template.

Maybe even better to get rid of the _template part. The logic of the module seems to be that invoicing certain products, inescapably results in extra account moves that are fully determined by those products and the defined product moves. No option for the user to override these, so in fact it is not really a "template".

NL66278 avatar May 24 '22 13:05 NL66278

@ntsirintanis For the credit invoices I think you can override reverse_moves in the account_move_reversal wizard: https://github.com/odoo/odoo/blob/13.0/addons/account/wizard/account_move_reversal.py#L65

You can call the super on this and then loop over all the linked moves (if any) and reverse them as well.

Of course this supposes that Credit Invoices go through this wizard, which is the case anyway if users use the Add Credit Note button on the invoice.

There is also a _reverse_move method on account.move itself. It might be necesarry to do the same thing there. I think it is used in reversing reconciliations.

NL66278 avatar May 25 '22 10:05 NL66278

tests are failing in another module https://github.com/OCA/account-invoicing/runs/6654881995

ntsirintanis avatar May 30 '22 12:05 ntsirintanis