diff --git a/netforce_clinic/actions/clinic_setting_account_patient.xml b/netforce_clinic/actions/clinic_setting_account_patient.xml new file mode 100644 index 0000000..8cc6457 --- /dev/null +++ b/netforce_clinic/actions/clinic_setting_account_patient.xml @@ -0,0 +1,7 @@ + + Account Patient + multi_view + clinic.setting.account.patient + account_menu + 200 + diff --git a/netforce_clinic/actions/clinic_setting_account_product.xml b/netforce_clinic/actions/clinic_setting_account_product.xml new file mode 100644 index 0000000..ede2d6d --- /dev/null +++ b/netforce_clinic/actions/clinic_setting_account_product.xml @@ -0,0 +1,7 @@ + + Account Product + multi_view + clinic.setting.account.product + account_menu + 1000 + diff --git a/netforce_clinic/layouts/clinic_account_menu.xml b/netforce_clinic/layouts/clinic_account_menu.xml index cbe008b..c3ac482 100644 --- a/netforce_clinic/layouts/clinic_account_menu.xml +++ b/netforce_clinic/layouts/clinic_account_menu.xml @@ -2,6 +2,8 @@ + + diff --git a/netforce_clinic/layouts/clinic_account_setting.xml b/netforce_clinic/layouts/clinic_account_setting.xml index b2bc491..57fd5f2 100644 --- a/netforce_clinic/layouts/clinic_account_setting.xml +++ b/netforce_clinic/layouts/clinic_account_setting.xml @@ -23,29 +23,49 @@ - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + - - + + diff --git a/netforce_clinic/layouts/clinic_setting_account_patient_form.xml b/netforce_clinic/layouts/clinic_setting_account_patient_form.xml new file mode 100644 index 0000000..47135ae --- /dev/null +++ b/netforce_clinic/layouts/clinic_setting_account_patient_form.xml @@ -0,0 +1,8 @@ +
+ + + + + + + diff --git a/netforce_clinic/layouts/clinic_setting_account_patient_list.xml b/netforce_clinic/layouts/clinic_setting_account_patient_list.xml new file mode 100644 index 0000000..3fb05ba --- /dev/null +++ b/netforce_clinic/layouts/clinic_setting_account_patient_list.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/netforce_clinic/layouts/clinic_setting_account_prod_form.xml b/netforce_clinic/layouts/clinic_setting_account_prod_form.xml new file mode 100644 index 0000000..014ef49 --- /dev/null +++ b/netforce_clinic/layouts/clinic_setting_account_prod_form.xml @@ -0,0 +1,8 @@ +
+ + + + + + + diff --git a/netforce_clinic/layouts/clinic_setting_account_prod_list.xml b/netforce_clinic/layouts/clinic_setting_account_prod_list.xml new file mode 100644 index 0000000..4dfb6bf --- /dev/null +++ b/netforce_clinic/layouts/clinic_setting_account_prod_list.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/netforce_clinic/models/setting_account_patient.py b/netforce_clinic/models/setting_account_patient.py index daacbe8..8e56c12 100644 --- a/netforce_clinic/models/setting_account_patient.py +++ b/netforce_clinic/models/setting_account_patient.py @@ -1,4 +1,5 @@ from netforce.model import Model, fields +from netforce.access import get_active_company class SettingAccountPatient(Model): _name="clinic.setting.account.patient" @@ -6,13 +7,17 @@ class SettingAccountPatient(Model): _fields={ "setting_id": fields.Many2One("clinic.setting","Setting",required=True,on_delete="cascade"), - "patient_id": fields.Many2One("clinic.patient","Patient",domain=[["state","=","admit"]]), - 'partner_id': fields.Many2One("partner","Contact"), - 'type_id': fields.Many2One("clinic.patient.type","Type"), - 'hn': fields.Char("HN"), - 'card_no': fields.Char("ID Card",size=13), + "patient_id": fields.Many2One("clinic.patient","Patient",domain=[["state","=","admit"]], search=True), + 'partner_id': fields.Many2One("partner","Contact", search=True), + 'type_id': fields.Many2One("clinic.patient.type","Type", search=True), + 'hn': fields.Char("HN", search=True), + 'card_no': fields.Char("ID Card",size=13, search=True), + 'company_id': fields.Many2One("company","Company"), + } + _defaults={ + 'setting_id': 1, + "company_id": lambda *a: get_active_company(), } - _order="type_id,patient_id" SettingAccountPatient.register() diff --git a/netforce_clinic/models/setting_account_product.py b/netforce_clinic/models/setting_account_product.py index 69e854c..2a8c327 100644 --- a/netforce_clinic/models/setting_account_product.py +++ b/netforce_clinic/models/setting_account_product.py @@ -8,17 +8,18 @@ class SettingAccountProduct(Model): _fields={ "setting_id": fields.Many2One("clinic.setting","Setting",required=True,on_delete="cascade"), - "patient_type_id": fields.Many2One("clinic.patient.type","Patient Type"), - 'categ_id': fields.Many2One("product.categ","Category"), - "product_id": fields.Many2One("product","Product"), - "ar_credit_id": fields.Many2One("account.account","Income Credit",multi_company=True), - "ar_debit_id": fields.Many2One("account.account","AR Debit",multi_company=True), + "patient_type_id": fields.Many2One("clinic.patient.type","Patient Type",search=True), + 'categ_id': fields.Many2One("product.categ","Category",search=True), + "product_id": fields.Many2One("product","Product",search=True), + "ar_credit_id": fields.Many2One("account.account","Income Credit",multi_company=True,search=True), + "ar_debit_id": fields.Many2One("account.account","AR Debit",multi_company=True,search=True), 'company_id': fields.Many2One("company","Company"), - "type": fields.Selection([("cash","Cash"),("credit","Credit")],"Type"), + "type": fields.Selection([("cash","Cash"),("credit","Credit")],"Type",search=True), } _defaults={ "company_id": lambda *a: get_active_company(), + 'setting_id': 1, } _order="patient_type_id"