Felctra Error After Update to 20200222


#1

I have had to do a “dpkg -i flectra_1.6.20200222_all.deb” to get it to move past the checksum errors. I get an error in the logs after the upgrade as follows:

2020-02-25 14:17:13,352 32658 ERROR finance flectra.sql_db: bad query: b’INSERT INTO “res_config_settings” (“id”, “order_mail_template”, “cart_recovery_mail_template”, “lock_confirmed_po”, “website_id”, “default_invoice_policy”, “multi_sales_price_method”, “sale_show_tax”, “default_picking_policy”, “default_purchase_method”, “cart_abandoned_delay”, “company_id”, “po_order_approval”, “inventory_availability”, “group_multi_company”, “group_multi_currency”, “group_multi_branch”, “group_uom”, “group_product_variant”, “group_stock_packaging”, “group_sale_pricelist”, “group_product_pricelist”, “group_pricelist_item”, “group_stock_production_lot”, “group_stock_tracking_lot”, “group_stock_tracking_owner”, “group_stock_adv_location”, “group_warning_stock”, “group_stock_multi_locations”, “group_stock_multi_warehouses”, “group_analytic_accounting”, “group_warning_account”, “group_cash_rounding”, “group_use_lead”, “group_discount_per_so_line”, “group_sale_layout”, “group_warning_sale”, “group_sale_delivery_address”, “group_show_price_subtotal”, “group_show_price_total”, “group_proforma_sales”, “group_warning_purchase”, “group_manage_vendor_price”, “group_analytic_account_for_purchases”, “group_route_so_lines”, “group_display_incoterm”, “group_website_multiimage”, “group_delivery_invoice_address”, “module_base_import”, “module_google_calendar”, “module_google_drive”, “module_google_spreadsheet”, “module_auth_oauth”, “module_auth_ldap”, “module_base_gengo”, “module_pad”, “module_voip”, “module_hr_org_chart”, “module_procurement_jit”, “module_product_expiry”, “module_stock_picking_batch”, “module_account_asset”, “module_account_budget”, “module_account_payment”, “module_account_plaid”, “module_product_margin”, “module_account_taxcloud”, “module_crm_phone_validation”, “module_sale_margin”, “module_sale_payment”, “module_website_quote”, “module_delivery”, “module_product_email_template”, “module_stock_landed_costs”, “module_purchase_requisition”, “module_stock_dropshipping”, “module_sale_order_dates”, “module_website_sale_delivery”, “module_website_sale_options”, “module_website_sale_digital”, “module_website_sale_wishlist”, “module_website_sale_comparison”, “module_website_sale_stock”, “module_account_invoicing”, “module_l10n_eu_service”, “default_external_email_server”, “default_user_rights”, “send_statistics”, “default_custom_report_footer”, “company_share_partner”, “fail_counter”, “alias_domain”, “send_limit”, “auth_signup_reset_password”, “auth_signup_uninvited”, “auth_signup_template_user_id”, “company_share_product”, “use_propagation_minimum_delta”, “has_google_analytics”, “has_google_analytics_dashboard”, “has_google_maps”, “google_maps_api_key”, “crm_alias_prefix”, “generate_lead_from_alias”, “use_sale_note”, “auto_done_setting”, “default_deposit_product_id”, “multi_sales_price”, “sale_pricelist_setting”, “portal_confirmation”, “portal_confirmation_options”, “global_discount_invoice_line”, “global_discount_invoice_apply”, “global_discount_fix_invoice_amount”, “global_discount_percentage_invoice”, “is_installed_sale”, “use_po_lead”, “use_security_lead”, “global_discount_per_so_invoice_line”, “global_discount_apply”, “global_discount_fix_amount”, “global_discount_percentage”, “automatic_invoice”, “sale_delivery_settings”, “available_threshold”, “digest_emails”, “create_uid”, “write_uid”, “create_date”, “write_date”) VALUES(nextval(‘res_config_settings_id_seq’), 11, 20, false, 1, ‘order’, ‘percentage’, ‘total’, ‘direct’, ‘receive’, 1.0, 1, false, ‘threshold’, false, true, false, false, true, false, true, true, false, true, false, false, false, false, true, false, true, false, false, true, true, false, false, true, false, true, true, false, false, true, false, false, true, true, true, false, false, false, false, false, false, false, false, false, ‘1’, false, false, true, false, false, false, true, false, false, false, true, false, true, false, true, false, false, false, true, true, false, true, true, true, true, false, true, false, true, false, true, 0, ‘finance.jumpingbean.co.za’, 10000, false, ‘b2c’, 5, true, false, true, false, true, ‘AIzaSyCpj4j7Eby02mEN-4lwVSLO23tTFWt_IaU’, NULL, false, true, false, NULL, true, ‘percentage’, false, NULL, true, true, 50000, 20, true, false, false, true, true, 50000, 20, false, ‘website’, 5.0, false, 1, 1, (now() at time zone ‘UTC’), (now() at time zone ‘UTC’)) RETURNING id’
ERROR: column “send_limit” of relation “res_config_settings” does not exist
LINE 1: …y_share_partner", “fail_counter”, “alias_domain”, "send_limi…
^

