File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
l10n_br_account_payment_order/migrations/16.0.2.0.0 Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -403,13 +403,18 @@ def migrate(env, version):
403
403
if not version :
404
404
return
405
405
406
- # Verifica se já houve migração, banco de dados migrados na v14
407
- payment_mode_migrated = env ["account.payment.mode" ].search (
408
- [
409
- ("sending_code_id" , "!=" , False ),
410
- ],
411
- limit = 1 ,
412
- )
406
+ if "sending_code_id" in env ["account.payment.mode" ]._fields :
407
+ # Caso o campo ainda exista,
408
+ # checamos se já há registros (indicando migração prévia).
409
+ payment_mode_migrated = env ["account.payment.mode" ].search (
410
+ [("sending_code_id" , "!=" , False )],
411
+ limit = 1 ,
412
+ )
413
+ else :
414
+ # Caso o campo não exista,
415
+ # assumimos que a migração já foi suficientemente avançada.
416
+ payment_mode_migrated = True
417
+
413
418
if payment_mode_migrated :
414
419
return
415
420
You can’t perform that action at this time.
0 commit comments