Odoo Help

0

Inheriting the 'Pay' receipt (Debit line and Credit line)

By
Arjun Khode
on 3/17/15, 9:01 AM 482 views

I have two buttons: Register Payment and 'Pay Investor'

In register payment, the customer pays to us.

In pay investor, we are paying to the customer. ..

This is my code for Register Payment button:

<record id="register_payment_button_action" model="ir.actions.act_window">

<field name="name">Register Payment</field>

<field name="res_model">account.voucher</field>

<field name="view_type">form</field>

<field name="view_mode">form</field>

<field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt')]</field>

<field name="context">{'type':'receipt'}</field>

<field name="view_id" ref="account_voucher.view_vendor_receipt_form"/>

<!-- <field name="view_id" ref="account_voucher.view_vendor_receipt_dialog_form"/> -->

<field name="target">new</field>

</record>

CODE for VIEW containing the button:


<record id="record_form_view" model="ir.ui.view">

<field name="name">record.form.view</field>

<field name="view_type">form</field>

<field name="model">record</field>

<field name="arch" type="xml">

<form string="Record">

<group>

<field name="investment_id"/>

<field name="investor_id" domain="[('is_investor','=',True)]"/>

<field name="start_date"/>

<!-- <field name="end_date"/> -->

<field name="roi"/>

<field name="amount"/>

<field name="returns"/>

<!-- <button name="action_compute_returns" string="Compute Returns" type="object"/> -->

<button name="%(register_payment_button_action)d" context="{'default_amount': amount,'default_partner_id': investor_id'}" string="Register Payment" type="action"/>

<button name="%(pay_investor_button_action)d" context="{'default_amount': returns,'default_partner_id': investor_id'}" string="Pay Investor" type="action"/>

</group>

</form>

</field>

</record>

This question is Part 2 of this question:

https://www.odoo.com/forum/help-1/question/inheriting-the-register-payment-menu-81856

Coming to the point..

The Register Payment button opens up a receipts entry menu which shows some entries in the 'debit' line.

For the Pay Investor button, I want to open up the same menu but I want the entries to go in 'Credit' line.

What changes would I have to make in the Register Payment Button code?

Why do not you use Supplier payment?

Zbik
on 3/17/15, 10:22 AM

Because its a module for 'investors'. An investor is a partner, but he is not a supplier or customer. He invests money. And there is no invoice for it. Just journal entries. Because money is also returned to him.

Arjun Khode
on 3/18/15, 6:27 AM

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 3/17/15, 9:01 AM
Seen: 482 times
Last updated: 3/18/15, 6:27 AM