mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[MIG+FIX] acocunt_payment_order: Don't add field definition for existing related non stored ones
`state` and `partner_id` fields exist on v8, but they are not stored. We shouldn't add them as full fields, or we will have an ir_model_fields_name_model_uniq constraint error. Instead, we should add them as SQL columns. Fixes #616
This commit is contained in:
@@ -157,17 +157,19 @@ def populate_computed_fields(env):
|
||||
faster.
|
||||
"""
|
||||
cr = env.cr
|
||||
openupgrade.logged_query(
|
||||
cr, "ALTER TABLE bank_payment_line ADD partner_id int4",
|
||||
)
|
||||
openupgrade.logged_query(
|
||||
cr, "ALTER TABLE bank_payment_line ADD state varchar",
|
||||
)
|
||||
openupgrade.add_fields(env, [
|
||||
('company_currency_id', 'account.payment.order',
|
||||
'account_payment_order', 'many2one', False, 'account_payment_order'),
|
||||
('payment_type', 'account.payment.line', 'account_payment_line',
|
||||
'selection', False, 'account_payment_order'),
|
||||
('partner_id', 'bank.payment.line', 'bank_payment_line',
|
||||
'many2one', False, 'account_payment_order'),
|
||||
('payment_type', 'bank.payment.line', 'bank_payment_line',
|
||||
'selection', False, 'account_payment_order'),
|
||||
('state', 'bank.payment.line', 'bank_payment_line',
|
||||
'selection', False, 'account_payment_order'),
|
||||
('amount_company_currency', 'bank.payment.line', 'bank_payment_line',
|
||||
'monetary', False, 'account_payment_order'),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user