Skip to content

[FIX] l10n_ar_sale: Fix sale order line date.#249

Merged
jjscarafia merged 1 commit intoingadhoc:18.0from
adhoc-dev:18.0-h-97262-pam
Jul 31, 2025
Merged

[FIX] l10n_ar_sale: Fix sale order line date.#249
jjscarafia merged 1 commit intoingadhoc:18.0from
adhoc-dev:18.0-h-97262-pam

Conversation

@pablohmontenegro
Copy link
Copy Markdown
Contributor

@pablohmontenegro pablohmontenegro commented Jul 31, 2025

The _l10n_ar_add_taxes method of account.fiscal.position of the l10n_ar_tax module ( https://github.com/ingadhoc/odoo-argentina/blob/18.0/l10n_ar_tax/models/account_fiscal_position.py#L10 ) gets the date of the sale.order as datetime.datetime (from l10n_ar_sale module https://github.com/ingadhoc/argentina-sale/blob/18.0/l10n_ar_sale/models/sale_order_line.py#L130 ) but compares it with the from_date and to_date fields of l10n_ar.partner.tax model which are of type datetime.date then we convert the date of the sale.order.line as datetime.date to make a homogeneous comparison between date fields of the same type (datetime.date). Also we ensure to use the timezone of Argentina to avoid issues with timezones when comparing dates.
Ticket adhoc side: 97262, 97292

@roboadhoc
Copy link
Copy Markdown
Contributor

@pablohmontenegro pablohmontenegro force-pushed the 18.0-h-97262-pam branch 8 times, most recently from 8ad20fe to cc566aa Compare July 31, 2025 19:45
The _l10n_ar_add_taxes method of account.fiscal.position of the l10n_ar_tax module ( https://github.com/ingadhoc/odoo-argentina/blob/18.0/l10n_ar_tax/models/account_fiscal_position.py#L10 ) gets the date of the sale.order as datetime.datetime (from l10n_ar_sale module https://github.com/ingadhoc/argentina-sale/blob/18.0/l10n_ar_sale/models/sale_order_line.py#L130 ) but compares it with the from_date and to_date fields of l10n_ar.partner.tax model which are of type datetime.date then we convert the date of the sale.order.line as datetime.date to make a homogeneous comparison between date fields of the same type (datetime.date). Also we ensure to use the timezone of Argentina to avoid issues with timezones when comparing dates.
Ticket adhoc side: 97262, 97292
@jjscarafia jjscarafia merged commit 08b126f into ingadhoc:18.0 Jul 31, 2025
3 of 4 checks passed
@jjscarafia jjscarafia deleted the 18.0-h-97262-pam branch July 31, 2025 19:51
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.

3 participants