跳至内容
菜单
此问题已终结

Model : stock.picking


i want to add 2 new column in one2many(stock.pack.operations) after click on button that is show only partially available or available state.


i have tried.

here, i want to show accept_q and accept_deviation field or qc_reject

in XML

<field name="accept_q" invisible="context.get('accept', False)"/>
<field name="accept_deviation" invisible="context.get('accept', True)"/>
<field name="qc_reject" invisible="context.get('reject', False)"/>


.py

 @api.multi
    def qc_check_btn(self):
        con=self.env.context.copy()
        for line in self.pack_operation_product_ids:
            line.qc_check = True

                   con.update({

                                         'accept':False if line.location_dest_id.qc_location else True,
                                        'reject':True if line.location_dest_id.qc_location else False,
                     })
        return {
            'type': 'ir.actions.client',
            'tag': 'reload',
            'context': con,
        }

形象
丢弃
相关帖文 回复 查看 活动
2
10月 22
9931
2
11月 19
10943
0
8月 18
2679
1
5月 17
7643
4
11月 15
14037