Skip to content

Commit

Permalink
Merge PR #788 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Nov 6, 2019
2 parents 40b5d72 + a278758 commit cda762b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions purchase_delivery_split_date/models/purchase.py
Expand Up @@ -2,12 +2,9 @@
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from datetime import datetime
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT

import logging
from itertools import groupby
from odoo import models, api
from odoo import models, api, fields

_logger = logging.getLogger(__name__)

Expand All @@ -22,10 +19,11 @@ def _get_group_keys(self, order, line, picking=False):
dictionary element with the field that you want to group by. This
method is designed for extensibility, so that other modules can add
additional keys or replace them by others."""
date = datetime.strptime(
str(line.date_planned), DEFAULT_SERVER_DATETIME_FORMAT)
date = line.date_planned.date()
# Split date value to obtain only the attributes year, month and day
key = ({'date_planned': str(date).split(" ")[0]},)
key = (
{'date_planned': fields.Date.to_string(date)},
)
return key

@api.model
Expand Down

0 comments on commit cda762b

Please sign in to comment.