-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Rahul] | BAH-3695 | Add. Odoo Order Type Initializer
- Loading branch information
1 parent
8ffb855
commit 36a6e6b
Showing
7 changed files
with
48 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
from odoo import models, fields, api | ||
import logging | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
class OrderType(models.Model): | ||
_name = 'order.type' | ||
_description = 'Order Type' | ||
|
||
name = fields.Char(string='Name') | ||
name = fields.Char(string='Name', required=True, help='Name of the order type') | ||
description = fields.Text(string='Description', help='Description of the order type') | ||
|
||
_sql_constraints = [('unique_name', 'unique(name)', | ||
'Order type with this name already exists!')] | ||
_sql_constraints = [('unique_name', 'unique(name)', 'Order type with this name already exists!')] | ||
|
||
@api.model | ||
def create(self,vals): | ||
try: | ||
record = super(OrderType,self).create(vals) | ||
_logger.info("Created New Order Type {} With Id {}.".format(*(vals.get("name"),record.id))) | ||
return record | ||
except Exception as error: | ||
_logger.error("Failed To Create New Order Type {}".format(vals.get("name"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record id="order_type_drug" model="order.type"> | ||
<field name="name">Drug Order</field> | ||
<field name="description">This order type is used for prescribing medications to patients. It includes details such as the name of the medication, dosage, frequency, and duration of treatment.</field> | ||
</record> | ||
<record id="order_type_lab" model="order.type"> | ||
<field name="name">Lab Order</field> | ||
<field name="description">Lab orders are used to request various laboratory tests and investigations for patients. They specify the type of test required, along with any specific instructions or details for the lab to follow.</field> | ||
</record> | ||
<record id="order_type_radiology" model="order.type"> | ||
<field name="name">Radiology Order</field> | ||
<field name="description">Radiology orders are used to request imaging studies such as X-rays, CT scans, MRI scans, and ultrasound examinations for patients. These orders provide details about the type of imaging study needed, the body part to be examined, and any relevant clinical information.</field> | ||
</record> | ||
</odoo> |