Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Is it necessary to fill up data in stock picking model

By
Abegail Sanchez
on 6/18/14, 1:03 AM 716 views

I have a billing module that has a model "hospital.billing" with one2many relationship "hospital.account.lines" , it is like POS module with "pos.order" and pos.order.line",stock picking in POS is in pos.order model but my stock picking is in hospital account lines model since my transaction always in hospital account lines. Everytime the patient order a medicine  will be added its to Statement of Account. Since patient has only one SOA. This is my model stucture.
          
   _name="hospital.billing"
    _description="Hospital Billing System"
    
    _columns={
              
              'name' : fields.char ('Bill Number',required=True,states={'process':[('readonly',True)], 'cancel':[('readonly',True)]}, size=20),
              'date_processed': fields.date('Date Processed', select=True, readonly=True),
              'patient_case_id' : fields.many2one ('his.admission', 'Patient Admission', required=True, states={'process':[('readonly',True)], 'cancel':[('readonly',True)]}),
              'inpac_rmbd_invoices' : fields.one2many ('hospital.roomboard_invoice', 'name', 'In-Patient Room and Board Lines' ,states={'process':[('readonly',True)], 'cancel':[('readonly',True)]}),

              'billing_soa_lines' : fields.one2many ('hospital.account.lines', 'name', 'In-Patient SOA Lines' ,states={'process':[('readonly',True)], 'cancel':[('readonly',True)]}),
              'creditor_id' : fields.one2many ('creditor.mgmt', 'creditor', 'Creditors' ,states={'process':[('readonly',True)], 'cancel':[('readonly',True)]},domain=[('refund','=',False)]),
              'note': fields.text('Note' ,states={'process':[('readonly',True)], 'cancel':[('readonly',True)]}),
              'opd': fields.boolean('Out Patient'),
              'date_created':fields.datetime('Date Created'),
              'data_encoder':fields.many2one('res.users','Data Created by',readonly=True),
              'company_id':fields.related('data_encoder','company_id',type="many2one",relation="res.company",store=True,readonly=True,string="Company")

              
        _name="hospital.account.lines"
        _description ="Hospital Account lines"
        
        
        _columns={
                   'product_id':fields.many2one('product.product','Products',required=True),
                   'quantity':fields.float('Quantity',required=True),
                   'price_unit':fields.float('Price Unit',),
                   'discount':fields.float('Discount %'),
                   'price_subtotal':fields.function(price_subtotal,method=True,type="float",string="Price Subtotal w/o   Tax",store=False,readonly=True),
                   'creditor_amt':fields.function(creditor_amt,string='Creditor',type="float",method=True,readonly=True),
                   #'creditor_amt':fields.float('Creditor Amount',readonly=True),
                   'patient_amount':fields.function(patient_amount,method=True,type="float",string="Patient               Amount",store=False,readonly=True),
                   **'picking_id':fields.many2one('stock.picking','Stock Picking'),**
                   'pricelist_id':fields.many2one('product.pricelist','Product Pricelist'),
                   'primary_shop_id':fields.many2one('sale.shop','Primary Shop',),
                   'secondary_shop_id':fields.many2one('sale.shop','Secondary Shop'),
                   'date_created':fields.date('Date Created'),
                   'user_id':fields.many2one('res.users','Salesman'),
    }

1

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 6/18/14, 4:57 AM

Abegail,

There should be a field in hospital.account.lines for many2one ref to hospital.billing.

What you can do is, upon validating/confirmng the SOA(billing), create a picking and link it to hospital.account.lines.

Better solution, you should link hospital.account.lines with stock.move (many2one), and hospital.billing should have many2one for stock.picking.

Thanks.

0
Abegail Sanchez
On 6/18/14, 11:56 PM

Thanks,

Yes, hospital account lines has a many2one rel to hospital billing.

How about if I will refund a medicine or products? Will I use the same stock picking id for the whole hospital account lines or I need to update/change it in every transaction?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/18/14, 1:03 AM
Seen: 716 times
Last updated: 3/16/15, 8:10 AM