コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
4790 ビュー

hello everyone 


i created one module in this module i create invoice . i add smart button in form . when i select res.partner and create invoice so in this smart button i got all of invoice of this res.partner ..

but i want only this invoice which is create by this form like sale module .


anyone know how can i do this 


thank you in advance .

アバター
破棄
最善の回答

Add record id of object created from that form as well in invoice and filter out invoices with partner and record id in your smart button method

アバター
破棄

Thank you.

最善の回答

Hello  Ra_one_1_11,

Please find code in comment. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

アバター
破棄

*Add source code in your module as per below example.

def _compute_invoice_count(self)
for rec in self:
rec.invoice_count = len(rec.invoice_ids)

invoice_count = field.Integer("Invoice Count", compute="_compute_invoice_count")
invoice_ids = field.One2Many("account.move", "sale_id")

def method_name(self):
return {
"name": "Invoice",
"type": "ir.actions.act_window",
"view_mode": "tree,form",
"res_model": "account.move",
"domain": [("sale_id", "=", self.id)],
}

関連投稿 返信 ビュー 活動
1
6月 22
3108
1
5月 22
3397
1
12月 21
2705
4
3月 25
51337
1
4月 24
5104