تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3706 أدوات العرض

I have created a button like so:

<button name="%(register_payment_button_action)d" context="{'default_amount': amount,'default_partner_id': investor_id,'default_reference':investment_id}" string="Receive Investment" col="1" type="action"/>

It opens the 'vendor receipt form' and lets you register a payment. This creates a journal entry for the payment.

My problem is that I want to show the journal entries for that particular object instance in another view driven by a different model. How can I do that ?

<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">

. . .

<field name="account_ids" colspan="4">

PY: in class 'record'

'account_ids':fields.one2many('account.move','record_id',string="Payments"),

in class account_move:

class account_move(osv.Model):

_inherit="account.move"

_columns={

'record_id':fields.many2one('record','Record'),

}

UPDATE:

When you press validate button in 'vendor receipt form', The entry gets logged in journal entries. Along with that, I want the entry to get logged in my own one2many field. So that 'field' will be a table that displays all payment transactions made through pressing my button. Likewise, different instances of object should contain their own payment transactions as a list.


الصورة الرمزية
إهمال
أفضل إجابة

Hello Arjun Khode,

The words you have used for different model, it means you want to filter them by accounts?

If you want to filter them by accounts then 

Here you go!

Create new action for account.move.line object and set default filter account,

So your all entries will be filter by specific account, so you don't need to create any new model for that.

If this is not your answer than explain your question more in more details,

Hope this will helps you.

Rgds,

Anil.





الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
نوفمبر 24
1774
5
يوليو 24
93245
1
ديسمبر 23
3154
1
مايو 22
3810
0
يناير 20
3028