Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions product_pricelist_supplierinfo/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def _select_seller(
lambda s: not s.company_id or s.company_id.id == company_id)
for seller in sellers:
if (
(not seller.date_start or seller.date_start <= date)
and (not seller.date_end or seller.date_end >= date)
(not seller.date_start or fields.context_today(seller, seller.date_start) <= date)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(not seller.date_start or fields.context_today(seller, seller.date_start) <= date)
(not seller.date_start or fields.Date.context_today(seller, datetime.combine(seller.date_start, datetime.min.time()) + timedelta(hours=6)) <= date)

Vas a necesitar importar al incio del archivo

from datetime import datetime, timedelta

and (not seller.date_end or fields.context_today(seller, seller.date_end) >= date)
Copy link

@keylor2906 keylor2906 Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and (not seller.date_end or fields.context_today(seller, seller.date_end) >= date)
and (not seller.date_end or fields.Date.context_today(seller, datetime.combine(seller.date_end, datetime.min.time()) + timedelta(hours=6)) >= date)

and (not partner_id
or seller.name in [partner_id, partner_id.parent_id])
and (not seller.product_id or seller.product_id == self)
Expand Down