Skip to content

Commit

Permalink
added demo data for doctors and removed some unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
arpa-odoo committed Apr 26, 2024
1 parent 6b5369b commit a1430b9
Show file tree
Hide file tree
Showing 18 changed files with 233 additions and 318 deletions.
7 changes: 5 additions & 2 deletions pharmacy_retail/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@
'data/product_template_attribute_line.xml',
'data/product_template_attribute_value.xml',
'data/product_product.xml',
'data/pos_payment_method.xml',
'data/pos_config.xml',
'data/stock_putaway_rule.xml',
'data/payment_provider_demo.xml',
'data/knowledge_cover.xml',
'data/knowledge_article.xml',
'data/res_config_settings.xml',
],
'demo': [
'demo/res_partner_title.xml',
'demo/res_partner.xml',
'demo/stock_lot.xml',
'demo/product_supplierinfo.xml',
Expand All @@ -61,10 +65,9 @@
'demo/sale_order_post.xml',
'demo/payment_provider.xml',
'demo/payment_method.xml',
'demo/pos_payment_method.xml',
'demo/pos_config.xml',
],
'license': 'OPL-1',
'images': ['images/main.png'],
'maintenance_loc': 16,
'maintenance_loc': 17,
}
2 changes: 1 addition & 1 deletion pharmacy_retail/data/ir_actions_act_window.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<field name="name">Manufacturer</field>
<field name="res_model">res.partner</field>
<field name="view_mode">kanban,tree,form,map,activity</field>
<field name="context">{'x_is_a_doctor': True, 'default_x_is_a_manufacturer': 1}</field>
<field name="context">{'x_is_a_manufacturer': True, 'default_x_is_a_manufacturer': 1}</field>
<field name="domain">[('x_is_a_manufacturer','=', True)]</field>
<field name="filter" eval="True"/>
</record>
Expand Down
112 changes: 47 additions & 65 deletions pharmacy_retail/data/ir_ui_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
<field name="mode">extension</field>
<field name="priority">160</field>
<field name="arch" type="xml">
<data>
<xpath expr="//label[@for='partner_id']" position="attributes">
<attribute name="string">Patient Name</attribute>
</xpath>
<xpath expr="//group/field[@name='currency_id']" position="after">
<field name="x_doctor_name" domain='[("x_is_a_doctor", "=", True)]'/>
</xpath>
</data>
<xpath expr="//label[@for='partner_id']" position="attributes">
<attribute name="string">Patient Name</attribute>
</xpath>
<xpath expr="//group/field[@name='currency_id']" position="after">
<field name="x_doctor_name" domain='[("x_is_a_doctor", "=", True)]'/>
</xpath>
</field>
</record>
<record id="product_template_product_form_customization_pharma_2" model="ir.ui.view">
Expand All @@ -26,17 +24,15 @@
<field name="mode">extension</field>
<field name="priority">160</field>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='invoice_policy']" position="after">
<field name="x_manufacturer" domain='[("x_is_a_manufacturer", "=", True)]'/>
</xpath>
<xpath expr="//field[@name='default_code']" position="attributes">
<attribute name="string">Alias Name</attribute>
</xpath>
<xpath expr="//field[@name='product_tag_ids']" position="attributes">
<attribute name="string">Generic Name</attribute>
</xpath>
</data>
<xpath expr="//field[@name='invoice_policy']" position="after">
<field name="x_manufacturer" domain='[("x_is_a_manufacturer", "=", True)]'/>
</xpath>
<xpath expr="//field[@name='default_code']" position="attributes">
<attribute name="string">Alias Name</attribute>
</xpath>
<xpath expr="//field[@name='product_tag_ids']" position="attributes">
<attribute name="string">Generic Name</attribute>
</xpath>
</field>
</record>
<record id="report_saleorder_document_customization_pharma" model="ir.ui.view">
Expand All @@ -45,24 +41,18 @@
<field name="type">qweb</field>
<field name="mode">extension</field>
<field name="priority">160</field>
<field name="key">gen_key.1896a2</field>
<field name="arch" type="xml">
<data>
<xpath expr="//div[@id='informations']" position="after">
<div class="row">
<div class="col-3">
<span>
<strong>Doctor:</strong>
<br/>
</span>
<span t-field="doc.x_doctor"/>
</div>
<div class="col-3"/>
<div class="col-3"/>
<div class="col-3"/>
<xpath expr="//div[@id='informations']" position="after">
<div class="row">
<div class="col-3">
<span>
<strong>Doctor:</strong>
<br/>
</span>
<span t-field="doc.x_doctor"/>
</div>
</xpath>
</data>
</div>
</xpath>
</field>
</record>
<record id="res_company_form_customization_pharma" model="ir.ui.view">
Expand All @@ -73,12 +63,10 @@
<field name="mode">extension</field>
<field name="priority">10000</field>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='website']" position="after">
<field name="x_drug_license_number"/>
<field name="x_drug_license_date"/>
</xpath>
</data>
<xpath expr="//field[@name='website']" position="after">
<field name="x_drug_license_number"/>
<field name="x_drug_license_date"/>
</xpath>
</field>
</record>
<record id="res_partner_form_customization_pharma" model="ir.ui.view">
Expand All @@ -89,17 +77,15 @@
<field name="mode">extension</field>
<field name="priority">360</field>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='vat']" position="after">
<field name="x_drug_license_number" invisible="not x_is_a_manufacturer"/>
<field name="x_drug_license_date" invisible="not x_is_a_manufacturer" options='{"warn_future":false}'/>
<field name="x_registration_number" invisible="not x_is_a_doctor"/>
</xpath>
<xpath expr="//field[@name='category_id']" position="after">
<field name="x_is_a_doctor"/>
<field name="x_is_a_manufacturer"/>
</xpath>
</data>
<xpath expr="//field[@name='vat']" position="after">
<field name="x_drug_license_number" invisible="not x_is_a_manufacturer"/>
<field name="x_drug_license_date" invisible="not x_is_a_manufacturer" options='{"warn_future":false}'/>
<field name="x_registration_number" invisible="not x_is_a_doctor"/>
</xpath>
<xpath expr="//field[@name='category_id']" position="after">
<field name="x_is_a_doctor"/>
<field name="x_is_a_manufacturer"/>
</xpath>
</field>
</record>
<record id="sale_order_tree_customization_pharma" model="ir.ui.view">
Expand All @@ -110,11 +96,9 @@
<field name="mode">extension</field>
<field name="priority">99</field>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="string">Patient Name</attribute>
</xpath>
</data>
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="string">Patient Name</attribute>
</xpath>
</field>
</record>
<record id="sale_order_form_customization_pharma" model="ir.ui.view">
Expand All @@ -125,14 +109,12 @@
<field name="mode">extension</field>
<field name="priority">160</field>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="string">Customer Name</attribute>
</xpath>
<xpath expr="//field[@name='validity_date']" position="before">
<field name="x_doctor" domain='[("x_is_a_doctor", "=", True)]'/>
</xpath>
</data>
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="string">Customer Name</attribute>
</xpath>
<xpath expr="//field[@name='validity_date']" position="before">
<field name="x_doctor" domain='[("x_is_a_doctor", "=", True)]'/>
</xpath>
</field>
</record>
</odoo>
7 changes: 7 additions & 0 deletions pharmacy_retail/data/payment_provider_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="payment.payment_provider_demo" model="payment.provider">
<field name="is_published" eval="0"/>
<field name="state">disabled</field>
</record>
</odoo>
8 changes: 8 additions & 0 deletions pharmacy_retail/data/pos_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="pos_config_pharmacy" model="pos.config">
<field name="name">Pharmacy Retail</field>
<field name="payment_method_ids" eval="[(6, 0, [ref('pos_payment_method_1')])]"/>
</record>
<function name="add_cash_payment_method" model="pos.config"/>
</odoo>
File renamed without changes.
2 changes: 0 additions & 2 deletions pharmacy_retail/data/product_product.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
<record id="product_product_19" model="product.product">
<field name="name">Himalaya Baby Powder 100 g</field>
<field name="categ_id" ref="product_category_5"/>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="detailed_type">product</field>
<field name="tracking">lot</field>
<field name="alert_time">30</field>
Expand Down
12 changes: 0 additions & 12 deletions pharmacy_retail/data/product_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
<record id="product_template_13" model="product.template" context="{'create_product_product': False}">
<field name="name">Acetratine 10 mg</field>
<field name="categ_id" ref="product_category_1"/>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="detailed_type">product</field>
<field name="tracking">lot</field>
<field name="alert_time">60</field>
Expand All @@ -22,8 +20,6 @@
<record id="product_template_14" model="product.template" context="{'create_product_product': False}">
<field name="name">Crocin 650</field>
<field name="categ_id" ref="product_category_3"/>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="detailed_type">product</field>
<field name="tracking">lot</field>
<field name="alert_time">60</field>
Expand All @@ -41,8 +37,6 @@
<record id="product_template_15" model="product.template" context="{'create_product_product': False}">
<field name="name">Paracetamol</field>
<field name="categ_id" ref="product_category_3"/>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="detailed_type">product</field>
<field name="tracking">lot</field>
<field name="alert_time">60</field>
Expand All @@ -60,8 +54,6 @@
<record id="product_template_16" model="product.template" context="{'create_product_product': False}">
<field name="name">TELVAS AM TAB</field>
<field name="categ_id" ref="product_category_4"/>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="detailed_type">product</field>
<field name="tracking">lot</field>
<field name="alert_time">60</field>
Expand All @@ -78,8 +70,6 @@
<record id="product_template_17" model="product.template" context="{'create_product_product': False}">
<field name="name">ENAPRIL 10MG TAB</field>
<field name="categ_id" ref="product_category_4"/>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="detailed_type">product</field>
<field name="tracking">lot</field>
<field name="alert_time">90</field>
Expand All @@ -96,8 +86,6 @@
<record id="product_template_18" model="product.template" context="{'create_product_product': False}">
<field name="name">CEFTAS 400 5 TAB</field>
<field name="categ_id" ref="product_category_2"/>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="detailed_type">product</field>
<field name="tracking">lot</field>
<field name="alert_time">30</field>
Expand Down
1 change: 0 additions & 1 deletion pharmacy_retail/data/res_config_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<record id="res_config_settings_enable" model="res.config.settings">

