Skip to content

Commit 6cba94d

Browse files
hbrunnMiquelRForgeFlow
authored andcommitted
fixup! fixup! [OU-ADD] account
1 parent 7df1b60 commit 6cba94d

3 files changed

Lines changed: 15 additions & 19 deletions

File tree

openupgrade_scripts/scripts/account/18.0.1.3/pre-migration.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -134,23 +134,6 @@ def adapt_account_move_sending_data(env):
134134
'{author_user_id}', sending_data::jsonb->'sp_user_id')
135135
WHERE sending_data IS NOT NULL AND sending_data::jsonb ? 'sp_user_id'""",
136136
)
137-
# mail_template_id -> mail_template:
138-
env.cr.execute(
139-
"""
140-
SELECT id, sending_data::jsonb->'mail_template_id' as mail_template_id
141-
FROM account_move
142-
WHERE sending_data IS NOT NULL AND sending_data::jsonb ? 'mail_template_id'""",
143-
)
144-
for move_id, mail_template_id in env.cr.fetchall():
145-
mail_template = env.ref(mail_template_id)
146-
openupgrade.logged_query(
147-
env.cr,
148-
f"""
149-
UPDATE account_move
150-
SET sending_data = jsonb_set(sending_data::jsonb - 'mail_template_id',
151-
'{{mail_template}}', {mail_template})
152-
WHERE id = {move_id}""",
153-
)
154137
# send_mail: True -> 'sending_methods': {"email"}:
155138
openupgrade.logged_query(
156139
env.cr,

openupgrade_scripts/scripts/account/18.0.1.3/upgrade_analysis_work.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ account / account.lock_exception / lock_date (date) : NEW
7878
account / account.lock_exception / lock_date_field (selection) : NEW required, selection_keys: ['fiscalyear_lock_date', 'purchase_lock_date', 'sale_lock_date', 'tax_lock_date']
7979
account / account.lock_exception / reason (char) : NEW
8080
account / account.lock_exception / user_id (many2one) : NEW relation: res.users, hasdefault: default
81-
# NOTHING TO DO? (new model)
81+
# NOTHING TO DO: new feature
8282

8383
account / account.move / amount_untaxed_in_currency_signed (float): NEW isfunction: function, stored
8484
# DONE: pre-migration: pre-created and filled
@@ -101,7 +101,7 @@ account / account.move / journal_group_id (many2one) : NEW re
101101
# NOTHING TO DO: store = False
102102

103103
account / account.move / made_sequence_gap (boolean) : NEW isfunction: function, stored
104-
# NOTHING TO DO?
104+
# NOTHING TO DO: will be computed by ORM
105105

106106
account / account.move / origin_payment_id (many2one) : NEW relation: account.payment
107107
account / account.move / payment_id (many2one) : DEL relation: account.payment
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
env = locals().get("env")
2+
# call sending wizard on some moves asynchronously
3+
action = (
4+
env["account.move"]
5+
.search([("move_type", "=", "out_invoice")])
6+
.action_send_and_print()
7+
)
8+
env[action["res_model"]].with_context(**action["context"]).create(
9+
{
10+
"checkbox_download": False,
11+
}
12+
).action_send_and_print()
13+
env.cr.commit()

0 commit comments

Comments
 (0)