Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Activity definition's values of Medication Request #213

Merged
merged 1 commit into from
Jan 8, 2018
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions medical_medication_request/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
from . import medical_medication_administration
from . import medical_medication_request
from . import stock_move_line
from . import workflow_activity_definition
22 changes: 22 additions & 0 deletions medical_medication_request/models/workflow_activity_definition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2017 Creu Blanca
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from odoo import models


class ActivityDefinition(models.Model):
# FHIR entity: Activity Definition
# (https://www.hl7.org/fhir/activitydefinition.html)
_inherit = 'workflow.activity.definition'

def _get_medical_values(self, vals, parent=False, plan=False, action=False
):
values = super(ActivityDefinition, self)._get_medical_values(
vals, parent=False, plan=False, action=False)
if self.model_id.model == 'medical.medication.request':
values.update({
'product_id': self.service_id.id,
'product_uom_id': self.service_id.uom_id.id,
})
return values