콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
875 화면

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.

아바타
취소
관련 게시물 답글 화면 활동
1
5월 25
1051
1
11월 24
19263
0
9월 24
1360
1
6월 24
1700
1
5월 24
1872