Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2346 Zobrazení

Oi, pessoal, 

Eu quero poder clicar em um botão na minha visualização de formulário e esse botão criar outra visualização de página para essa visualização de formulário automaticamente.

Ao clicar no ícone "+", crio outra página "Produto", de forma que o usuário possa adicionar quantas páginas "Produto" desejar. 

Alguém pode me ajudar com isso? Aprecie seu tempo já!

Avatar
Zrušit
Nejlepší odpověď

Hi, there,

the following for your reference:

1. modify the .py file to add one function.

def preview_inventory(self):
return {
'name': _('Inventory Lookup'),
'domain': [('po', 'like', self.po), ('partner_id', '=', self.partner_id.id), ('company_id', '=', self.company_id.id), ('state', '=', 'done'), ('picking_type_id', '=', 7)],
'view_type': 'form',
'res_model': 'stock.picking',
'view_id': False,
'view_mode': 'tree',
'type': 'ir.actions.act_window',
'target': 'current',
'context': "{'toolbar':False,'submenu': False,'create': False,'edit': False,'delete': False}"
}

2. modify the. XML file to add one button in right place.

expr="//div/button[@name='preview_sale_order']" position="before">

Replace the element with your own.

I hope it is useful.

thanks.

Avatar
Zrušit
Autor

I can't understand what i need to change in domain field, can you explain better pls?

Related Posts Odpovědi Zobrazení Aktivita
0
čvn 16
6171
4
říj 24
4062
2
čvn 24
1732
3
čvc 23
1732
1
srp 22
4235