diff --git a/med_marketing/__init__.py b/med_marketing/__init__.py new file mode 100644 index 000000000..2c4eac3f8 --- /dev/null +++ b/med_marketing/__init__.py @@ -0,0 +1 @@ +import models \ No newline at end of file diff --git a/med_marketing/__openerp__.py b/med_marketing/__openerp__.py new file mode 100644 index 000000000..de7b2c85b --- /dev/null +++ b/med_marketing/__openerp__.py @@ -0,0 +1,25 @@ +{ + 'name': "Pharmacy Marketing", + 'summary': """Sales Representative, Doctors, Targets,..etc for Medicine filed """, + 'description': """ +""", + + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'category': 'Medicine', + 'version': '0.1', + 'depends': ["base", + 'medical_feature', + "sale", "marketing", + "marketing_campaign", + "hr", "account", + "hr_payroll"], + 'data': ['views/med_marketing_view.xml', + 'views/rep_view.xml', + 'views/doctor_view.xml', + 'views/doctor_exp_view.xml', ], + 'demo': ['demo/demo.xml'], + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/med_marketing/demo/demo.xml b/med_marketing/demo/demo.xml new file mode 100644 index 000000000..0995fe24b --- /dev/null +++ b/med_marketing/demo/demo.xml @@ -0,0 +1,138 @@ + + + + + + Neurology + + + Cardiology + + + Dentistry + + + ENT + + + Gynaecology + + + Pediatrics + + + + + + Liam Gomer + 1 + 150000 + + + + Roger Scott + 1 + 450000 + + + + + David + 1 + 850000 + + + + + Macklin + 1 + 780000 + + + + + Jack + 1 + 750000 + + + + Joe + 1 + 960000 + + + + + Dr. Arden + 1 + 1 + + + 15000 + arden@gmail.com + 2653241536 + + + + + Dr.Armstrong + 1 + 0 + + + 26000 + armstrong@gmail.com + 2653651436 + + + + + Dr.Saunder + 1 + 0 + + + 78000 + saunder@yahoo.com + 2653365436 + + + + + Dr.Asbjorn + 1 + 0 + + + 75000 + asbjorn@yahoo.com + 2657415436 + + + + + Dr.Salomon + 1 + 0 + + + 85000 + salomon@yahoo.com + 4877415436 + + + + Dr.Saunderson + 1 + 0 + + + 65000 + saunderson@gmail.com + 6987415436 + + + + + \ No newline at end of file diff --git a/med_marketing/models/__init__.py b/med_marketing/models/__init__.py new file mode 100644 index 000000000..0aa7b7765 --- /dev/null +++ b/med_marketing/models/__init__.py @@ -0,0 +1 @@ +import doctor,med_marketing,rep,doctor_exp \ No newline at end of file diff --git a/med_marketing/models/doctor.py b/med_marketing/models/doctor.py new file mode 100644 index 000000000..255b56470 --- /dev/null +++ b/med_marketing/models/doctor.py @@ -0,0 +1,33 @@ +from openerp import models, fields, api +import datetime +from dateutil import parser + + +class Doctors(models.Model): + _inherit = 'res.partner' + + doctor = fields.Boolean('Doctor') + specialist_in = fields.Many2one('pha_marketing.departments', 'Specialist in') + related_rep = fields.Many2one('hr.employee', string='Related Rep.', domain="[('rep','=',True)]") + target = fields.Integer('Doctor Target') + + @api.one + def _get_total_sale(self): + total = 0.0 + created_domain = [('type', 'in', ['out_invoice', 'out_refund']), ('state', 'not in', ['draft', 'cancel']), ] + for EACH_REPORT in self.env['account.invoice.report'].search(created_domain): + if self.zip == EACH_REPORT.partner_id.zip: + if self.specialist_in.id in EACH_REPORT.product_id.uses_in.ids: + if parser.parse(EACH_REPORT.date).month == datetime.date.today().month: + total_doctor = 0 + for EACH_Doctor in self.search([('doctor', '=', True)]): + if EACH_Doctor.zip == self.zip and EACH_Doctor.specialist_in.id in EACH_REPORT.product_id.uses_in.ids: + + total_doctor += 1 + if total_doctor != 0: + total += (EACH_REPORT.price_total/total_doctor) + + + self.total_sale = total + total_sale = fields.Integer('Total sale', compute='_get_total_sale', help='Will calculate the doctors by considering zip code of both Doctors and Retailers and compare the department of doctor with use of sold medicines.') + diff --git a/med_marketing/models/doctor_exp.py b/med_marketing/models/doctor_exp.py new file mode 100644 index 000000000..0e7cb3166 --- /dev/null +++ b/med_marketing/models/doctor_exp.py @@ -0,0 +1,72 @@ +from openerp import models, fields,api +import datetime + + +class DoctorBenefit(models.Model): + _name = 'med_marketing.doctor.line' + + name = fields.Char('Description') + doctor_id = fields.Many2one('res.partner') + account_id = fields.Many2one('account.account', 'Account') + amt = fields.Float('Cost') + exp_account = fields.Many2one('account.account', 'Expenses Account') + state = fields.Selection([('unposted', 'Draft'), ('posted', 'Posted'), ], default="unposted") + journal_id = fields.Many2one('account.journal', 'Journal') + + @api.one + def post_confirm(self): + self.state = 'posted' + ref = 'DRX' + str(datetime.datetime.now().year) + str(self.id).zfill(4) + num = 'DRX' + '/' + str(datetime.datetime.now().year) + '/' + str(self.id).zfill(4) + if self.name == False: + description = '' + else: + description = self.name + j_lines_list = [] + j_lines_1 = {'name': description, + 'partner_id': None, + 'account_id': self.account_id.id, + 'debit': 0.0, + 'credit': self.amt, + } + + j_lines_list.append((0, 0, j_lines_1)) + j_lines_2 = {'name': description, + 'partner_id': None, + 'account_id': self.exp_account.id, + 'debit': self.amt, + 'credit': 0.0, + } + + j_lines_list.append((0, 0, j_lines_2)) + + j_values = {'name': num, + 'journal_id': self.journal_id.id, + 'ref': ref, + 'state': 'posted' + } + + j_values.update({'line_id': j_lines_list}) + j_obj = self.pool.get('account.move') + j_obj.create(self._cr, self._uid, j_values) + + +class Doctors(models.Model): + _inherit = 'res.partner' + + @api.one + def get_current_id(self): + return self.id + + def doctor_exp_btn(self, cr, uid, ids, context=None): + created_domain = '[("doctor_id","in",'+str(self.get_current_id(cr, uid, ids, context))+')]' + return { + 'name':'Doctor Expenses', + 'type': 'ir.actions.act_window', + 'res_model': 'med_marketing.doctor.line', + 'view_type': 'form', + 'view_mode': 'tree,form', + 'target': 'current', + 'domain': created_domain, + } + diff --git a/med_marketing/models/med_marketing.py b/med_marketing/models/med_marketing.py new file mode 100644 index 000000000..bede7ae8a --- /dev/null +++ b/med_marketing/models/med_marketing.py @@ -0,0 +1,14 @@ +from openerp import models, fields,api + + +class MedicalDepartments(models.Model): + _name = 'pha_marketing.departments' + + name = fields.Char('Name of Department') + + +class MedicinesInfo(models.Model): + _inherit = "product.template" + + uses_in = fields.Many2many('pha_marketing.departments', 'name') + diff --git a/med_marketing/models/rep.py b/med_marketing/models/rep.py new file mode 100644 index 000000000..69a217105 --- /dev/null +++ b/med_marketing/models/rep.py @@ -0,0 +1,18 @@ +from openerp import models, fields,api + + +class RepEmployee(models.Model): + _inherit = 'hr.employee' + + rep = fields.Boolean('Medical Representative') + commission = fields.Float('Commission') + target = fields.Integer('Target') + + @api.one + def _get_total_sale(self): + total = 0.0 + for EACH_Doctor in self.env['res.partner'].search([('doctor', '=', True)]): + if EACH_Doctor.related_rep.id == self.id: + total += EACH_Doctor.total_sale + self.total_sale = total + total_sale = fields.Integer('Total sale', compute='_get_total_sale') diff --git a/med_marketing/static/description/icon.png b/med_marketing/static/description/icon.png new file mode 100644 index 000000000..69c614c7c Binary files /dev/null and b/med_marketing/static/description/icon.png differ diff --git a/med_marketing/static/img/dr1.jpg b/med_marketing/static/img/dr1.jpg new file mode 100644 index 000000000..5c82e606a Binary files /dev/null and b/med_marketing/static/img/dr1.jpg differ diff --git a/med_marketing/static/img/dr2.jpg b/med_marketing/static/img/dr2.jpg new file mode 100644 index 000000000..cf6f586c4 Binary files /dev/null and b/med_marketing/static/img/dr2.jpg differ diff --git a/med_marketing/static/img/dr3.jpg b/med_marketing/static/img/dr3.jpg new file mode 100644 index 000000000..55dd170b3 Binary files /dev/null and b/med_marketing/static/img/dr3.jpg differ diff --git a/med_marketing/static/img/dr4.jpg b/med_marketing/static/img/dr4.jpg new file mode 100644 index 000000000..44e096512 Binary files /dev/null and b/med_marketing/static/img/dr4.jpg differ diff --git a/med_marketing/static/img/dr6.jpg b/med_marketing/static/img/dr6.jpg new file mode 100644 index 000000000..3b3c1c281 Binary files /dev/null and b/med_marketing/static/img/dr6.jpg differ diff --git a/med_marketing/static/img/dr7.jpg b/med_marketing/static/img/dr7.jpg new file mode 100644 index 000000000..8ca244aa0 Binary files /dev/null and b/med_marketing/static/img/dr7.jpg differ diff --git a/med_marketing/views/doctor_exp_view.xml b/med_marketing/views/doctor_exp_view.xml new file mode 100644 index 000000000..889024ceb --- /dev/null +++ b/med_marketing/views/doctor_exp_view.xml @@ -0,0 +1,81 @@ + + + + + + + med_marketing.doctor.line.form + med_marketing.doctor.line + +
+
+
+ + + + + + + + + + + + + + + + +
+
+
+ + + med_marketing.doctor.line.tree + med_marketing.doctor.line + + + + + + + + + + + + + + Doctor Benefits + med_marketing.doctor.line + form + tree,form + [] + {} + +

+ Click to add a new doctor benefits. +

+
+
+ + + + +
+
\ No newline at end of file diff --git a/med_marketing/views/doctor_view.xml b/med_marketing/views/doctor_view.xml new file mode 100644 index 000000000..6041ffaca --- /dev/null +++ b/med_marketing/views/doctor_view.xml @@ -0,0 +1,81 @@ + + + + + + + res.partner.doctor + res.partner + + + + + + + + + + + res.partner.doctor + res.partner + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/med_marketing/views/rep_view.xml b/med_marketing/views/rep_view.xml new file mode 100644 index 000000000..ac52dcac8 --- /dev/null +++ b/med_marketing/views/rep_view.xml @@ -0,0 +1,63 @@ + + + + + + Employees + hr.employee + + + + + + + + + + + + hr.employee.form.inherit + hr.employee + + + +

+

+
+
+ + + + + +
+
+ + + Medical Representatives + hr.employee + form + kanban,tree,form + [] + {"search_default_filter_rep":1, "default_rep":1} + + + +

+ Click to add a new employee. +

+ With just a quick glance on the Odoo employee screen, you + can easily find all the information you need for each person; + contact data, job position, availability, etc. +

+
+
+ + + +
+
diff --git a/medical_feature/__init__.py b/medical_feature/__init__.py new file mode 100644 index 000000000..29d807e14 --- /dev/null +++ b/medical_feature/__init__.py @@ -0,0 +1 @@ +import pharmacy_mgt,route_manage,expiry_manage diff --git a/medical_feature/__openerp__.py b/medical_feature/__openerp__.py new file mode 100644 index 000000000..7eb5cb9b5 --- /dev/null +++ b/medical_feature/__openerp__.py @@ -0,0 +1,28 @@ +{ + 'name': "Pharmacy Management", + 'summary': """ Some Basics For Field of Medicine """, + 'description': """ """, + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'license': 'AGPL-3', + 'category': 'Medicine', + 'version': '0.1', + 'depends': ["base", + "sale", + "purchase", + "stock", + "mrp", + "mrp_operations", + "product_expiry", + "account_accountant"], + 'data': ['views/pharmacy_mgt_view.xml', + 'views/medicines_view.xml', + 'route_manage/route_manage_view.xml', + 'route_manage/report.xml', 'new_names.xml', + 'expiry_manage/expiry_manage_view.xml', + ], + 'demo': ['demo/demo.xml'], + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/medical_feature/demo/demo.xml b/medical_feature/demo/demo.xml new file mode 100644 index 000000000..a02d7e7bd --- /dev/null +++ b/medical_feature/demo/demo.xml @@ -0,0 +1,335 @@ + + + + + + + Sm street + + + Manorama Junction + + + East Nadakavu Junction + + + + Sarovaram + + + + Mavoor Road + + + + Malakunta + + + + Gruhkalpa + + + + Band colony + + + + Sultan Bazaar + + + + Esamiya Bazaar + + + + Royapettah + + + + Teynampet + + + + T Nagar + + + + Kodambakkam + + + + Arumbakkam + + + + + + Lal Bazaar + + + + Bow Bazaar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Kolkata + KLT + + + + + + Mumbai + MBI + + + + + New Delhi + DLH + + + + + + Chennai + CHN + + + + + + Hyderabad + HBD + + + + + + Calicut + CLT + + + + + + + 11 + Eye + + + 12 + Ear, Nose and Oropharynx + + + 13 + Skin + + + 14 + Infections and Infestations + + + 15 + Allergic disorders + + + 16 + Gastrointestinal tract + + + 17 + Nutrition + + + + + + Acetylcysteine + 10.0 + 10.0 + + + + + + Carbomer Liquid Eye Gels + 10.0 + 10.0 + + + + + + + Azithromycin + 10.0 + 10.0 + + + + + + Amoxicillin + 10.0 + 10.0 + + + + + + + Clarithromycin + 10.0 + 10.0 + + + + + + Celiprolol + 10.0 + 10.0 + + + + + + Cetirizine + 10.0 + 10.0 + + + + + + Dimethindene + 10.0 + 10.0 + + + + + + Aciphex + 10.0 + 10.0 + + + + + + Gastrogafin + 10.0 + 10.0 + + + + + + Gleevec + 10.0 + 10.0 + + + + + + + + AE00G5K220001 + + + + + + AE00G5K220002 + + + + + + AE00G5K220003 + + + + + + + \ No newline at end of file diff --git a/medical_feature/expiry_manage/__init__.py b/medical_feature/expiry_manage/__init__.py new file mode 100644 index 000000000..189ff2d34 --- /dev/null +++ b/medical_feature/expiry_manage/__init__.py @@ -0,0 +1 @@ +import expiry_manage \ No newline at end of file diff --git a/medical_feature/expiry_manage/expiry_manage.py b/medical_feature/expiry_manage/expiry_manage.py new file mode 100644 index 000000000..1f48d51ef --- /dev/null +++ b/medical_feature/expiry_manage/expiry_manage.py @@ -0,0 +1,52 @@ +from openerp import models, fields, _ +from openerp import api +import datetime +from dateutil import parser + + +class StockTransferDetailsItems(models.TransientModel): + _inherit = 'stock.transfer_details_items' + + lot_id = fields.Many2one('stock.production.lot', 'Lot/Serial Number') + + @api.onchange('lot_id') + def when_items_changes_(self): + # ALERT DATE [alert_date] + if self.lot_id.alert_date is not False and parser.parse(self.lot_id.alert_date) < datetime.datetime.now(): + return {'warning': {'title': _('Warning'), 'message': _('The lot \''+self.lot_id.name+'\' of '+' medicine \''+self.lot_id.product_id.name+'\'\n must not be consumed and should be removed from the stock.')}} + # REMOVAL DATE [removal_date] + if self.lot_id.removal_date is not False and parser.parse(self.lot_id.removal_date) < datetime.datetime.now(): + return {'warning': {'title': _('Warning'), 'message': _('The lot \''+self.lot_id.name+'\' of '+' medicine \''+self.lot_id.product_id.name+'\'\n must not be consumed and should be removed from the stock.')}} + # END OF LIFE DATE [life_date] + if self.lot_id.life_date is not False and parser.parse(self.lot_id.life_date) < datetime.datetime.now(): + return {'warning': {'title': _('Warning'), 'message': _('The lot \''+self.lot_id.name+'\' of '+' medicine \''+self.lot_id.product_id.name+'\'\n is dangerous and must not be consumed.')}} + # BEST BEFORE DATE [use_date] + if self.lot_id.use_date is not False and parser.parse(self.lot_id.use_date) < datetime.datetime.now(): + return {'warning': {'title': _('Warning'), 'message': _('The lot \''+self.lot_id.name+'\' of '+' medicine \''+self.lot_id.product_id.name+'\'\n is not good for use now.')}} + + +class AddColorSerialNo(models.Model): + _inherit = 'stock.production.lot' + + def _get_default_vals(self): + for each_lots in self: + if each_lots.alert_date is not False and parser.parse(each_lots.alert_date) < datetime.datetime.now(): + each_lots.state = 'red' + elif each_lots.removal_date is not False and parser.parse(each_lots.removal_date) < datetime.datetime.now(): + each_lots.state = 'red' + elif each_lots.life_date is not False and parser.parse(each_lots.life_date) < datetime.datetime.now(): + each_lots.state = 'red' + elif each_lots.use_date is not False and parser.parse(each_lots.use_date) < datetime.datetime.now(): + each_lots.state = 'lite_red' + else: + each_lots.state = 'normal' + + + state = fields.Selection([('normal', 'Normal'), + ('lite_red', 'Not Good'), + ('red', 'To Be Removed')], + string='Status', + compute=lambda self: self._get_default_vals() + # default=lambda self: self._get_default_vals() + ) + diff --git a/medical_feature/expiry_manage/expiry_manage_view.xml b/medical_feature/expiry_manage/expiry_manage_view.xml new file mode 100644 index 000000000..a28028f84 --- /dev/null +++ b/medical_feature/expiry_manage/expiry_manage_view.xml @@ -0,0 +1,56 @@ + + + + + + stock.production.lot.tree + stock.production.lot + + + + + + + + + + + + + Production Lots Filter + stock.production.lot + + + + + + + + + + + + + Serial Numbers + ir.actions.act_window + stock.production.lot + form + + + {} + +

+ Click to add a serial number. +

+ This is the list of all the production lots you recorded. When + you select a lot, you can get the traceability of the products contained in lot. +

+
+
+ + +
+
\ No newline at end of file diff --git a/medical_feature/new_names.xml b/medical_feature/new_names.xml new file mode 100644 index 000000000..c50e07d87 --- /dev/null +++ b/medical_feature/new_names.xml @@ -0,0 +1,170 @@ + + + + + + + + Retailers + + + + Retailers + + + + + + + Draft Orders + + + Draft Orders + + + + + + Confirmed Orders + + + Confirmed Orders + + + + + + Medicines + + + + Medicines + + + Medicines + + + + + + Medicines Variants + + + Medicines Variants + + + + + + + + + + + + + + + + + Draft Orders + + + Draft Orders + + + + + + Confirmed Orders + + + Confirmed Orders + + + + + + Vendors + + + Vendors + + + + + + Medicines + + + + Medicines + + + Medicines + + + + + + + + + + + + + + + Talks + + + + + + + Stocks + + + + Medicines + + + + + + Medicines + + + + + + + + Medicines + + + + Medicines + + + Medicines + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/medical_feature/pharmacy_mgt.py b/medical_feature/pharmacy_mgt.py new file mode 100644 index 000000000..93ebd2b7d --- /dev/null +++ b/medical_feature/pharmacy_mgt.py @@ -0,0 +1,32 @@ +from openerp import models, fields,api + + +class Medicines(models.Model): + _inherit = 'product.template' + + medicine_category = fields.Selection([('allopathy', 'Allopathy'), + ('ayurvedic', 'Ayurvedic'), + ('homeo', 'Homeo'), + ('generic', 'Generic'), + ('none', 'None Medicine'), + ('veterinary', 'Veterinary'), ], 'Medicine Type', default='generic') + medicine_type = fields.Many2one('product.medicine.types', 'Medicine Category') + product_of = fields.Many2one('product.medicine.responsible', 'Product Of') + + +class MedicineTypes(models.Model): + _name = 'product.medicine.types' + _rec_name = 'medicine_type' + + medicine_type = fields.Char(string="Medicine Category") + + +class MedicineResponsible(models.Model): + _name = 'product.medicine.responsible' + _rec_name = 'name_responsible' + + name_responsible = fields.Char(string="Product Of ") + related_vendor = fields.Many2one('res.partner', string='Related Vendor', domain="[('supplier', '=','1')]") + place = fields.Char(string="Place") + + diff --git a/medical_feature/route_manage/__init__.py b/medical_feature/route_manage/__init__.py new file mode 100644 index 000000000..36649b9a8 --- /dev/null +++ b/medical_feature/route_manage/__init__.py @@ -0,0 +1 @@ +import route_mgt diff --git a/medical_feature/route_manage/report.xml b/medical_feature/route_manage/report.xml new file mode 100644 index 000000000..78345b66f --- /dev/null +++ b/medical_feature/route_manage/report.xml @@ -0,0 +1,30 @@ + + + + + + sale.order.route + sale.order + + + + + + + + + + + Sales Analysis By Routes + sale.order + + graph + + + + + + \ No newline at end of file diff --git a/medical_feature/route_manage/route_manage_view.xml b/medical_feature/route_manage/route_manage_view.xml new file mode 100644 index 000000000..73c00582a --- /dev/null +++ b/medical_feature/route_manage/route_manage_view.xml @@ -0,0 +1,237 @@ + + + + + + pharmacy_management.route.kanban + pharmacy_management.route + + + + + + + + + + + +
+

+ +

+

+ +

+
+
+ +
+
+ + + + + +
+ + +
+
+
+
+
+
+
+
+ + + pharmacy_management.route.select + pharmacy_management.route + + + + + + + + + Routes + pharmacy_management.route + form + kanban,tree,form + {"search_default_my_route":1} + + + + + pharmacy_management.route.tree + pharmacy_management.route + + + + + + + + + + pharmacy_management.route.form + pharmacy_management.route + +
+ + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + +
+ + + +
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + res.partner.route + res.partner + + + + + + + + + sale.order.customer_route + sale.order + + + + + + + + + + + Retailers + ir.actions.act_window + res.partner + form + kanban,tree,form + {"search_default_customer":1 ,"search_default_my_retailers":1} + + +

+ Click to add a contact in your address book. +

+ Odoo helps you easily track all activities related to + a customer; discussions, history of business opportunities, + documents, etc. +

+
+
+ + + res.partner.serach + res.partner + + + + + + + + + + + sale.order.form.inherit269 + sale.order + + + + [('customer','=',True), ('id_of_route_distributor','=',uid)] + {'search_default_customer':1, 'show_address': 1, 'search_default_my_retailers': 1 } + + + + + + pharmacy_management.route.location.tree + pharmacy_management.route.location + + + + + + + + + pharmacy_management.route.location.form + pharmacy_management.route.location + +
+ + + + + +
+
+
+ + +
+
\ No newline at end of file diff --git a/medical_feature/route_manage/route_mgt.py b/medical_feature/route_manage/route_mgt.py new file mode 100644 index 000000000..aa5d128a6 --- /dev/null +++ b/medical_feature/route_manage/route_mgt.py @@ -0,0 +1,89 @@ +from openerp import models, fields,_ +from openerp import api + + +# ROUTE +class DistributionRoutes(models.Model): + _name = 'pharmacy_management.route' + + name = fields.Char('Route Name') + route_code = fields.Char() + distributor = fields.Many2one('res.users', 'Distributor') + customer_list = fields.One2many('res.partner', 'customer_route') + + @api.one + def _get_customer_count(self): + self.count_customers = len(self.customer_list) + count_customers = fields.Integer(compute='_get_customer_count') + # location_list = fields.One2many('pharmacy_management.route.location', 'route_id') + location_list1 = fields.Many2many('pharmacy_management.route.location', 'route_id', string='Locations') + + def locations_btn(self, cr, uid, ids, context=None): + return { + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'pharmacy_management.route.location', + 'view_id': False, + 'type': 'ir.actions.act_window', + 'name' : _('All Route Locations'), + } + + +# RETAILERS +class RouteInCustomer(models.Model): + _inherit = 'res.partner' + + @api.onchange('customer_route') + def set_id_of_route_distributor(self): + print self.customer_route.distributor.id + self.id_of_route_distributor = self.customer_route.distributor.id + + customer_route = fields.Many2one('pharmacy_management.route', 'Route') + id_of_route_distributor = fields.Integer() + + +# SALE ORDER +class RouteInSaleOrder(models.Model): + _inherit = 'sale.order' + + route_of_customer = fields.Many2one('pharmacy_management.route', 'Route of Customer') + + def onchange_partner_id(self, cr, uid, ids, part, context=None): + if not part: + return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'payment_term': False, 'fiscal_position': False}} + + part = self.pool.get('res.partner').browse(cr, uid, part, context=context) + addr = self.pool.get('res.partner').address_get(cr, uid, [part.id], ['delivery', 'invoice', 'contact']) + pricelist = part.property_product_pricelist and part.property_product_pricelist.id or False + invoice_part = self.pool.get('res.partner').browse(cr, uid, addr['invoice'], context=context) + payment_term = invoice_part.property_payment_term and invoice_part.property_payment_term.id or False + dedicated_salesman = part.user_id and part.user_id.id or uid + val = { + 'partner_invoice_id': addr['invoice'], + 'partner_shipping_id': addr['delivery'], + 'payment_term': payment_term, + 'user_id': dedicated_salesman, + } + delivery_onchange = self.onchange_delivery_id(cr, uid, ids, False, part.id, addr['delivery'], False, context=context) + val.update(delivery_onchange['value']) + if pricelist: + val['pricelist_id'] = pricelist + if not self._get_default_section_id(cr, uid, context=context) and part.section_id: + val['section_id'] = part.section_id.id + sale_note = self.get_salenote(cr, uid, ids, part.id, context=context) + if sale_note: val.update({'note': sale_note}) + # ================================================= + val['route_of_customer'] = part.customer_route.id + # val['user_id'] = part.customer_route.distributor.id + return {'value': val} + + def _get_route_of_customer_to_show(self): + self.route_of_customer_to_show = self.partner_id.customer_route.id + route_of_customer_to_show = fields.Many2one('pharmacy_management.route', 'Route of Customer' , compute='_get_route_of_customer_to_show') + + +class Locations(models.Model): + _name = 'pharmacy_management.route.location' + + name = fields.Char('Location Name') + route_id = fields.Many2one('pharmacy_management.route') \ No newline at end of file diff --git a/medical_feature/static/description/icon.png b/medical_feature/static/description/icon.png new file mode 100644 index 000000000..69c614c7c Binary files /dev/null and b/medical_feature/static/description/icon.png differ diff --git a/medical_feature/static/img/Acetylcysteine.jpg b/medical_feature/static/img/Acetylcysteine.jpg new file mode 100644 index 000000000..89524fe46 Binary files /dev/null and b/medical_feature/static/img/Acetylcysteine.jpg differ diff --git a/medical_feature/static/img/Azithromycin.jpg b/medical_feature/static/img/Azithromycin.jpg new file mode 100644 index 000000000..1cc9408b8 Binary files /dev/null and b/medical_feature/static/img/Azithromycin.jpg differ diff --git a/medical_feature/static/img/Carbomer_liquid_eye_gels.jpg b/medical_feature/static/img/Carbomer_liquid_eye_gels.jpg new file mode 100644 index 000000000..c26cc6ce6 Binary files /dev/null and b/medical_feature/static/img/Carbomer_liquid_eye_gels.jpg differ diff --git a/medical_feature/static/img/allr_Celiprolol.jpg b/medical_feature/static/img/allr_Celiprolol.jpg new file mode 100644 index 000000000..dc3aae0f4 Binary files /dev/null and b/medical_feature/static/img/allr_Celiprolol.jpg differ diff --git a/medical_feature/static/img/allr_Cetirizine.jpg b/medical_feature/static/img/allr_Cetirizine.jpg new file mode 100644 index 000000000..81492cdb1 Binary files /dev/null and b/medical_feature/static/img/allr_Cetirizine.jpg differ diff --git a/medical_feature/static/img/allr_Dimethindene.jpg b/medical_feature/static/img/allr_Dimethindene.jpg new file mode 100644 index 000000000..0fb76a69f Binary files /dev/null and b/medical_feature/static/img/allr_Dimethindene.jpg differ diff --git a/medical_feature/static/img/er_amoxicillin-1.jpg b/medical_feature/static/img/er_amoxicillin-1.jpg new file mode 100644 index 000000000..db134bf53 Binary files /dev/null and b/medical_feature/static/img/er_amoxicillin-1.jpg differ diff --git a/medical_feature/static/img/gs_Aciphex.jpg b/medical_feature/static/img/gs_Aciphex.jpg new file mode 100644 index 000000000..1ea63d1c1 Binary files /dev/null and b/medical_feature/static/img/gs_Aciphex.jpg differ diff --git a/medical_feature/static/img/gs_Gleevec.jpg b/medical_feature/static/img/gs_Gleevec.jpg new file mode 100644 index 000000000..70fcec751 Binary files /dev/null and b/medical_feature/static/img/gs_Gleevec.jpg differ diff --git a/medical_feature/static/img/gs_gastrogafin.jpg b/medical_feature/static/img/gs_gastrogafin.jpg new file mode 100644 index 000000000..52bcd2a3c Binary files /dev/null and b/medical_feature/static/img/gs_gastrogafin.jpg differ diff --git a/medical_feature/static/img/re_clarithromycin.jpg b/medical_feature/static/img/re_clarithromycin.jpg new file mode 100644 index 000000000..51fe0ab2f Binary files /dev/null and b/medical_feature/static/img/re_clarithromycin.jpg differ diff --git a/medical_feature/views/medicines_view.xml b/medical_feature/views/medicines_view.xml new file mode 100644 index 000000000..435681301 --- /dev/null +++ b/medical_feature/views/medicines_view.xml @@ -0,0 +1,28 @@ + + + + + + + Medicines + ir.actions.act_window + product.template + kanban,tree,form + form + + {"search_default_filter_to_sell":1, "search_default_medicine_type":1,} + + + + + + + + + \ No newline at end of file diff --git a/medical_feature/views/pharmacy_mgt_view.xml b/medical_feature/views/pharmacy_mgt_view.xml new file mode 100644 index 000000000..0f4559503 --- /dev/null +++ b/medical_feature/views/pharmacy_mgt_view.xml @@ -0,0 +1,174 @@ + + + + + + Medical Features Manager + + + + + + + + + + + + product.medicine.types.form + product.medicine.types + +
+ + + + + +
+
+
+ + + product.medicine.types.tree + product.medicine.types + + + + + + + + + Medicine Categories + product.medicine.types + form + tree,form + + + + + + + product.template.form.inherited + product.template + + + + + + + + + + + + + + product.template.kanban.inherited + product.template + + + + + + + + + + + + + product.template.form.inherited.new + product.template + + + + + + + + + + + + Medicines + ir.actions.act_window + product.template + kanban,tree,form + form + + {"search_default_filter_to_sell":1, "search_default_medicine_type":1,} + + + + + + + product.medicine.responsible.form + product.medicine.responsible + +
+ + + + + + + +
+
+
+ + + product.medicine.responsible.tree + product.medicine.responsible + + + + + + + + + + + Medicine Responsible + product.medicine.responsible + form + tree,form + + + + + + Manage Lots / Serial Numbers + + + + + + + +
+
\ No newline at end of file