2020-02-25 14:17:13,352 32658 ERROR finance flectra.http: Exception during JSON request handling.
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/flectra/http.py”, line 653, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File “/usr/lib/python3/dist-packages/flectra/http.py”, line 312, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File “/usr/lib/python3/dist-packages/flectra/tools/pycompat.py”, line 87, in reraise
raise value
File “/usr/lib/python3/dist-packages/flectra/http.py”, line 695, in dispatch
result = self._call_function(**self.params)
File “/usr/lib/python3/dist-packages/flectra/http.py”, line 344, in _call_function
return checked_call(self.db, *args, **kwargs)
File “/usr/lib/python3/dist-packages/flectra/service/model.py”, line 97, in wrapper
return f(dbname, *args, **kwargs)
File “/usr/lib/python3/dist-packages/flectra/http.py”, line 337, in checked_call
result = self.endpoint(*a, **kw)
File “/usr/lib/python3/dist-packages/flectra/http.py”, line 939, in call
return self.method(*args, **kw)
File “/usr/lib/python3/dist-packages/flectra/http.py”, line 517, in response_wrap
response = f(*args, **kw)
File “/usr/lib/python3/dist-packages/flectra/addons/website_sale/controllers/backend.py”, line 18, in fetch_dashboard_data
results = super(WebsiteSaleBackend, self).fetch_dashboard_data(date_from, date_to, website_id)
File “/usr/lib/python3/dist-packages/flectra/http.py”, line 517, in response_wrap
response = f(*args, **kw)
File “/usr/lib/python3/dist-packages/flectra/addons/website/controllers/backend.py”, line 37, in fetch_dashboard_data
config = request.env[‘res.config.settings’].sudo().create({})
File “/usr/lib/python3/dist-packages/flectra/addons/account/models/res_config_settings.py”, line 142, in create
return super(ResConfigSettings, self).create(values)
File “/usr/lib/python3/dist-packages/flectra/models.py”, line 3394, in create
record = self.browse(self._create(old_vals))
File “/usr/lib/python3/dist-packages/flectra/models.py”, line 3487, in _create
cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
File “/usr/lib/python3/dist-packages/flectra/sql_db.py”, line 156, in wrapper
return f(self, *args, **kwargs)
File “/usr/lib/python3/dist-packages/flectra/sql_db.py”, line 233, in execute
res = self._obj.execute(query, params)
psycopg2.ProgrammingError: column “send_limit” of relation “res_config_settings” does not exist
LINE 1: …y_share_partner", “fail_counter”, “alias_domain”, "send_limi…
^

I thought the database schema would be updated automatically on update?


#2

Fix this by running

flectra --config=/etc/flectra/flectra.conf -u all -d mydb --stop-after-init