Can the 'SPB' printout be deleted under certain conditions?
For example, the 'SPB' printout will not appear if the stock_picking state is 'done'
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Can the 'SPB' printout be deleted under certain conditions?
For example, the 'SPB' printout will not appear if the stock_picking state is 'done'
Hi,
By using fields_view_get() function, you can hide the menu based on the condition.
class StockPicking(models.Model):
_inherit = 'stock.picking'
@api.model
def fields_view_get(self, view_id=None, view_type='form', toolbar=False,
submenu=False):
res = super(StockPicking, self).fields_view_get(
view_id=view_id, view_type=view_type, toolbar=toolbar,
submenu=submenu)
#
#
#Add your condition
#
if ((view_type in ['tree', 'form']) and
res.get('toolbar') and res['toolbar'].get('print')):
res['toolbar'].get('print', []).clear()
return res
You can hide your specific menu from the toolbar by adding the appropriate condition
Hope it helps.
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
1
mag 25
|
737 | ||
|
1
nov 24
|
18721 | ||
|
0
set 24
|
1099 | ||
|
1
giu 24
|
1441 | ||
|
1
mag 24
|
1659 |