Skip to content

Commit

Permalink
Merge pull request #3835 from Tecnativa/13.0-ou-fix-purchase-validati…
Browse files Browse the repository at this point in the history
…on-date

[13.0][OU-FIX] purchase: set date_approve in all the confirmed orders
  • Loading branch information
pedrobaeza authored Jul 27, 2023
2 parents 6cace56 + 4b8db61 commit 26bb0f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addons/purchase/migrations/13.0.1.2/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ def move_fields_from_invoice_to_moves(env):


def change_type_purchase_order_date_approve(env):
openupgrade.logged_query(
env.cr, """
query = """
UPDATE purchase_order po
SET date_approve = mm.date
FROM mail_message mm
WHERE mm.subtype_id = %s
AND mm.model = 'purchase.order'
AND mm.res_id = po.id""",
(env.ref('purchase.mt_rfq_approved').id, ),
)
AND mm.res_id = po.id
AND date_approve IS NULL"""
openupgrade.logged_query(env.cr, query, (env.ref('purchase.mt_rfq_approved').id,))
openupgrade.logged_query(env.cr, query, (env.ref('purchase.mt_rfq_confirmed').id,))


def fill_account_move_purchase_order_rel_table(env):
Expand Down

0 comments on commit 26bb0f4

Please sign in to comment.