conv_bal
watcha.h@almacom.co.th 2015-01-23 17:28:08 +07:00
parent 098b077c86
commit 737221b971
9 changed files with 42 additions and 20 deletions

View File

@ -1,6 +1,6 @@
<action> <action>
<field name="string">Pharmacies</field> <field name="string">Shop</field>
<field name="view_cls">multi_view</field> <field name="view_cls">multi_view</field>
<field name="model">clinic.pharmacy</field> <field name="model">clinic.shop</field>
<field name="menu">clinic_menu</field> <field name="menu">clinic_menu</field>
</action> </action>

View File

@ -43,7 +43,7 @@
</item> </item>
<item string="HD Cases" perm="clinic_hdcase"> <item string="HD Cases" perm="clinic_hdcase">
<item string="HD Cases" action="clinic_hd_case"/> <item string="HD Cases" action="clinic_hd_case"/>
<item string="Pharmacies" action="clinic_pharmacy" perm="clinic_pharmacy"/> <item string="RD Shop" action="clinic_shop" perm="clinic_shop"/>
<divider/> <divider/>
<header string="SETTINGS"/> <header string="SETTINGS"/>
<item string="Sickbed" action="clinic_sickbed"/> <item string="Sickbed" action="clinic_sickbed"/>

View File

@ -1,4 +1,4 @@
<form model="clinic.pharmacy"> <form model="clinic.shop">
<head> <head>
<field name="state"/> <field name="state"/>
<button string="Options" dropdown="1"> <button string="Options" dropdown="1">
@ -41,8 +41,20 @@
<button string="Pay" type="success"/> <button string="Pay" type="success"/>
</foot> </foot>
<related> <related>
<field name="orders"/>
<field name="invoices"/> <field name="invoices"/>
<field name="payments">
<list>
<field name="number"/>
<field name="date"/>
<field name="partner_id"/>
<field name="type"/>
<field name="pay_type"/>
<field name="account_id"/>
<field name="ref"/>
<field name="amount_total"/>
<field name="state"/>
</list>
</field>
<field name="pickings"/> <field name="pickings"/>
</related> </related>
</form> </form>

View File

@ -1,4 +1,4 @@
<list model="clinic.pharmacy"> <list model="clinic.shop">
<field name="number"/> <field name="number"/>
<field name="date"/> <field name="date"/>
<field name="patient_id"/> <field name="patient_id"/>

View File

@ -89,6 +89,6 @@ from . import product_categ
from . import make_apt from . import make_apt
from . import make_apt_line from . import make_apt_line
from . import matching_payment from . import matching_payment
from . import pharmacy from . import shop
from . import pharmacy_line from . import shop_line
from . import sale_order from . import sale_order

View File

@ -4,7 +4,7 @@ class SaleOrder(Model):
_inherit="sale.order" _inherit="sale.order"
_fields={ _fields={
"pharmacy_id": fields.Many2One("clinic.pharmacy","Pharmacy"), "shop_id": fields.Many2One("clinic.shop","Shop"),
} }
SaleOrder.register() SaleOrder.register()

View File

@ -4,9 +4,9 @@ from netforce.model import Model, fields, get_model
from netforce.access import get_active_user from netforce.access import get_active_user
from netforce.utils import get_data_path from netforce.utils import get_data_path
class Pharmacy(Model): class Shop(Model):
_name="clinic.pharmacy" _name="clinic.shop"
_string="Pharmacy" _string="Shop"
def _get_all(self,ids,context={}): def _get_all(self,ids,context={}):
res={} res={}
@ -23,13 +23,13 @@ class Pharmacy(Model):
'patient_id': fields.Many2One('clinic.patient','Patient',search=True), 'patient_id': fields.Many2One('clinic.patient','Patient',search=True),
'department_id': fields.Many2One("clinic.department","Department"), 'department_id': fields.Many2One("clinic.department","Department"),
'branch_id': fields.Many2One("clinic.branch","Branch"), 'branch_id': fields.Many2One("clinic.branch","Branch"),
'lines': fields.One2Many('clinic.pharmacy.line','pharmacy_id','Lines'), 'lines': fields.One2Many('clinic.shop.line','shop_id','Lines'),
'total': fields.Float("Total",function="_get_all",function_multi=True), 'total': fields.Float("Total",function="_get_all",function_multi=True),
'user_id': fields.Many2One("base.user","Pharmacist"), 'user_id': fields.Many2One("base.user","Pharmacist"),
'state': fields.Selection([['draft','Draft'],['waiting_payment','Waiting Payment'],['paid','Paid']],'State'), 'state': fields.Selection([['draft','Draft'],['waiting_payment','Waiting Payment'],['paid','Paid']],'State'),
"pickings": fields.One2Many("stock.picking","related_id","Pickings"), "pickings": fields.One2Many("stock.picking","related_id","Pickings"),
"invoices": fields.One2Many("account.invoice","related_id","Invoices"), "invoices": fields.One2Many("account.invoice","related_id","Invoices"),
"orders": fields.One2Many("sale.order","pharmacy_id","Orders"), "payments": fields.One2Many("account.payment","related_id","Payments"),
} }
def _get_branch(self,context={}): def _get_branch(self,context={}):
@ -65,4 +65,4 @@ class Pharmacy(Model):
line['amount']=line['price']*line['qty'] line['amount']=line['price']*line['qty']
return data return data
Pharmacy.register() Shop.register()

View File

@ -1,11 +1,11 @@
from netforce.model import Model, fields from netforce.model import Model, fields
class PharmacyLine(Model): class ShopLine(Model):
_name="clinic.pharmacy.line" _name="clinic.shop.line"
_string="Pharmacy Line" _string="Shop Line"
_fields={ _fields={
'pharmacy_id': fields.Many2One('clinic.pharmacy','Pharmacy',required=True,on_delete="cascade"), 'shop_id': fields.Many2One('clinic.shop','Shop',required=True,on_delete="cascade"),
'product_id': fields.Many2One('product','Product'), 'product_id': fields.Many2One('product','Product'),
'description': fields.Char("Description"), 'description': fields.Char("Description"),
'uom_id': fields.Many2One("uom","UOM"), 'uom_id': fields.Many2One("uom","UOM"),
@ -15,4 +15,4 @@ class PharmacyLine(Model):
'account_id': fields.Many2One("account.account","Account"), 'account_id': fields.Many2One("account.account","Account"),
} }
PharmacyLine.register() ShopLine.register()

View File

@ -7,6 +7,16 @@ todo:
- copy nurse only in the list - copy nurse only in the list
- problem after confirm visit - problem after confirm visit
- accounting
- invoice line -> account -> credit
- debit from hd case setting
- if user select product by them self
- credit <= product -> tab -> accounting -> sale -> sale account
- debit <= 1. contact -> tab accounting -> account receiaveble , 2. finacial setting -> account receiable
- sale medicine
- import hd case *** - import hd case ***
- add script - add script
- report - report