[4782][ADD] account_payment_no_exchange_diff#27
Conversation
yostashiro
left a comment
There was a problem hiding this comment.
Can we change the module name to account_move_line_create_payment_entry?
| @@ -0,0 +1,13 @@ | |||
| <odoo> | |||
| <record | |||
| id="model_account_move_line_action_create_journal_entry" | |||
There was a problem hiding this comment.
| id="model_account_move_line_action_create_journal_entry" | |
| id="model_account_move_line_action_create_payment_entry" |
| id="model_account_move_line_action_create_journal_entry" | ||
| model="ir.actions.server" | ||
| > | ||
| <field name="name">Create Journal Entry</field> |
There was a problem hiding this comment.
| <field name="name">Create Journal Entry</field> | |
| <field name="name">Create Payment Entry</field> |
| if len(set(self.mapped("move_type"))) > 1: | ||
| raise UserError(_("All selected records must have the same move type.")) |
There was a problem hiding this comment.
Any reason not to allow processing different move types together?
| raise UserError(_("All selected records must have the same partner.")) | ||
| if len(set(self.mapped("move_type"))) > 1: | ||
| raise UserError(_("All selected records must have the same move type.")) | ||
| return { |
There was a problem hiding this comment.
Before reaching here, please add more checks:
- Show error if the account is neither payable nor receivable.
- Show error if the selected record has already been reconciled.
| _name = "account.payment.entry.wizard" | ||
| _description = "Payment Entry Wizard" | ||
|
|
||
| account_id = fields.Many2one( |
There was a problem hiding this comment.
Can we let users select a journal of the bank type instead?
There was a problem hiding this comment.
For the journal entry, I think we can only use the general type journal, isn't?
| move_line_ids = self.move_line_ids | entry.line_ids.filtered( | ||
| lambda x: x.account_id.id != self.account_id.id | ||
| ) | ||
| move_line_ids.reconcile() |
There was a problem hiding this comment.
This doesn't look like it can handle the payment for multiple payable lines. Contrary to my previous comment, actually, we shouldn't be reconciling items here, as the user should be making manual adjustment to the generated journal entry, adding a line for exchange gain/loss.
| move_line_ids = self.move_line_ids | entry.line_ids.filtered( | |
| lambda x: x.account_id.id != self.account_id.id | |
| ) | |
| move_line_ids.reconcile() |
yostashiro
left a comment
There was a problem hiding this comment.
As we just discussed, let's redesign to make use of the existing Register Payment wizard.
There was a problem hiding this comment.
Instead of adding this server action, can we just add a button "Create Draft Payment (w/o exchange difference)" in the standard "Register Payment" wizard?
There was a problem hiding this comment.
There are limitations with current design and did some adjustment to cover it because the context is of this module is covered by current design.
If we just add the new button and without passing any context to make adjustment when open the wizards, there are some points we need to consider and implement.
Scenario 1
When users don't enable group_payment and select multiple account moves, separate payments will be created for each account move. As a result, we need to create a journal entry for each move and link it to its corresponding payment. However, there is no direct relationship between the payment and the move (as the move field does not exist in the register payment wizard; instead, we only have reconciled_invoice_ids in the payment). This makes it difficult to determine which payment corresponds to which move, creating a problem when linking our created journal entries to the payments.
Scenario 2
If we enable group_payment and change the amount in the register payment wizard, we need to recalculate the amount for the journal entry (JE).
For example:
INV 001 - $100 (Y 14,000)
INV 002 - $100 (Y 15,000)
If the amount in the register payment form is changed to 150, we need to create a journal entry with two lines:
Y 14,000
Y 7,500
Therefore, we must check the amount entered in the register payment wizard, distribute it among the selected moves, recalculate the amounts using the exchange rate on each move's date, and prepare the journal entry's account move lines accordingly.
There was a problem hiding this comment.
Indeed, as Yoshi-san mentioned, I also think that instead of creating a new action, it would be clearer to add a button for the optional feature in the payment process and handle it that way. However, if the adjustment takes several hours, I believe we should keep the current design.
|
How about |
Done! |
cf21904 to
c0a2ccf
Compare
|
Close PR as this module is no longer in use. |
4782