Skip to content

Commit

Permalink
Merge PR OCA#693 into 11.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Jun 21, 2019
2 parents 1cc580d + d62046a commit f8685f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion purchase_discount/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"Tecnativa, "
"ACSONE SA/NV,"
"Odoo Community Association (OCA)",
"version": "11.0.1.0.2",
"version": "11.0.1.0.3",
"category": "Purchase Management",
"depends": ["purchase"],
"data": [
Expand Down
5 changes: 4 additions & 1 deletion purchase_discount/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ def _get_price_unit(self):
maximum inheritability.
"""
price_unit = False
po_line = self.purchase_line_id
# We do it with sudo to avoid permission errors in case
# the user validates the order and does not have permission to
# modifiy purchase lines
po_line = self.purchase_line_id.sudo()
if po_line and self.product_id == po_line.product_id:
price = po_line._get_discounted_price_unit()
if price != po_line.price_unit:
Expand Down

0 comments on commit f8685f7

Please sign in to comment.