Skip to content

Commit

Permalink
[IMP] partner_tz: black, isort
Browse files Browse the repository at this point in the history
  • Loading branch information
grindtildeath authored and rousseldenis committed Feb 7, 2023
1 parent 967e285 commit 705a31d
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
1 change: 0 additions & 1 deletion partner_tz/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import models
from . import tools
1 change: 0 additions & 1 deletion partner_tz/models/__init__.py

This file was deleted.

10 changes: 0 additions & 10 deletions partner_tz/models/res_partner.py

This file was deleted.

3 changes: 1 addition & 2 deletions partner_tz/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
This module removes timezone default value on res.partner and display the field
on form view.
This module displays the timezone field on partner form view.
Moreover it provides a few tools function in `tools/tz_utils.py`.
8 changes: 8 additions & 0 deletions partner_tz/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* Odoo default value for timezone field uses the tz set on the connected user.
So if a user creates a partner located in a different timezone than his own,
the created partner will be set in the user's timezone instead of having the
timezone from its own location.
Ideally, we should change this behaviour to get the timezone from the country
and city of the partner when they are defined.
http://www.geonames.org/export/web-services.html#timezone might be a good
starting point.
7 changes: 6 additions & 1 deletion partner_tz/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
from .tz_utils import *
from .tz_utils import tz_to_tz_naive_datetime
from .tz_utils import tz_to_utc_naive_datetime
from .tz_utils import utc_to_tz_naive_datetime
from .tz_utils import tz_to_tz_time
from .tz_utils import tz_to_utc_time
from .tz_utils import utc_to_tz_time
6 changes: 3 additions & 3 deletions partner_tz/tools/tz_utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
import pytz
from datetime import datetime, date
from datetime import date, datetime

import pytz

UTC_TZ = pytz.timezone('UTC')
UTC_TZ = pytz.timezone("UTC")


def tz_to_tz_naive_datetime(from_tz, to_tz, date_time):
Expand Down
2 changes: 1 addition & 1 deletion partner_tz/views/res_partner.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_partner_form_inherit" model="ir.ui.view">
<field name="name">res.partner.form.inherit</field>
Expand Down

0 comments on commit 705a31d

Please sign in to comment.