0

I defined a button via "Server Actions" in this FORM VIEW: enter image description here

And created another FORM VIEW from the submenu. enter image description here

Then I'd tried to call this FORM VIEW via the button, but it's not worked.

So how to call this FORM VIEW via the button?

Please help!

Thank you!

2
  • Question: You have created action for that form view and linked to this button right but it's not working? Commented Nov 28, 2020 at 9:43
  • I define a button via server actions and created an action to call FORM VIEW but it's not working. Commented Nov 28, 2020 at 9:56

2 Answers 2

0

Try to give

"view_mode" : "form" 
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your support. But I still got the same error after using your code
0

in xml :

<record id="account_common_report_view" model="ir.ui.view"> <field name="name">Common Report</field> <field name="model">account.common.report</field> <field name="arch" type="xml"> <form string="Report Options"> <group col="4"> <header> <button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight"/> <button string="Cancel" class="btn btn-secondary" /> </header> </form> </field> </record> 

python : call every things call

def check_report(self): self.ensure_one() data = {} data['ids'] = self.env.context.get('active_ids', []) data['model'] = self.env.context.get('active_model', 'ir.ui.menu') data['form'] = self.read(['date_from', 'date_to', 'journal_ids', 'target_move', 'company_id'])[0] used_context = self._build_contexts(data) data['form']['used_context'] = dict(used_context, lang=get_lang(self.env).code) return self.with_context(discard_logo_check=True)._print_report(data) 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.