Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to show the customer payment Total in fields in OpenERP?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 568
    Comment on it

    In OpenERP first, create a custom module and then inherits the account.payment object in your own module like module name test.

    Follow these steps given below

    Step1- First create the file in your test module and use this code given below,

    import test


    Step2- Then create another file like: file in your test module and use this code shown in below

        "name": "Test",
        "version": "1.0",
        "author": "sachin singh",
        "description" : "this module basically for show all amount when customer payment is full then all amount show in your fields",
        "depends": ["base","account"],
        "category" : "Generic Modules/Others",
        "init_xml": [],
        "update_xml": ["test.xml"],
        "active": False,
        "installable": True,


    Step3- Now create another file like: file in your test module and then create a nnew field in this file, use this code shown below,

    from openerp.osv import osv, fields
    class test(osv.Model):
        _name = 'test'
        invoice_total_paid1 = fields.Text(string='Total payment', required=True)
    class account_payment(osv.Model):
        _inherit = 'account.payment'
        def post(self):
            for inv in self.invoice_ids:
                inv_origin = inv.origin
            payment_ids =[])
            pay_rec_list = []
            for pay in payment_ids:
                for inv in pay.invoice_ids:
                    if inv_origin == inv.origin:
            cur_payment_ids =[('id','in',pay_rec_list)])
            total = 0
            for p in cur_payment_ids:
                total += p.amount
            rent_rec_id = self.pool.get('rent.order').search(,self.env.uid,[('reference','=',inv_origin)])


    Step4- Last step is to create the test.xml file in your own module and use this code shown below

    <?xml version="1.0" encoding="utf-8"?>
     <!--  Here is a rent order tree view -->   
          <record model="ir.ui.view" id="rent_order_tree_view">
                <field name="name">test.order.tree.view</field>
                <field name="model">test</field>
                <field name="type">tree</field>
                <field name="arch" type="xml">
                    <tree string="test Orders">
                        <field name="invoice_total_paid1"/>
     <record model="ir.ui.view" id="rent_order_form_view">
                <field name="name">test.order.form.view</field>
                <field name="model">test</field>
                <field name="type">form</field>
                <field name="arch" type="xml">
                    <form string="test Order">
                        <group colspan="4" col="6">
                            <field name="invoice_total_paid1"/>
     <record model="ir.actions.act_window" id="rent_action_form">
                <field name="name">test Order</field>
                <field name="res_model">test</field>
                <field name="view_type">form</field>
                <field name="view_mode">tree,form,calendar</field>
                <field name="usage">menu</field>
                <field name="search_view_id" ref="rent_order_search_view"/>
            <menuitem id="rent_order_menu" parent="base.menu_sales" groups="base.group_sale_salesman"
                      name="Tests" action="rent_action_form"/>


 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: