From 11d8bda4aed192fae1ee96b077a5debbcb576b92 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Fri, 19 Aug 2016 22:07:34 +0700 Subject: [PATCH] merge product by use mdc_name, description and name to show in any report --- netforce_clinic/layouts/clinic_prod_form.xml | 1 + netforce_clinic/models/hd_case.py | 3 ++- netforce_clinic/models/product.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/netforce_clinic/layouts/clinic_prod_form.xml b/netforce_clinic/layouts/clinic_prod_form.xml index 98b238c..b0fdae2 100644 --- a/netforce_clinic/layouts/clinic_prod_form.xml +++ b/netforce_clinic/layouts/clinic_prod_form.xml @@ -3,6 +3,7 @@ + diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index 6af5caf..e07ab4e 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -115,7 +115,8 @@ class HDCase(Model): for line in obj.lines: amt=line.amount or 0 prod=line.product_id - prod_name=prod.description or prod.name or "" + # use mdc_name and description and name to merge product + prod_name=prod.mdc_name or prod.description or prod.name or "" categ=line.product_categ_id if categ and prod: sign=1 diff --git a/netforce_clinic/models/product.py b/netforce_clinic/models/product.py index 246ccec..c212b72 100644 --- a/netforce_clinic/models/product.py +++ b/netforce_clinic/models/product.py @@ -9,6 +9,7 @@ class Product(Model): 'report_visible': fields.Boolean("Report Visible"), 'account_products': fields.One2Many('clinic.setting.account.product','product_id','Account Products'), 'default_qty': fields.Float("Default Qty"), + 'mdc_name': fields.Char("Medical Name"), } #TODO