<!-- Sales -->
<field name="group_uom" eval="1"/>
<field name="group_sale_pricelist" eval="1"/>
<field name="group_warning_sale" eval="1"/>

Expand Down
33 changes: 0 additions & 33 deletions pharmacy_retail/data/uom_uom.xml

This file was deleted.

6 changes: 4 additions & 2 deletions pharmacy_retail/demo/payment_provider.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
<odoo noupdate="1">
<record id="payment.payment_provider_demo" model="payment.provider">
<field name="name">Card Payment</field>
<field name="is_published" eval="1"/>
<field name="state">test</field>
<field name="payment_method_ids" eval="[
Command.link(ref('payment.payment_method_card')),
Command.link(ref('payment.payment_method_visa')),
Command.link(ref('payment.payment_method_mastercard')),
Command.link(ref('payment.payment_method_rupay')),
Command.link(ref('payment.payment_method_maestro')),
]"/>
</record>
</odoo>
</record>
</odoo>
7 changes: 1 addition & 6 deletions pharmacy_retail/demo/pos_config.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="point_of_sale.pos_config_main" model="pos.config">
<field name="payment_method_ids" eval="[
(6, 0, [
ref('pos_payment_method_1'),
])
]"/>
<field name="active" eval="False"/>
</record>
<function name="add_cash_payment_method" model="pos.config"/>
</odoo>

0 comments on commit a1430b9

Please sign in to comment.