Skip to content

Commit

Permalink
Add default matching_order = 'old_first'
Browse files Browse the repository at this point in the history
  • Loading branch information
dansanti committed Sep 14, 2024
1 parent 36895bb commit e315abf
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions openupgrade_scripts/scripts/account/15.0.1.2/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ def _handle_website_legal_page(env):

def add_default_partial_account_reconcile_model(env):
openupgrade.logged_query(
env.cr,
"""
INSERT INTO account_reconcile_model (name, sequence, rule_type,
auto_reconcile, match_nature, match_same_currency, allow_payment_tolerance,
match_partner, company_id)
SELECT 'Invoices/Bills Partial Match if Underpaid', 2, 'invoice_matching',
FALSE, 'both', TRUE, FALSE, TRUE, arm.company_id
FROM (
SELECT DISTINCT company_id
FROM account_reconcile_model
WHERE rule_type = 'invoice_matching'
) AS arm
""")
env.cr,
"""
INSERT INTO account_reconcile_model (name, sequence, rule_type,
auto_reconcile, match_nature, match_same_currency, allow_payment_tolerance,
match_partner, matching_order, company_id)
SELECT 'Invoices/Bills Partial Match if Underpaid', 2, 'invoice_matching',
FALSE, 'both', TRUE, FALSE, TRUE, 'old_first', arm.company_id
FROM (
SELECT DISTINCT company_id
FROM account_reconcile_model
WHERE rule_type = 'invoice_matching'
) AS arm
""")

@openupgrade.migrate()
def migrate(env, version):
Expand Down

0 comments on commit e315abf

Please sign in to comment.