Sunday, April 30, 2023
1 change · master
Miscellaneous changes
On Debian based systems, the `tzdata` package is maintained to reflect changes in timezones and there is no need to upgrade the `python3-tz` package. On the other hand, for those who are using `pip` and thus our `requirements.txt`, the package needs to be up to date. By unpinning it in the requirements.txt: - new installations based on pip will be up to date - older installations based on pip can easily upgrade - debian based installations have to maintain the tzdata package - mixed ins
Original PR description
On Debian based systems, the `tzdata` package is maintained to reflect changes in timezones and there is no need to upgrade the `python3-tz` package. On the other hand, for those who are using `pip`…
On Debian based systems, the `tzdata` package is maintained to reflect changes
in timezones and there is no need to upgrade the `python3-tz` package.
On the other hand, for those who are using `pip` and thus our `requirements.txt`,
the package needs to be up to date. By unpinning it in the requirements.txt:
- new installations based on pip will be up to date
- older installations based on pip can easily upgrade
- debian based installations have to maintain the tzdata package
- mixed installs like on runbot will rely on Debian tzdata
# ORIGINAL DESCRIPTION
Title: [FIX] l10n_mx_edi: Fix e-invoice outdated by 1 hour
It is reproduced from odoo 12.0, but they are not supported anymore, so for now LTS Odoo >=14.0
# Description of the issue/feature this PR addresses:
Mexico changed the timezone law:
- https://dof.gob.mx/nota_detalle.php?codigo=5670045&fecha=28/10/2022#gsc.tab=0
Running the following code:
```python
from datetime import datetime
from pytz import timezone
tz = timezone('America/Mexico_City')
datetime_mx_tz = datetime.now(tz)
print("%s: %s" % (tz, datetime_mx_tz.strftime("%Y-%m-%d %H:%M:%S")))
```
The result is different using old pytz vs 2023.3 by 1 hour
You can double-confirm the correct new value using the following link:
- https://www.timeanddate.com/worldclock/mexico/mexico-city
# Current behavior before PR:
It is generating XML e-invoice with different hour
and the sign process raises the following error:
```txt
The service to sign failed:
Code: 401
Message: Date and time out of range
```
# Desired behavior after PR is merged:
XML e-invoice with correct hour
without errors
# NOTE
You can upgrade the package directly in your instance in order to fix it ASAP:
- `pip install -U --no-deps pytz`
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#120164
Forward-Port-Of: odoo/odoo#117527