diff --git a/l10n_it_withholding_tax/models/account.py b/l10n_it_withholding_tax/models/account.py index 18d696aeb17b..a9032ae76e4c 100644 --- a/l10n_it_withholding_tax/models/account.py +++ b/l10n_it_withholding_tax/models/account.py @@ -96,12 +96,12 @@ def generate_wt_moves(self): p_date_maturity = False payment_lines = wt_st.withholding_tax_id.payment_term.compute( amount_wt, - rec_line_statement.date or False) + rec_line_payment.date or False) if payment_lines and payment_lines[0]: p_date_maturity = payment_lines[0][0][0] wt_move_vals = { 'statement_id': wt_st.id, - 'date': rec_line_statement.date, + 'date': rec_line_payment.date, 'partner_id': rec_line_statement.partner_id.id, 'reconcile_partial_id': self.id, 'payment_line_id': rec_line_payment.id, @@ -109,7 +109,7 @@ def generate_wt_moves(self): 'withholding_tax_id': wt_st.withholding_tax_id.id, 'account_move_id': rec_line_payment.move_id.id or False, 'date_maturity': - p_date_maturity or rec_line_statement.date_maturity, + p_date_maturity or rec_line_payment.date_maturity, 'amount': amount_wt } wt_move_vals = self._prepare_wt_move(wt_move_vals)