changes
This commit is contained in:
7
fusion_plating/scripts/fp_debug_mo.py
Normal file
7
fusion_plating/scripts/fp_debug_mo.py
Normal file
@@ -0,0 +1,7 @@
|
||||
env = env # noqa
|
||||
mo49 = env['mrp.production'].browse(49)
|
||||
print('id=49:', mo49.name, 'state=', mo49.state, 'company=', mo49.company_id.id)
|
||||
mo47 = env['mrp.production'].browse(47)
|
||||
print('id=47:', mo47.name, 'state=', mo47.state, 'company=', mo47.company_id.id)
|
||||
res = env['mrp.production'].search([('state', '=', 'done')], order='id desc', limit=3)
|
||||
for m in res: print('got:', m.id, m.name, m.state)
|
||||
13
fusion_plating/scripts/fp_isolate.py
Normal file
13
fusion_plating/scripts/fp_isolate.py
Normal file
@@ -0,0 +1,13 @@
|
||||
env = env # noqa
|
||||
# Same exact query the audit uses
|
||||
print('attempt 1 (no sudo):')
|
||||
mo = env['mrp.production'].search([('state', '=', 'done')], order='id desc', limit=1)
|
||||
print(f' → {mo.name} (id {mo.id})')
|
||||
|
||||
print('attempt 2 (.sudo()):')
|
||||
mo2 = env['mrp.production'].sudo().search([('state', '=', 'done')], order='id desc', limit=1)
|
||||
print(f' → {mo2.name} (id {mo2.id})')
|
||||
|
||||
print('attempt 3 (read 5):')
|
||||
mos = env['mrp.production'].sudo().search([('state', '=', 'done')], order='id desc', limit=5)
|
||||
for m in mos: print(f' → {m.name} (id {m.id})')
|
||||
Reference in New Issue
Block a user