-- Name: account_payment_term_line__payment_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_payment_term_line__payment_id_index ON public.account_payment_term_line USING btree (payment_id);


--
-- Name: account_payment_unmatched_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_payment_unmatched_idx ON public.account_payment USING btree (journal_id, company_id) WHERE ((NOT is_matched) OR (is_matched IS NULL));


--
-- Name: account_peppol_rejection_acti_account_peppol_clarification__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_peppol_rejection_acti_account_peppol_clarification__idx ON public.account_peppol_rejection_action_rel USING btree (account_peppol_clarification_id, account_peppol_rejection_wizard_id);


--
-- Name: account_peppol_rejection_reas_account_peppol_clarification__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_peppol_rejection_reas_account_peppol_clarification__idx ON public.account_peppol_rejection_reason_rel USING btree (account_peppol_clarification_id, account_peppol_rejection_wizard_id);


--
-- Name: account_reconcile_model_line__account_tax_id_account_reconc_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_reconcile_model_line__account_tax_id_account_reconc_idx ON public.account_reconcile_model_line_account_tax_rel USING btree (account_tax_id, account_reconcile_model_line_id);


--
-- Name: account_reconcile_model_line_analytic_distribution_accounts_gin; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_reconcile_model_line_analytic_distribution_accounts_gin ON public.account_reconcile_model_line USING gin (regexp_split_to_array((jsonb_path_query_array(analytic_distribution, '$.keyvalue()."key"'::jsonpath))::text, '\D+'::text));


--
-- Name: account_reconcile_model_res_p_res_partner_category_id_accou_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_reconcile_model_res_p_res_partner_category_id_accou_idx ON public.account_reconcile_model_res_partner_category_rel USING btree (res_partner_category_id, account_reconcile_model_id);


--
-- Name: account_reconcile_model_res_p_res_partner_id_account_reconc_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_reconcile_model_res_p_res_partner_id_account_reconc_idx ON public.account_reconcile_model_res_partner_rel USING btree (res_partner_id, account_reconcile_model_id);


--
-- Name: account_report_section_rel_sub_report_id_main_report_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_report_section_rel_sub_report_id_main_report_id_idx ON public.account_report_section_rel USING btree (sub_report_id, main_report_id);


--
-- Name: account_tax_filiation_rel_child_tax_parent_tax_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_tax_filiation_rel_child_tax_parent_tax_idx ON public.account_tax_filiation_rel USING btree (child_tax, parent_tax);


--
-- Name: account_tax_purchase_order_li_account_tax_id_purchase_order_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_tax_purchase_order_li_account_tax_id_purchase_order_idx ON public.account_tax_purchase_order_line_rel USING btree (account_tax_id, purchase_order_line_id);


--
-- Name: account_tax_sale_order_discou_account_tax_id_sale_order_dis_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_tax_sale_order_discou_account_tax_id_sale_order_dis_idx ON public.account_tax_sale_order_discount_rel USING btree (account_tax_id, sale_order_discount_id);


--
-- Name: account_tax_sale_order_line_r_account_tax_id_sale_order_lin_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_tax_sale_order_line_r_account_tax_id_sale_order_lin_idx ON public.account_tax_sale_order_line_rel USING btree (account_tax_id, sale_order_line_id);


--
-- Name: act_window_view_unique_mode_per_action; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX act_window_view_unique_mode_per_action ON public.ir_act_window_view USING btree (act_window_id, view_mode);


--
-- Name: activity_attachment_rel_attachment_id_activity_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX activity_attachment_rel_attachment_id_activity_id_idx ON public.activity_attachment_rel USING btree (attachment_id, activity_id);


--
-- Name: auth_totp_device_user_id_index_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX auth_totp_device_user_id_index_idx ON public.auth_totp_device USING btree (user_id, index);


--
-- Name: badge_unlocked_definition_rel_gamification_goal_definition__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX badge_unlocked_definition_rel_gamification_goal_definition__idx ON public.badge_unlocked_definition_rel USING btree (gamification_goal_definition_id, gamification_badge_id);


--
-- Name: base_import_mapping__res_model_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX base_import_mapping__res_model_index ON public.base_import_mapping USING btree (res_model);


--
-- Name: base_language_install_website_website_id_base_language_inst_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX base_language_install_website_website_id_base_language_inst_idx ON public.base_language_install_website_rel USING btree (website_id, base_language_install_id);


--
-- Name: base_partner_merge_automatic__res_partner_id_base_partner_m_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX base_partner_merge_automatic__res_partner_id_base_partner_m_idx ON public.base_partner_merge_automatic_wizard_res_partner_rel USING btree (res_partner_id, base_partner_merge_automatic_wizard_id);


--
-- Name: bus_presence_guest_unique; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX bus_presence_guest_unique ON public.bus_presence USING btree (guest_id) WHERE (guest_id IS NOT NULL);


--
-- Name: bus_presence_user_unique; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX bus_presence_user_unique ON public.bus_presence USING btree (user_id) WHERE (user_id IS NOT NULL);


--
-- Name: calendar_alarm_calendar_event_calendar_alarm_id_calendar_ev_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX calendar_alarm_calendar_event_calendar_alarm_id_calendar_ev_idx ON public.calendar_alarm_calendar_event_rel USING btree (calendar_alarm_id, calendar_event_id);


--
-- Name: calendar_event__access_token_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX calendar_event__access_token_index ON public.calendar_event USING btree (access_token);


--
-- Name: calendar_event_res_partner_re_calendar_event_id_res_partner_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX calendar_event_res_partner_re_calendar_event_id_res_partner_idx ON public.calendar_event_res_partner_rel USING btree (calendar_event_id, res_partner_id);


--
-- Name: calendar_filters__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX calendar_filters__partner_id_index ON public.calendar_filters USING btree (partner_id);


--
-- Name: calendar_filters__user_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX calendar_filters__user_id_index ON public.calendar_filters USING btree (user_id);


--
-- Name: crm_team__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX crm_team__company_id_index ON public.crm_team USING btree (company_id);


--
-- Name: crm_team_member__crm_team_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX crm_team_member__crm_team_id_index ON public.crm_team_member USING btree (crm_team_id);


--
-- Name: crm_team_member__user_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX crm_team_member__user_id_index ON public.crm_team_member USING btree (user_id);


--
-- Name: digest_digest_res_users_rel_res_users_id_digest_digest_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX digest_digest_res_users_rel_res_users_id_digest_digest_id_idx ON public.digest_digest_res_users_rel USING btree (res_users_id, digest_digest_id);


--
-- Name: digest_tip_res_users_rel_res_users_id_digest_tip_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX digest_tip_res_users_rel_res_users_id_digest_tip_id_idx ON public.digest_tip_res_users_rel USING btree (res_users_id, digest_tip_id);


--
-- Name: discuss_channel__last_interest_dt_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX discuss_channel__last_interest_dt_index ON public.discuss_channel USING btree (last_interest_dt);


--
-- Name: discuss_channel__parent_channel_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX discuss_channel__parent_channel_id_index ON public.discuss_channel USING btree (parent_channel_id);


--
-- Name: discuss_channel_hr_department_hr_department_id_discuss_chan_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX discuss_channel_hr_department_hr_department_id_discuss_chan_idx ON public.discuss_channel_hr_department_rel USING btree (hr_department_id, discuss_channel_id);


--
-- Name: discuss_channel_member__fetched_message_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX discuss_channel_member__fetched_message_id_index ON public.discuss_channel_member USING btree (fetched_message_id) WHERE (fetched_message_id IS NOT NULL);


--
-- Name: discuss_channel_member__guest_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX discuss_channel_member__guest_id_index ON public.discuss_channel_member USING btree (guest_id);


--
-- Name: discuss_channel_member__last_interest_dt_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX discuss_channel_member__last_interest_dt_index ON public.discuss_channel_member USING btree (last_interest_dt);


--
-- Name: discuss_channel_member__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX discuss_channel_member__partner_id_index ON public.discuss_channel_member USING btree (partner_id);


--
-- Name: discuss_channel_member__seen_message_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX discuss_channel_member__seen_message_id_index ON public.discuss_channel_member USING btree (seen_message_id) WHERE (seen_message_id IS NOT NULL);


--
-- Name: discuss_channel_member__unpin_dt_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX discuss_channel_member__unpin_dt_index ON public.discuss_channel_member USING btree (unpin_dt);


--
-- Name: discuss_channel_member_guest_unique; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX discuss_channel_member_guest_unique ON public.discuss_channel_member USING btree (channel_id, guest_id) WHERE (guest_id IS NOT NULL);


--
-- Name: discuss_channel_member_partner_unique; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX discuss_channel_member_partner_unique ON public.discuss_channel_member USING btree (channel_id, partner_id) WHERE (partner_id IS NOT NULL);


--
-- Name: discuss_channel_member_seen_message_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX discuss_channel_member_seen_message_id_idx ON public.discuss_channel_member USING btree (channel_id, partner_id, seen_message_id);


--
-- Name: discuss_channel_res_groups_re_res_groups_id_discuss_channel_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX discuss_channel_res_groups_re_res_groups_id_discuss_channel_idx ON public.discuss_channel_res_groups_rel USING btree (res_groups_id, discuss_channel_id);


--
-- Name: discuss_channel_rtc_session__write_date_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX discuss_channel_rtc_session__write_date_index ON public.discuss_channel_rtc_session USING btree (write_date);


--
-- Name: discuss_voice_metadata__attachment_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX discuss_voice_metadata__attachment_id_index ON public.discuss_voice_metadata USING btree (attachment_id);


--
-- Name: email_template_attachment_rel_attachment_id_email_template__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX email_template_attachment_rel_attachment_id_email_template__idx ON public.email_template_attachment_rel USING btree (attachment_id, email_template_id);


--
-- Name: employee_category_rel_category_id_employee_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX employee_category_rel_category_id_employee_id_idx ON public.employee_category_rel USING btree (category_id, employee_id);


--
-- Name: fetchmail_server__server_type_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX fetchmail_server__server_type_index ON public.fetchmail_server USING btree (server_type);


--
-- Name: fetchmail_server__state_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX fetchmail_server__state_index ON public.fetchmail_server USING btree (state);


--
-- Name: gamification_badge_rule_badge_rel_badge2_id_badge1_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX gamification_badge_rule_badge_rel_badge2_id_badge1_id_idx ON public.gamification_badge_rule_badge_rel USING btree (badge2_id, badge1_id);


--
-- Name: gamification_badge_user__badge_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX gamification_badge_user__badge_id_index ON public.gamification_badge_user USING btree (badge_id);


--
-- Name: gamification_badge_user__employee_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX gamification_badge_user__employee_id_index ON public.gamification_badge_user USING btree (employee_id);


--
-- Name: gamification_badge_user__user_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX gamification_badge_user__user_id_index ON public.gamification_badge_user USING btree (user_id);


--
-- Name: gamification_challenge_users__res_users_id_gamification_cha_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX gamification_challenge_users__res_users_id_gamification_cha_idx ON public.gamification_challenge_users_rel USING btree (res_users_id, gamification_challenge_id);


--
-- Name: gamification_goal__challenge_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX gamification_goal__challenge_id_index ON public.gamification_goal USING btree (challenge_id);


--
-- Name: gamification_invited_user_ids_res_users_id_gamification_cha_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX gamification_invited_user_ids_res_users_id_gamification_cha_idx ON public.gamification_invited_user_ids_rel USING btree (res_users_id, gamification_challenge_id);


--
-- Name: gamification_karma_tracking__tracking_date_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX gamification_karma_tracking__tracking_date_index ON public.gamification_karma_tracking USING btree (tracking_date);


--
-- Name: gamification_karma_tracking__user_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX gamification_karma_tracking__user_id_index ON public.gamification_karma_tracking USING btree (user_id);


--
-- Name: header_footer_quotation_templ_sale_order_template_id_quotat_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX header_footer_quotation_templ_sale_order_template_id_quotat_idx ON public.header_footer_quotation_template_rel USING btree (sale_order_template_id, quotation_document_id);


--
-- Name: hr_department__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_department__company_id_index ON public.hr_department USING btree (company_id);


--
-- Name: hr_department__parent_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_department__parent_id_index ON public.hr_department USING btree (parent_id);


--
-- Name: hr_department__parent_path_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_department__parent_path_index ON public.hr_department USING btree (parent_path);


--
-- Name: hr_employee__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_employee__company_id_index ON public.hr_employee USING btree (company_id);


--
-- Name: hr_employee__message_main_attachment_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_employee__message_main_attachment_id_index ON public.hr_employee USING btree (message_main_attachment_id) WHERE (message_main_attachment_id IS NOT NULL);


--
-- Name: hr_employee__resource_calendar_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_employee__resource_calendar_id_index ON public.hr_employee USING btree (resource_calendar_id);


--
-- Name: hr_employee__resource_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_employee__resource_id_index ON public.hr_employee USING btree (resource_id);


--
-- Name: hr_employee_hr_employee_cv_wi_hr_employee_id_hr_employee_cv_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_employee_hr_employee_cv_wi_hr_employee_id_hr_employee_cv_idx ON public.hr_employee_hr_employee_cv_wizard_rel USING btree (hr_employee_id, hr_employee_cv_wizard_id);


--
-- Name: hr_employee_hr_skill_rel_hr_skill_id_hr_employee_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_employee_hr_skill_rel_hr_skill_id_hr_employee_id_idx ON public.hr_employee_hr_skill_rel USING btree (hr_skill_id, hr_employee_id);


--
-- Name: hr_job__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_job__name_index ON public.hr_job USING gin (((jsonb_path_query_array(name, '$.*'::jsonpath))::text) public.gin_trgm_ops);


--
-- Name: hr_resume_line__employee_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_resume_line__employee_id_index ON public.hr_resume_line USING btree (employee_id);


--
-- Name: iap_account_res_company_rel_res_company_id_iap_account_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX iap_account_res_company_rel_res_company_id_iap_account_id_idx ON public.iap_account_res_company_rel USING btree (res_company_id, iap_account_id);


--
-- Name: iap_account_res_users_rel_res_users_id_iap_account_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX iap_account_res_users_rel_res_users_id_iap_account_id_idx ON public.iap_account_res_users_rel USING btree (res_users_id, iap_account_id);


--
-- Name: ir_act_server__model_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_act_server__model_id_index ON public.ir_act_server USING btree (model_id);


--
-- Name: ir_act_server_group_rel_gid_act_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_act_server_group_rel_gid_act_id_idx ON public.ir_act_server_group_rel USING btree (gid, act_id);


--
-- Name: ir_act_server_res_partner_rel_res_partner_id_ir_act_server__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_act_server_res_partner_rel_res_partner_id_ir_act_server__idx ON public.ir_act_server_res_partner_rel USING btree (res_partner_id, ir_act_server_id);


--
-- Name: ir_act_server_webhook_field_rel_field_id_server_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_act_server_webhook_field_rel_field_id_server_id_idx ON public.ir_act_server_webhook_field_rel USING btree (field_id, server_id);


--
-- Name: ir_act_window_group_rel_gid_act_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_act_window_group_rel_gid_act_id_idx ON public.ir_act_window_group_rel USING btree (gid, act_id);


--
-- Name: ir_actions_todo__action_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_actions_todo__action_id_index ON public.ir_actions_todo USING btree (action_id);


--
-- Name: ir_attachment__original_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_attachment__original_id_index ON public.ir_attachment USING btree (original_id) WHERE (original_id IS NOT NULL);


--
-- Name: ir_attachment__store_fname_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_attachment__store_fname_index ON public.ir_attachment USING btree (store_fname);


--
-- Name: ir_attachment__url_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_attachment__url_index ON public.ir_attachment USING btree (url) WHERE (url IS NOT NULL);


--
-- Name: ir_attachment_res_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_attachment_res_idx ON public.ir_attachment USING btree (res_model, res_id);


--
-- Name: ir_cron_progress__cron_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_cron_progress__cron_id_index ON public.ir_cron_progress USING btree (cron_id);


--
-- Name: ir_cron_trigger__call_at_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_cron_trigger__call_at_index ON public.ir_cron_trigger USING btree (call_at);


--
-- Name: ir_cron_trigger__cron_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_cron_trigger__cron_id_index ON public.ir_cron_trigger USING btree (cron_id);


--
-- Name: ir_default__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_default__company_id_index ON public.ir_default USING btree (company_id);


--
-- Name: ir_default__field_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_default__field_id_index ON public.ir_default USING btree (field_id);


--
-- Name: ir_default__user_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_default__user_id_index ON public.ir_default USING btree (user_id);


--
-- Name: ir_embedded_actions_res_group_res_groups_id_ir_embedded_act_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_embedded_actions_res_group_res_groups_id_ir_embedded_act_idx ON public.ir_embedded_actions_res_groups_rel USING btree (res_groups_id, ir_embedded_actions_id);


--
-- Name: ir_exports__resource_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_exports__resource_index ON public.ir_exports USING btree (resource);


--
-- Name: ir_exports_line__export_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_exports_line__export_id_index ON public.ir_exports_line USING btree (export_id);


--
-- Name: ir_filters_name_model_uid_unique_action_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX ir_filters_name_model_uid_unique_action_index ON public.ir_filters USING btree (model_id, COALESCE(user_id, '-1'::integer), COALESCE(action_id, '-1'::integer), lower((name)::text), embedded_parent_res_id, COALESCE(embedded_action_id, '-1'::integer));


--
-- Name: ir_logging__dbname_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_logging__dbname_index ON public.ir_logging USING btree (dbname);


--
-- Name: ir_logging__level_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_logging__level_index ON public.ir_logging USING btree (level);


--
-- Name: ir_logging__type_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_logging__type_index ON public.ir_logging USING btree (type);


--
-- Name: ir_mail_server__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_mail_server__name_index ON public.ir_mail_server USING btree (name);


--
-- Name: ir_model_access__group_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_access__group_id_index ON public.ir_model_access USING btree (group_id);


--
-- Name: ir_model_access__model_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_access__model_id_index ON public.ir_model_access USING btree (model_id);


--
-- Name: ir_model_access__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_access__name_index ON public.ir_model_access USING btree (name);


--
-- Name: ir_model_constraint__model_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_constraint__model_index ON public.ir_model_constraint USING btree (model);


--
-- Name: ir_model_constraint__module_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_constraint__module_index ON public.ir_model_constraint USING btree (module);


--
-- Name: ir_model_constraint__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_constraint__name_index ON public.ir_model_constraint USING btree (name);


--
-- Name: ir_model_constraint__type_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_constraint__type_index ON public.ir_model_constraint USING btree (type);


--
-- Name: ir_model_data_model_res_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_data_model_res_id_index ON public.ir_model_data USING btree (model, res_id);


--
-- Name: ir_model_data_module_name_uniq_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX ir_model_data_module_name_uniq_index ON public.ir_model_data USING btree (module, name);


--
-- Name: ir_model_fields__complete_name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_fields__complete_name_index ON public.ir_model_fields USING btree (complete_name);


--
-- Name: ir_model_fields__model_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_fields__model_id_index ON public.ir_model_fields USING btree (model_id);


--
-- Name: ir_model_fields__model_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_fields__model_index ON public.ir_model_fields USING btree (model);


--
-- Name: ir_model_fields__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_fields__name_index ON public.ir_model_fields USING btree (name);


--
-- Name: ir_model_fields__state_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_fields__state_index ON public.ir_model_fields USING btree (state);


--
-- Name: ir_model_fields__website_form_blacklisted_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_fields__website_form_blacklisted_index ON public.ir_model_fields USING btree (website_form_blacklisted);


--
-- Name: ir_model_fields_group_rel_group_id_field_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_fields_group_rel_group_id_field_id_idx ON public.ir_model_fields_group_rel USING btree (group_id, field_id);


--
-- Name: ir_model_fields_selection__field_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_fields_selection__field_id_index ON public.ir_model_fields_selection USING btree (field_id);


--
-- Name: ir_model_relation__model_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_relation__model_index ON public.ir_model_relation USING btree (model);


--
-- Name: ir_model_relation__module_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_relation__module_index ON public.ir_model_relation USING btree (module);


--
-- Name: ir_model_relation__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_relation__name_index ON public.ir_model_relation USING btree (name);


--
-- Name: ir_model_spreadsheet_dashboar_ir_model_id_spreadsheet_dashb_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_model_spreadsheet_dashboar_ir_model_id_spreadsheet_dashb_idx ON public.ir_model_spreadsheet_dashboard_rel USING btree (ir_model_id, spreadsheet_dashboard_id);


--
-- Name: ir_module_category__parent_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_module_category__parent_id_index ON public.ir_module_category USING btree (parent_id);


--
-- Name: ir_module_module__category_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_module_module__category_id_index ON public.ir_module_module USING btree (category_id);


--
-- Name: ir_module_module__state_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_module_module__state_index ON public.ir_module_module USING btree (state);


--
-- Name: ir_module_module_dependency__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_module_module_dependency__name_index ON public.ir_module_module_dependency USING btree (name);


--
-- Name: ir_module_module_exclusion__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_module_module_exclusion__name_index ON public.ir_module_module_exclusion USING btree (name);


--
-- Name: ir_profile__session_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_profile__session_index ON public.ir_profile USING btree (session);


--
-- Name: ir_rule__model_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_rule__model_id_index ON public.ir_rule USING btree (model_id);


--
-- Name: ir_rule__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_rule__name_index ON public.ir_rule USING btree (name);


--
-- Name: ir_ui_menu__parent_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_ui_menu__parent_id_index ON public.ir_ui_menu USING btree (parent_id);


--
-- Name: ir_ui_menu__parent_path_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_ui_menu__parent_path_index ON public.ir_ui_menu USING btree (parent_path);


--
-- Name: ir_ui_menu_group_rel_gid_menu_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_ui_menu_group_rel_gid_menu_id_idx ON public.ir_ui_menu_group_rel USING btree (gid, menu_id);


--
-- Name: ir_ui_view__inherit_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_ui_view__inherit_id_index ON public.ir_ui_view USING btree (inherit_id);


--
-- Name: ir_ui_view__key_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_ui_view__key_index ON public.ir_ui_view USING btree (key) WHERE (key IS NOT NULL);


--
-- Name: ir_ui_view__model_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_ui_view__model_index ON public.ir_ui_view USING btree (model);


--
-- Name: ir_ui_view_custom__ref_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_ui_view_custom__ref_id_index ON public.ir_ui_view_custom USING btree (ref_id);


--
-- Name: ir_ui_view_custom__user_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_ui_view_custom__user_id_index ON public.ir_ui_view_custom USING btree (user_id);


--
-- Name: ir_ui_view_custom_user_id_ref_id; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_ui_view_custom_user_id_ref_id ON public.ir_ui_view_custom USING btree (user_id, ref_id);


--
-- Name: ir_ui_view_group_rel_group_id_view_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_ui_view_group_rel_group_id_view_id_idx ON public.ir_ui_view_group_rel USING btree (group_id, view_id);


--
-- Name: ir_ui_view_model_type_inherit_id; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_ui_view_model_type_inherit_id ON public.ir_ui_view USING btree (model, inherit_id);


--
-- Name: journal_account_control_rel_account_id_journal_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX journal_account_control_rel_account_id_journal_id_idx ON public.journal_account_control_rel USING btree (account_id, journal_id);


--
-- Name: l10n_es_edi_facturae_ac_role__l10n_es_edi_facturae_ac_role__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX l10n_es_edi_facturae_ac_role__l10n_es_edi_facturae_ac_role__idx ON public.l10n_es_edi_facturae_ac_role_type_res_partner_rel USING btree (l10n_es_edi_facturae_ac_role_type_id, res_partner_id);


--
-- Name: link_tracker__campaign_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX link_tracker__campaign_id_index ON public.link_tracker USING btree (campaign_id) WHERE (campaign_id IS NOT NULL);


--
-- Name: link_tracker__medium_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX link_tracker__medium_id_index ON public.link_tracker USING btree (medium_id) WHERE (medium_id IS NOT NULL);


--
-- Name: link_tracker__source_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX link_tracker__source_id_index ON public.link_tracker USING btree (source_id) WHERE (source_id IS NOT NULL);


--
-- Name: link_tracker_click__campaign_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX link_tracker_click__campaign_id_index ON public.link_tracker_click USING btree (campaign_id) WHERE (campaign_id IS NOT NULL);


--
-- Name: link_tracker_click__link_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX link_tracker_click__link_id_index ON public.link_tracker_click USING btree (link_id);


--
-- Name: lot_label_layout_stock_move_l_stock_move_line_id_lot_label__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX lot_label_layout_stock_move_l_stock_move_line_id_lot_label__idx ON public.lot_label_layout_stock_move_line_rel USING btree (stock_move_line_id, lot_label_layout_id);


--
-- Name: mail_activity__date_deadline_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_activity__date_deadline_index ON public.mail_activity USING btree (date_deadline);


--
-- Name: mail_activity__res_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_activity__res_id_index ON public.mail_activity USING btree (res_id);


--
-- Name: mail_activity__res_model_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_activity__res_model_id_index ON public.mail_activity USING btree (res_model_id);


--
-- Name: mail_activity__res_model_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_activity__res_model_index ON public.mail_activity USING btree (res_model);


--
-- Name: mail_activity__user_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_activity__user_id_index ON public.mail_activity USING btree (user_id);


--
-- Name: mail_activity_plan_mail_activ_mail_activity_plan_id_mail_ac_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_activity_plan_mail_activ_mail_activity_plan_id_mail_ac_idx ON public.mail_activity_plan_mail_activity_schedule_rel USING btree (mail_activity_plan_id, mail_activity_schedule_id);


--
-- Name: mail_activity_rel_recommended_id_activity_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_activity_rel_recommended_id_activity_id_idx ON public.mail_activity_rel USING btree (recommended_id, activity_id);


--
-- Name: mail_activity_type__create_uid_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_activity_type__create_uid_index ON public.mail_activity_type USING btree (create_uid);


--
-- Name: mail_activity_type_mail_templ_mail_template_id_mail_activit_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_activity_type_mail_templ_mail_template_id_mail_activit_idx ON public.mail_activity_type_mail_template_rel USING btree (mail_template_id, mail_activity_type_id);


--
-- Name: mail_alias__alias_full_name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_alias__alias_full_name_index ON public.mail_alias USING btree (alias_full_name) WHERE (alias_full_name IS NOT NULL);


--
-- Name: mail_alias_name_domain_unique; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX mail_alias_name_domain_unique ON public.mail_alias USING btree (alias_name, COALESCE(alias_domain_id, 0));


--
-- Name: mail_blacklist__email_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_blacklist__email_index ON public.mail_blacklist USING gin (email public.gin_trgm_ops);


--
-- Name: mail_canned_response__source_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_canned_response__source_index ON public.mail_canned_response USING gin (source public.gin_trgm_ops);


--
-- Name: mail_canned_response_res_grou_res_groups_id_mail_canned_res_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_canned_response_res_grou_res_groups_id_mail_canned_res_idx ON public.mail_canned_response_res_groups_rel USING btree (res_groups_id, mail_canned_response_id);


--
-- Name: mail_compose_message_ir_attachments_attachment_id_wizard_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_compose_message_ir_attachments_attachment_id_wizard_id_idx ON public.mail_compose_message_ir_attachments_rel USING btree (attachment_id, wizard_id);


--
-- Name: mail_compose_message_res_partner_rel_partner_id_wizard_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_compose_message_res_partner_rel_partner_id_wizard_id_idx ON public.mail_compose_message_res_partner_rel USING btree (partner_id, wizard_id);


--
-- Name: mail_followers__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_followers__partner_id_index ON public.mail_followers USING btree (partner_id);


--
-- Name: mail_followers__res_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_followers__res_id_index ON public.mail_followers USING btree (res_id);


--
-- Name: mail_followers__res_model_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_followers__res_model_index ON public.mail_followers USING btree (res_model);


--
-- Name: mail_followers_mail_message_s_mail_message_subtype_id_mail__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_followers_mail_message_s_mail_message_subtype_id_mail__idx ON public.mail_followers_mail_message_subtype_rel USING btree (mail_message_subtype_id, mail_followers_id);


--
-- Name: mail_gateway_allowed__email_normalized_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_gateway_allowed__email_normalized_index ON public.mail_gateway_allowed USING btree (email_normalized);


--
-- Name: mail_link_preview__create_date_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_link_preview__create_date_index ON public.mail_link_preview USING btree (create_date);


--
-- Name: mail_link_preview__message_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_link_preview__message_id_index ON public.mail_link_preview USING btree (message_id);


--
-- Name: mail_mail__mail_message_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_mail__mail_message_id_index ON public.mail_mail USING btree (mail_message_id);


--
-- Name: mail_mail_res_partner_rel_res_partner_id_mail_mail_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_mail_res_partner_rel_res_partner_id_mail_mail_id_idx ON public.mail_mail_res_partner_rel USING btree (res_partner_id, mail_mail_id);


--
-- Name: mail_message__author_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_message__author_id_index ON public.mail_message USING btree (author_id);


--
-- Name: mail_message__mail_activity_type_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_message__mail_activity_type_id_index ON public.mail_message USING btree (mail_activity_type_id) WHERE (mail_activity_type_id IS NOT NULL);


--
-- Name: mail_message__message_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_message__message_id_index ON public.mail_message USING btree (message_id);


--
-- Name: mail_message__parent_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_message__parent_id_index ON public.mail_message USING btree (parent_id) WHERE (parent_id IS NOT NULL);


--
-- Name: mail_message__subtype_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_message__subtype_id_index ON public.mail_message USING btree (subtype_id);


--
-- Name: mail_message_date_res_id_id_for_burndown_chart; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_message_date_res_id_id_for_burndown_chart ON public.mail_message USING btree (date, res_id, id) WHERE (((model)::text = 'project.task'::text) AND ((message_type)::text = 'notification'::text));


--
-- Name: mail_message_model_res_id_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_message_model_res_id_id_idx ON public.mail_message USING btree (model, res_id, id);


--
-- Name: mail_message_model_res_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_message_model_res_id_idx ON public.mail_message USING btree (model, res_id);


--
-- Name: mail_message_reaction_guest_unique; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX mail_message_reaction_guest_unique ON public.mail_message_reaction USING btree (message_id, content, guest_id) WHERE (guest_id IS NOT NULL);


--
-- Name: mail_message_reaction_partner_unique; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX mail_message_reaction_partner_unique ON public.mail_message_reaction USING btree (message_id, content, partner_id) WHERE (partner_id IS NOT NULL);


--
-- Name: mail_message_res_partner_rel_res_partner_id_mail_message_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_message_res_partner_rel_res_partner_id_mail_message_id_idx ON public.mail_message_res_partner_rel USING btree (res_partner_id, mail_message_id);


--
-- Name: mail_message_res_partner_star_res_partner_id_mail_message_i_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_message_res_partner_star_res_partner_id_mail_message_i_idx ON public.mail_message_res_partner_starred_rel USING btree (res_partner_id, mail_message_id);


--
-- Name: mail_message_translation__create_date_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_message_translation__create_date_index ON public.mail_message_translation USING btree (create_date);


--
-- Name: mail_message_translation_unique; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX mail_message_translation_unique ON public.mail_message_translation USING btree (message_id, target_lang);


--
-- Name: mail_notification__is_read_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_notification__is_read_index ON public.mail_notification USING btree (is_read);


--
-- Name: mail_notification__letter_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_notification__letter_id_index ON public.mail_notification USING btree (letter_id) WHERE (letter_id IS NOT NULL);


--
-- Name: mail_notification__mail_mail_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_notification__mail_mail_id_index ON public.mail_notification USING btree (mail_mail_id);


--
-- Name: mail_notification__mail_message_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_notification__mail_message_id_index ON public.mail_notification USING btree (mail_message_id);


--
-- Name: mail_notification__notification_status_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_notification__notification_status_index ON public.mail_notification USING btree (notification_status);


--
-- Name: mail_notification__notification_type_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_notification__notification_type_index ON public.mail_notification USING btree (notification_type);


--
-- Name: mail_notification__res_partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_notification__res_partner_id_index ON public.mail_notification USING btree (res_partner_id);


--
-- Name: mail_notification__sms_id_int_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_notification__sms_id_int_index ON public.mail_notification USING btree (sms_id_int) WHERE (sms_id_int IS NOT NULL);


--
-- Name: mail_notification_author_id_notification_status_failure; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_notification_author_id_notification_status_failure ON public.mail_notification USING btree (author_id, notification_status) WHERE ((notification_status)::text = ANY ((ARRAY['bounce'::character varying, 'exception'::character varying])::text[]));


--
-- Name: mail_notification_mail_resend_mail_notification_id_mail_res_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_notification_mail_resend_mail_notification_id_mail_res_idx ON public.mail_notification_mail_resend_message_rel USING btree (mail_notification_id, mail_resend_message_id);


--
-- Name: mail_notification_res_partner_id_is_read_notification_status_ma; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_notification_res_partner_id_is_read_notification_status_ma ON public.mail_notification USING btree (res_partner_id, is_read, notification_status, mail_message_id);


--
-- Name: mail_push_device__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_push_device__partner_id_index ON public.mail_push_device USING btree (partner_id);


--
-- Name: mail_scheduled_message_res_pa_res_partner_id_mail_scheduled_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_scheduled_message_res_pa_res_partner_id_mail_scheduled_idx ON public.mail_scheduled_message_res_partner_rel USING btree (res_partner_id, mail_scheduled_message_id);


--
-- Name: mail_template__model_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_template__model_index ON public.mail_template USING btree (model);


--
-- Name: mail_template_ir_actions_repo_ir_actions_report_id_mail_tem_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_template_ir_actions_repo_ir_actions_report_id_mail_tem_idx ON public.mail_template_ir_actions_report_rel USING btree (ir_actions_report_id, mail_template_id);


--
-- Name: mail_template_mail_template_r_mail_template_id_mail_templat_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_template_mail_template_r_mail_template_id_mail_templat_idx ON public.mail_template_mail_template_reset_rel USING btree (mail_template_id, mail_template_reset_id);


--
-- Name: mail_tracking_value__field_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_tracking_value__field_id_index ON public.mail_tracking_value USING btree (field_id);


--
-- Name: mail_tracking_value__mail_message_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_tracking_value__mail_message_id_index ON public.mail_tracking_value USING btree (mail_message_id);


--
-- Name: mail_tracking_value_mail_message_id_old_value_integer_task_stag; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_tracking_value_mail_message_id_old_value_integer_task_stag ON public.mail_tracking_value USING btree (mail_message_id, old_value_integer) WHERE (field_id = 8204);


--
-- Name: mail_wizard_invite_res_partne_res_partner_id_mail_wizard_in_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_wizard_invite_res_partne_res_partner_id_mail_wizard_in_idx ON public.mail_wizard_invite_res_partner_rel USING btree (res_partner_id, mail_wizard_invite_id);


--
-- Name: maintenance_request__equipment_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX maintenance_request__equipment_id_index ON public.maintenance_request USING btree (equipment_id);


--
-- Name: maintenance_team_users_rel_res_users_id_maintenance_team_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX maintenance_team_users_rel_res_users_id_maintenance_team_id_idx ON public.maintenance_team_users_rel USING btree (res_users_id, maintenance_team_id);


--
-- Name: meeting_category_rel_type_id_event_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX meeting_category_rel_type_id_event_id_idx ON public.meeting_category_rel USING btree (type_id, event_id);


--
-- Name: message_attachment_rel_attachment_id_message_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX message_attachment_rel_attachment_id_message_id_idx ON public.message_attachment_rel USING btree (attachment_id, message_id);


--
-- Name: module_country_country_id_module_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX module_country_country_id_module_id_idx ON public.module_country USING btree (country_id, module_id);


--
-- Name: onboarding_onboarding_onboard_onboarding_onboarding_step_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX onboarding_onboarding_onboard_onboarding_onboarding_step_id_idx ON public.onboarding_onboarding_onboarding_onboarding_step_rel USING btree (onboarding_onboarding_step_id, onboarding_onboarding_id);


--
-- Name: onboarding_progress_onboardin_onboarding_progress_step_id_o_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX onboarding_progress_onboardin_onboarding_progress_step_id_o_idx ON public.onboarding_progress_onboarding_progress_step_rel USING btree (onboarding_progress_step_id, onboarding_progress_id);


--
-- Name: onboarding_progress_onboarding_company_uniq; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX onboarding_progress_onboarding_company_uniq ON public.onboarding_progress USING btree (onboarding_id, COALESCE(company_id, 0));


--
-- Name: onboarding_progress_step_company_uniq; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX onboarding_progress_step_company_uniq ON public.onboarding_progress_step USING btree (step_id, COALESCE(company_id, 0));


--
-- Name: payment_capture_wizard_paymen_payment_transaction_id_paymen_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX payment_capture_wizard_paymen_payment_transaction_id_paymen_idx ON public.payment_capture_wizard_payment_transaction_rel USING btree (payment_transaction_id, payment_capture_wizard_id);


--
-- Name: payment_country_rel_country_id_payment_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX payment_country_rel_country_id_payment_id_idx ON public.payment_country_rel USING btree (country_id, payment_id);


--
-- Name: payment_currency_rel_currency_id_payment_provider_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX payment_currency_rel_currency_id_payment_provider_id_idx ON public.payment_currency_rel USING btree (currency_id, payment_provider_id);


--
-- Name: payment_method_payment_provid_payment_provider_id_payment_m_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX payment_method_payment_provid_payment_provider_id_payment_m_idx ON public.payment_method_payment_provider_rel USING btree (payment_provider_id, payment_method_id);


--
-- Name: payment_method_res_country_re_res_country_id_payment_method_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX payment_method_res_country_re_res_country_id_payment_method_idx ON public.payment_method_res_country_rel USING btree (res_country_id, payment_method_id);


--
-- Name: payment_method_res_currency_r_res_currency_id_payment_metho_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX payment_method_res_currency_r_res_currency_id_payment_metho_idx ON public.payment_method_res_currency_rel USING btree (res_currency_id, payment_method_id);


--
-- Name: payment_provider__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX payment_provider__company_id_index ON public.payment_provider USING btree (company_id);


--
-- Name: payment_token__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX payment_token__company_id_index ON public.payment_token USING btree (company_id);


--
-- Name: payment_transaction__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX payment_transaction__company_id_index ON public.payment_transaction USING btree (company_id);


--
-- Name: payment_transaction__operation_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX payment_transaction__operation_index ON public.payment_transaction USING btree (operation);


--
-- Name: payment_transaction__state_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX payment_transaction__state_index ON public.payment_transaction USING btree (state);


--
-- Name: picking_label_type_stock_pick_stock_picking_id_picking_labe_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX picking_label_type_stock_pick_stock_picking_id_picking_labe_idx ON public.picking_label_type_stock_picking_rel USING btree (stock_picking_id, picking_label_type_id);


--
-- Name: picking_type_favorite_user_rel_user_id_picking_type_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX picking_type_favorite_user_rel_user_id_picking_type_id_idx ON public.picking_type_favorite_user_rel USING btree (user_id, picking_type_id);


--
-- Name: portal_share_res_partner_rel_res_partner_id_portal_share_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX portal_share_res_partner_rel_res_partner_id_portal_share_id_idx ON public.portal_share_res_partner_rel USING btree (res_partner_id, portal_share_id);


--
-- Name: portal_wizard_res_partner_rel_res_partner_id_portal_wizard__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX portal_wizard_res_partner_rel_res_partner_id_portal_wizard__idx ON public.portal_wizard_res_partner_rel USING btree (res_partner_id, portal_wizard_id);


--
-- Name: product_attr_exclusion_value__product_template_attribute_va_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_attr_exclusion_value__product_template_attribute_va_idx ON public.product_attr_exclusion_value_ids_rel USING btree (product_template_attribute_value_id, product_template_attribute_exclusion_id);


--
-- Name: product_attribute__sequence_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_attribute__sequence_index ON public.product_attribute USING btree (sequence);


--
-- Name: product_attribute_product_tem_product_template_id_product_a_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_attribute_product_tem_product_template_id_product_a_idx ON public.product_attribute_product_template_rel USING btree (product_template_id, product_attribute_id);


--
-- Name: product_attribute_value__attribute_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_attribute_value__attribute_id_index ON public.product_attribute_value USING btree (attribute_id);


--
-- Name: product_attribute_value__sequence_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_attribute_value__sequence_index ON public.product_attribute_value USING btree (sequence);


--
-- Name: product_attribute_value_produ_product_template_attribute_li_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_attribute_value_produ_product_template_attribute_li_idx ON public.product_attribute_value_product_template_attribute_line_rel USING btree (product_template_attribute_line_id, product_attribute_value_id);


--
-- Name: product_category__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_category__name_index ON public.product_category USING gin (name public.gin_trgm_ops);


--
-- Name: product_category__parent_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_category__parent_id_index ON public.product_category USING btree (parent_id);


--
-- Name: product_category__parent_path_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_category__parent_path_index ON public.product_category USING btree (parent_path);


--
-- Name: product_category__property_account_creditor_price_diff_b430ca85; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_category__property_account_creditor_price_diff_b430ca85 ON public.product_category USING btree (((property_account_creditor_price_difference_categ IS NOT NULL))) WHERE (property_account_creditor_price_difference_categ IS NOT NULL);


--
-- Name: product_category__property_account_downpayment_categ_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_category__property_account_downpayment_categ_id_index ON public.product_category USING btree (((property_account_downpayment_categ_id IS NOT NULL))) WHERE (property_account_downpayment_categ_id IS NOT NULL);


--
-- Name: product_category__property_account_expense_categ_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_category__property_account_expense_categ_id_index ON public.product_category USING btree (((property_account_expense_categ_id IS NOT NULL))) WHERE (property_account_expense_categ_id IS NOT NULL);


--
-- Name: product_category__property_account_income_categ_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_category__property_account_income_categ_id_index ON public.product_category USING btree (((property_account_income_categ_id IS NOT NULL))) WHERE (property_account_income_categ_id IS NOT NULL);


--
-- Name: product_category__property_cost_method_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_category__property_cost_method_index ON public.product_category USING btree (((property_cost_method IS NOT NULL))) WHERE (property_cost_method IS NOT NULL);


--
-- Name: product_category__property_stock_account_input_categ_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_category__property_stock_account_input_categ_id_index ON public.product_category USING btree (((property_stock_account_input_categ_id IS NOT NULL))) WHERE (property_stock_account_input_categ_id IS NOT NULL);


--
-- Name: product_category__property_stock_account_output_categ_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_category__property_stock_account_output_categ_id_index ON public.product_category USING btree (((property_stock_account_output_categ_id IS NOT NULL))) WHERE (property_stock_account_output_categ_id IS NOT NULL);


--
-- Name: product_category__property_stock_journal_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_category__property_stock_journal_index ON public.product_category USING btree (((property_stock_journal IS NOT NULL))) WHERE (property_stock_journal IS NOT NULL);


--
-- Name: product_category__property_stock_valuation_account_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_category__property_stock_valuation_account_id_index ON public.product_category USING btree (((property_stock_valuation_account_id IS NOT NULL))) WHERE (property_stock_valuation_account_id IS NOT NULL);


--
-- Name: product_category__property_valuation_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_category__property_valuation_index ON public.product_category USING btree (((property_valuation IS NOT NULL))) WHERE (property_valuation IS NOT NULL);


--
-- Name: product_combo__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_combo__company_id_index ON public.product_combo USING btree (company_id);


--
-- Name: product_combo_product_templat_product_combo_id_product_temp_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_combo_product_templat_product_combo_id_product_temp_idx ON public.product_combo_product_template_rel USING btree (product_combo_id, product_template_id);


--
-- Name: product_document_sale_pdf_for_sale_pdf_form_field_id_produc_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_document_sale_pdf_for_sale_pdf_form_field_id_produc_idx ON public.product_document_sale_pdf_form_field_rel USING btree (sale_pdf_form_field_id, product_document_id);


--
-- Name: product_label_layout_product__product_product_id_product_la_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_label_layout_product__product_product_id_product_la_idx ON public.product_label_layout_product_product_rel USING btree (product_product_id, product_label_layout_id);


--
-- Name: product_label_layout_product__product_template_id_product_l_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_label_layout_product__product_template_id_product_l_idx ON public.product_label_layout_product_template_rel USING btree (product_template_id, product_label_layout_id);


--
-- Name: product_label_layout_stock_mo_stock_move_id_product_label_l_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_label_layout_stock_mo_stock_move_id_product_label_l_idx ON public.product_label_layout_stock_move_rel USING btree (stock_move_id, product_label_layout_id);


--
-- Name: product_optional_rel_dest_id_src_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_optional_rel_dest_id_src_id_idx ON public.product_optional_rel USING btree (dest_id, src_id);


--
-- Name: product_packaging__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_packaging__company_id_index ON public.product_packaging USING btree (company_id);


--
-- Name: product_pricelist_item__compute_price_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_pricelist_item__compute_price_index ON public.product_pricelist_item USING btree (compute_price);


--
-- Name: product_pricelist_item__pricelist_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_pricelist_item__pricelist_id_index ON public.product_pricelist_item USING btree (pricelist_id);


--
-- Name: product_product__barcode_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_product__barcode_index ON public.product_product USING btree (barcode) WHERE (barcode IS NOT NULL);


--
-- Name: product_product__combination_indices_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_product__combination_indices_index ON public.product_product USING btree (combination_indices);


--
-- Name: product_product__default_code_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_product__default_code_index ON public.product_product USING btree (default_code);


--
-- Name: product_product__product_tmpl_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_product__product_tmpl_id_index ON public.product_product USING btree (product_tmpl_id);


--
-- Name: product_product__standard_price_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_product__standard_price_index ON public.product_product USING btree (((standard_price IS NOT NULL))) WHERE (standard_price IS NOT NULL);


--
-- Name: product_product_combination_unique; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX product_product_combination_unique ON public.product_product USING btree (product_tmpl_id, combination_indices) WHERE (active IS TRUE);


--
-- Name: product_product_stock_track_c_product_product_id_stock_trac_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_product_stock_track_c_product_product_id_stock_trac_idx ON public.product_product_stock_track_confirmation_rel USING btree (product_product_id, stock_track_confirmation_id);


--
-- Name: product_supplier_taxes_rel_tax_id_prod_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_supplier_taxes_rel_tax_id_prod_id_idx ON public.product_supplier_taxes_rel USING btree (tax_id, prod_id);


--
-- Name: product_supplierinfo__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_supplierinfo__company_id_index ON public.product_supplierinfo USING btree (company_id);


--
-- Name: product_supplierinfo__product_tmpl_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_supplierinfo__product_tmpl_id_index ON public.product_supplierinfo USING btree (product_tmpl_id);


--
-- Name: product_supplierinfo_stock_re_product_supplierinfo_id_stock_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_supplierinfo_stock_re_product_supplierinfo_id_stock_idx ON public.product_supplierinfo_stock_replenishment_info_rel USING btree (product_supplierinfo_id, stock_replenishment_info_id);


--
-- Name: product_tag_product_product_r_product_tag_id_product_produc_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_tag_product_product_r_product_tag_id_product_produc_idx ON public.product_tag_product_product_rel USING btree (product_tag_id, product_product_id);


--
-- Name: product_tag_product_template__product_tag_id_product_templa_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_tag_product_template__product_tag_id_product_templa_idx ON public.product_tag_product_template_rel USING btree (product_tag_id, product_template_id);


--
-- Name: product_taxes_rel_tax_id_prod_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_taxes_rel_tax_id_prod_id_idx ON public.product_taxes_rel USING btree (tax_id, prod_id);


--
-- Name: product_template__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template__company_id_index ON public.product_template USING btree (company_id);


--
-- Name: product_template__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template__name_index ON public.product_template USING gin (((jsonb_path_query_array(name, '$.*'::jsonpath))::text) public.gin_trgm_ops);


--
-- Name: product_template__project_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template__project_id_index ON public.product_template USING btree (((project_id IS NOT NULL))) WHERE (project_id IS NOT NULL);


--
-- Name: product_template__project_template_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template__project_template_id_index ON public.product_template USING btree (((project_template_id IS NOT NULL))) WHERE (project_template_id IS NOT NULL);


--
-- Name: product_template__property_account_creditor_price_diff_d7bf2ae9; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template__property_account_creditor_price_diff_d7bf2ae9 ON public.product_template USING btree (((property_account_creditor_price_difference IS NOT NULL))) WHERE (property_account_creditor_price_difference IS NOT NULL);


--
-- Name: product_template__property_account_expense_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template__property_account_expense_id_index ON public.product_template USING btree (((property_account_expense_id IS NOT NULL))) WHERE (property_account_expense_id IS NOT NULL);


--
-- Name: product_template__property_account_income_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template__property_account_income_id_index ON public.product_template USING btree (((property_account_income_id IS NOT NULL))) WHERE (property_account_income_id IS NOT NULL);


--
-- Name: product_template__property_stock_inventory_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template__property_stock_inventory_index ON public.product_template USING btree (((property_stock_inventory IS NOT NULL))) WHERE (property_stock_inventory IS NOT NULL);


--
-- Name: product_template__property_stock_production_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template__property_stock_production_index ON public.product_template USING btree (((property_stock_production IS NOT NULL))) WHERE (property_stock_production IS NOT NULL);


--
-- Name: product_template__responsible_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template__responsible_id_index ON public.product_template USING btree (((responsible_id IS NOT NULL))) WHERE (responsible_id IS NOT NULL);


--
-- Name: product_template__service_to_purchase_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template__service_to_purchase_index ON public.product_template USING btree (((service_to_purchase IS NOT NULL))) WHERE (service_to_purchase IS NOT NULL);


--
-- Name: product_template_attribute_exclusion__product_template_5b2f8938; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template_attribute_exclusion__product_template_5b2f8938 ON public.product_template_attribute_exclusion USING btree (product_template_attribute_value_id);


--
-- Name: product_template_attribute_exclusion__product_tmpl_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template_attribute_exclusion__product_tmpl_id_index ON public.product_template_attribute_exclusion USING btree (product_tmpl_id);


--
-- Name: product_template_attribute_line__attribute_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template_attribute_line__attribute_id_index ON public.product_template_attribute_line USING btree (attribute_id);


--
-- Name: product_template_attribute_line__product_tmpl_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template_attribute_line__product_tmpl_id_index ON public.product_template_attribute_line USING btree (product_tmpl_id);


--
-- Name: product_template_attribute_va_product_template_attribute_v_idx1; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template_attribute_va_product_template_attribute_v_idx1 ON public.product_template_attribute_value_purchase_order_line_rel USING btree (product_template_attribute_value_id, purchase_order_line_id);


--
-- Name: product_template_attribute_va_product_template_attribute_va_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template_attribute_va_product_template_attribute_va_idx ON public.product_template_attribute_value_sale_order_line_rel USING btree (product_template_attribute_value_id, sale_order_line_id);


--
-- Name: product_template_attribute_value__attribute_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template_attribute_value__attribute_id_index ON public.product_template_attribute_value USING btree (attribute_id);


--
-- Name: product_template_attribute_value__attribute_line_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template_attribute_value__attribute_line_id_index ON public.product_template_attribute_value USING btree (attribute_line_id);


--
-- Name: product_template_attribute_value__product_attribute_va_63041d9e; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template_attribute_value__product_attribute_va_63041d9e ON public.product_template_attribute_value USING btree (product_attribute_value_id);


--
-- Name: product_template_attribute_value__product_tmpl_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template_attribute_value__product_tmpl_id_index ON public.product_template_attribute_value USING btree (product_tmpl_id);


--
-- Name: product_variant_combination_product_template_attribute_valu_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_variant_combination_product_template_attribute_valu_idx ON public.product_variant_combination USING btree (product_template_attribute_value_id, product_product_id);


--
-- Name: project_favorite_user_rel_user_id_project_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_favorite_user_rel_user_id_project_id_idx ON public.project_favorite_user_rel USING btree (user_id, project_id);


--
-- Name: project_project__account_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_project__account_id_index ON public.project_project USING btree (account_id);


--
-- Name: project_project__date_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_project__date_index ON public.project_project USING btree (date);


--
-- Name: project_project__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_project__name_index ON public.project_project USING gin (((jsonb_path_query_array(name, '$.*'::jsonpath))::text) public.gin_trgm_ops);


--
-- Name: project_project__reinvoiced_sale_order_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_project__reinvoiced_sale_order_id_index ON public.project_project USING btree (reinvoiced_sale_order_id) WHERE (reinvoiced_sale_order_id IS NOT NULL);


--
-- Name: project_project__sale_line_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_project__sale_line_id_index ON public.project_project USING btree (sale_line_id) WHERE (sale_line_id IS NOT NULL);


--
-- Name: project_project__stage_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_project__stage_id_index ON public.project_project USING btree (stage_id);


--
-- Name: project_project_project_tags__project_tags_id_project_proje_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_project_project_tags__project_tags_id_project_proje_idx ON public.project_project_project_tags_rel USING btree (project_tags_id, project_project_id);


--
-- Name: project_project_project_task__project_project_id_project_ta_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_project_project_task__project_project_id_project_ta_idx ON public.project_project_project_task_type_delete_wizard_rel USING btree (project_project_id, project_task_type_delete_wizard_id);


--
-- Name: project_project_stage_project_project_project_stage_id_proj_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_project_stage_project_project_project_stage_id_proj_idx ON public.project_project_stage_project_project_stage_delete_wizard_rel USING btree (project_project_stage_id, project_project_stage_delete_wizard_id);


--
-- Name: project_share_wizard_res_part_res_partner_id_project_share__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_share_wizard_res_part_res_partner_id_project_share__idx ON public.project_share_wizard_res_partner_rel USING btree (res_partner_id, project_share_wizard_id);


--
-- Name: project_tags_project_task_rel_project_tags_id_project_task__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_tags_project_task_rel_project_tags_id_project_task__idx ON public.project_tags_project_task_rel USING btree (project_tags_id, project_task_id);


--
-- Name: project_task__create_date_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task__create_date_index ON public.project_task USING btree (create_date);


--
-- Name: project_task__date_deadline_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task__date_deadline_index ON public.project_task USING btree (date_deadline);


--
-- Name: project_task__date_end_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task__date_end_index ON public.project_task USING btree (date_end);


--
-- Name: project_task__date_last_stage_update_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task__date_last_stage_update_index ON public.project_task USING btree (date_last_stage_update);


--
-- Name: project_task__milestone_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task__milestone_id_index ON public.project_task USING btree (milestone_id) WHERE (milestone_id IS NOT NULL);


--
-- Name: project_task__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task__name_index ON public.project_task USING gin (name public.gin_trgm_ops);


--
-- Name: project_task__parent_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task__parent_id_index ON public.project_task USING btree (parent_id);


--
-- Name: project_task__priority_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task__priority_index ON public.project_task USING btree (priority);


--
-- Name: project_task__project_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task__project_id_index ON public.project_task USING btree (project_id);


--
-- Name: project_task__sale_line_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task__sale_line_id_index ON public.project_task USING btree (sale_line_id) WHERE (sale_line_id IS NOT NULL);


--
-- Name: project_task__stage_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task__stage_id_index ON public.project_task USING btree (stage_id);


--
-- Name: project_task__state_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task__state_index ON public.project_task USING btree (state);


--
-- Name: project_task_type__user_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task_type__user_id_index ON public.project_task_type USING btree (user_id);


--
-- Name: project_task_type_project_tas_project_task_type_id_project__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task_type_project_tas_project_task_type_id_project__idx ON public.project_task_type_project_task_type_delete_wizard_rel USING btree (project_task_type_id, project_task_type_delete_wizard_id);


--
-- Name: project_task_type_rel_type_id_project_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task_type_rel_type_id_project_id_idx ON public.project_task_type_rel USING btree (type_id, project_id);


--
-- Name: project_task_user_rel__task_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task_user_rel__task_id_index ON public.project_task_user_rel USING btree (task_id);


--
-- Name: project_task_user_rel__user_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task_user_rel__user_id_index ON public.project_task_user_rel USING btree (user_id);


--
-- Name: purchase_order__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order__company_id_index ON public.purchase_order USING btree (company_id);


--
-- Name: purchase_order__date_approve_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order__date_approve_index ON public.purchase_order USING btree (date_approve);


--
-- Name: purchase_order__date_order_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order__date_order_index ON public.purchase_order USING btree (date_order);


--
-- Name: purchase_order__date_planned_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order__date_planned_index ON public.purchase_order USING btree (date_planned);


--
-- Name: purchase_order__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order__name_index ON public.purchase_order USING gin (name public.gin_trgm_ops);


--
-- Name: purchase_order__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order__partner_id_index ON public.purchase_order USING btree (partner_id);


--
-- Name: purchase_order__priority_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order__priority_index ON public.purchase_order USING btree (priority);


--
-- Name: purchase_order__state_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order__state_index ON public.purchase_order USING btree (state);


--
-- Name: purchase_order__user_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order__user_id_index ON public.purchase_order USING btree (user_id);


--
-- Name: purchase_order_line__date_planned_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order_line__date_planned_index ON public.purchase_order_line USING btree (date_planned);


--
-- Name: purchase_order_line__order_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order_line__order_id_index ON public.purchase_order_line USING btree (order_id);


--
-- Name: purchase_order_line__orderpoint_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order_line__orderpoint_id_index ON public.purchase_order_line USING btree (orderpoint_id) WHERE (orderpoint_id IS NOT NULL);


--
-- Name: purchase_order_line__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order_line__partner_id_index ON public.purchase_order_line USING btree (partner_id) WHERE (partner_id IS NOT NULL);


--
-- Name: purchase_order_line__product_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order_line__product_id_index ON public.purchase_order_line USING btree (product_id) WHERE (product_id IS NOT NULL);


--
-- Name: purchase_order_line__sale_line_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order_line__sale_line_id_index ON public.purchase_order_line USING btree (sale_line_id) WHERE (sale_line_id IS NOT NULL);


--
-- Name: purchase_order_line_analytic_distribution_accounts_gin_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order_line_analytic_distribution_accounts_gin_index ON public.purchase_order_line USING gin (regexp_split_to_array((jsonb_path_query_array(analytic_distribution, '$.keyvalue()."key"'::jsonpath))::text, '\D+'::text));


--
-- Name: purchase_order_stock_picking__stock_picking_id_purchase_ord_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order_stock_picking__stock_picking_id_purchase_ord_idx ON public.purchase_order_stock_picking_rel USING btree (stock_picking_id, purchase_order_id);


--
-- Name: quotation_document_sale_order_quotation_document_id_sale_or_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX quotation_document_sale_order_quotation_document_id_sale_or_idx ON public.quotation_document_sale_order_rel USING btree (quotation_document_id, sale_order_id);


--
-- Name: quotation_document_sale_pdf_f_sale_pdf_form_field_id_quotat_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX quotation_document_sale_pdf_f_sale_pdf_form_field_id_quotat_idx ON public.quotation_document_sale_pdf_form_field_rel USING btree (sale_pdf_form_field_id, quotation_document_id);


--
-- Name: rating_rating__message_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX rating_rating__message_id_index ON public.rating_rating USING btree (message_id);


--
-- Name: rating_rating__parent_res_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX rating_rating__parent_res_id_index ON public.rating_rating USING btree (parent_res_id);


--
-- Name: rating_rating__parent_res_model_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX rating_rating__parent_res_model_id_index ON public.rating_rating USING btree (parent_res_model_id);


--
-- Name: rating_rating__parent_res_model_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX rating_rating__parent_res_model_index ON public.rating_rating USING btree (parent_res_model);


--
-- Name: rating_rating__publisher_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX rating_rating__publisher_id_index ON public.rating_rating USING btree (publisher_id) WHERE (publisher_id IS NOT NULL);


--
-- Name: rating_rating__res_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX rating_rating__res_id_index ON public.rating_rating USING btree (res_id);


--
-- Name: rating_rating__res_model_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX rating_rating__res_model_id_index ON public.rating_rating USING btree (res_model_id);


--
-- Name: rating_rating__res_model_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX rating_rating__res_model_index ON public.rating_rating USING btree (res_model);


--
-- Name: rel_badge_auth_users_res_users_id_gamification_badge_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX rel_badge_auth_users_res_users_id_gamification_badge_id_idx ON public.rel_badge_auth_users USING btree (res_users_id, gamification_badge_id);


--
-- Name: rel_modules_langexport_module_id_wiz_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX rel_modules_langexport_module_id_wiz_id_idx ON public.rel_modules_langexport USING btree (module_id, wiz_id);


--
-- Name: rel_server_actions_action_id_server_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX rel_server_actions_action_id_server_id_idx ON public.rel_server_actions USING btree (action_id, server_id);


--
-- Name: repair_order__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX repair_order__company_id_index ON public.repair_order USING btree (company_id);


--
-- Name: repair_order__location_dest_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX repair_order__location_dest_id_index ON public.repair_order USING btree (location_dest_id);


--
-- Name: repair_order__location_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX repair_order__location_id_index ON public.repair_order USING btree (location_id);


--
-- Name: repair_order__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX repair_order__name_index ON public.repair_order USING gin (name public.gin_trgm_ops);


--
-- Name: repair_order__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX repair_order__partner_id_index ON public.repair_order USING btree (partner_id);


--
-- Name: repair_order__parts_location_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX repair_order__parts_location_id_index ON public.repair_order USING btree (parts_location_id);


--
-- Name: repair_order__picking_type_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX repair_order__picking_type_id_index ON public.repair_order USING btree (picking_type_id);


--
-- Name: repair_order__product_location_dest_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX repair_order__product_location_dest_id_index ON public.repair_order USING btree (product_location_dest_id);


--
-- Name: repair_order__product_location_src_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX repair_order__product_location_src_id_index ON public.repair_order USING btree (product_location_src_id);


--
-- Name: repair_order__recycle_location_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX repair_order__recycle_location_id_index ON public.repair_order USING btree (recycle_location_id);


--
-- Name: repair_order__schedule_date_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX repair_order__schedule_date_index ON public.repair_order USING btree (schedule_date);


--
-- Name: repair_order__state_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX repair_order__state_index ON public.repair_order USING btree (state);


--
-- Name: repair_order_repair_tags_rel_repair_tags_id_repair_order_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX repair_order_repair_tags_rel_repair_tags_id_repair_order_id_idx ON public.repair_order_repair_tags_rel USING btree (repair_tags_id, repair_order_id);


--
-- Name: res_bank__bic_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_bank__bic_index ON public.res_bank USING btree (bic);


--
-- Name: res_company__parent_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_company__parent_id_index ON public.res_company USING btree (parent_id);


--
-- Name: res_company__parent_path_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_company__parent_path_index ON public.res_company USING btree (parent_path);


--
-- Name: res_company_users_rel_user_id_cid_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_company_users_rel_user_id_cid_idx ON public.res_company_users_rel USING btree (user_id, cid);


--
-- Name: res_country_group_pricelist_r_res_country_group_id_pricelis_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_country_group_pricelist_r_res_country_group_id_pricelis_idx ON public.res_country_group_pricelist_rel USING btree (res_country_group_id, pricelist_id);


--
-- Name: res_country_res_country_group_res_country_group_id_res_coun_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_country_res_country_group_res_country_group_id_res_coun_idx ON public.res_country_res_country_group_rel USING btree (res_country_group_id, res_country_id);


--
-- Name: res_currency_rate__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_currency_rate__name_index ON public.res_currency_rate USING btree (name);


--
-- Name: res_device_log__composite_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_device_log__composite_idx ON public.res_device_log USING btree (user_id, session_identifier, platform, browser, last_activity, id) WHERE (revoked = false);


--
-- Name: res_device_log__last_activity_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_device_log__last_activity_index ON public.res_device_log USING btree (last_activity);


--
-- Name: res_device_log__session_identifier_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_device_log__session_identifier_index ON public.res_device_log USING btree (session_identifier);


--
-- Name: res_device_log__user_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_device_log__user_id_index ON public.res_device_log USING btree (user_id);


--
-- Name: res_groups__category_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_groups__category_id_index ON public.res_groups USING btree (category_id);


--
-- Name: res_groups_implied_rel_hid_gid_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_groups_implied_rel_hid_gid_idx ON public.res_groups_implied_rel USING btree (hid, gid);


--
-- Name: res_groups_report_rel_gid_uid_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_groups_report_rel_gid_uid_idx ON public.res_groups_report_rel USING btree (gid, uid);


--
-- Name: res_groups_spreadsheet_dashbo_res_groups_id_spreadsheet_das_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_groups_spreadsheet_dashbo_res_groups_id_spreadsheet_das_idx ON public.res_groups_spreadsheet_dashboard_rel USING btree (res_groups_id, spreadsheet_dashboard_id);


--
-- Name: res_groups_users_rel_uid_gid_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_groups_users_rel_uid_gid_idx ON public.res_groups_users_rel USING btree (uid, gid);


--
-- Name: res_groups_website_menu_rel_res_groups_id_website_menu_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_groups_website_menu_rel_res_groups_id_website_menu_id_idx ON public.res_groups_website_menu_rel USING btree (res_groups_id, website_menu_id);


--
-- Name: res_lang_install_rel_lang_id_language_wizard_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_lang_install_rel_lang_id_language_wizard_id_idx ON public.res_lang_install_rel USING btree (lang_id, language_wizard_id);


--
-- Name: res_partner__barcode_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__barcode_index ON public.res_partner USING btree (((barcode IS NOT NULL))) WHERE (barcode IS NOT NULL);


--
-- Name: res_partner__commercial_partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__commercial_partner_id_index ON public.res_partner USING btree (commercial_partner_id);


--
-- Name: res_partner__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__company_id_index ON public.res_partner USING btree (company_id);


--
-- Name: res_partner__company_registry_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__company_registry_index ON public.res_partner USING btree (company_registry) WHERE (company_registry IS NOT NULL);


--
-- Name: res_partner__complete_name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__complete_name_index ON public.res_partner USING btree (complete_name);


--
-- Name: res_partner__credit_limit_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__credit_limit_index ON public.res_partner USING btree (((credit_limit IS NOT NULL))) WHERE (credit_limit IS NOT NULL);


--
-- Name: res_partner__ignore_abnormal_invoice_amount_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__ignore_abnormal_invoice_amount_index ON public.res_partner USING btree (((ignore_abnormal_invoice_amount IS NOT NULL))) WHERE (ignore_abnormal_invoice_amount IS NOT NULL);


--
-- Name: res_partner__ignore_abnormal_invoice_date_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__ignore_abnormal_invoice_date_index ON public.res_partner USING btree (((ignore_abnormal_invoice_date IS NOT NULL))) WHERE (ignore_abnormal_invoice_date IS NOT NULL);


--
-- Name: res_partner__invoice_edi_format_store_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__invoice_edi_format_store_index ON public.res_partner USING btree (((invoice_edi_format_store IS NOT NULL))) WHERE (invoice_edi_format_store IS NOT NULL);


--
-- Name: res_partner__invoice_sending_method_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__invoice_sending_method_index ON public.res_partner USING btree (((invoice_sending_method IS NOT NULL))) WHERE (invoice_sending_method IS NOT NULL);


--
-- Name: res_partner__is_published_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__is_published_index ON public.res_partner USING btree (is_published);


--
-- Name: res_partner__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__name_index ON public.res_partner USING btree (name);


--
-- Name: res_partner__parent_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__parent_id_index ON public.res_partner USING btree (parent_id);


--
-- Name: res_partner__peppol_verification_state_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__peppol_verification_state_index ON public.res_partner USING btree (((peppol_verification_state IS NOT NULL))) WHERE (peppol_verification_state IS NOT NULL);


--
-- Name: res_partner__property_account_payable_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__property_account_payable_id_index ON public.res_partner USING btree (((property_account_payable_id IS NOT NULL))) WHERE (property_account_payable_id IS NOT NULL);


--
-- Name: res_partner__property_account_position_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__property_account_position_id_index ON public.res_partner USING btree (((property_account_position_id IS NOT NULL))) WHERE (property_account_position_id IS NOT NULL);


--
-- Name: res_partner__property_account_receivable_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__property_account_receivable_id_index ON public.res_partner USING btree (((property_account_receivable_id IS NOT NULL))) WHERE (property_account_receivable_id IS NOT NULL);


--
-- Name: res_partner__property_inbound_payment_method_line_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__property_inbound_payment_method_line_id_index ON public.res_partner USING btree (((property_inbound_payment_method_line_id IS NOT NULL))) WHERE (property_inbound_payment_method_line_id IS NOT NULL);


--
-- Name: res_partner__property_outbound_payment_method_line_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__property_outbound_payment_method_line_id_index ON public.res_partner USING btree (((property_outbound_payment_method_line_id IS NOT NULL))) WHERE (property_outbound_payment_method_line_id IS NOT NULL);


--
-- Name: res_partner__property_payment_term_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__property_payment_term_id_index ON public.res_partner USING btree (((property_payment_term_id IS NOT NULL))) WHERE (property_payment_term_id IS NOT NULL);


--
-- Name: res_partner__property_purchase_currency_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__property_purchase_currency_id_index ON public.res_partner USING btree (((property_purchase_currency_id IS NOT NULL))) WHERE (property_purchase_currency_id IS NOT NULL);


--
-- Name: res_partner__property_stock_customer_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__property_stock_customer_index ON public.res_partner USING btree (((property_stock_customer IS NOT NULL))) WHERE (property_stock_customer IS NOT NULL);


--
-- Name: res_partner__property_stock_supplier_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__property_stock_supplier_index ON public.res_partner USING btree (((property_stock_supplier IS NOT NULL))) WHERE (property_stock_supplier IS NOT NULL);


--
-- Name: res_partner__property_supplier_payment_term_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__property_supplier_payment_term_id_index ON public.res_partner USING btree (((property_supplier_payment_term_id IS NOT NULL))) WHERE (property_supplier_payment_term_id IS NOT NULL);


--
-- Name: res_partner__receipt_reminder_email_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__receipt_reminder_email_index ON public.res_partner USING btree (((receipt_reminder_email IS NOT NULL))) WHERE (receipt_reminder_email IS NOT NULL);


--
-- Name: res_partner__ref_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__ref_index ON public.res_partner USING btree (ref);


--
-- Name: res_partner__reminder_date_before_receipt_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__reminder_date_before_receipt_index ON public.res_partner USING btree (((reminder_date_before_receipt IS NOT NULL))) WHERE (reminder_date_before_receipt IS NOT NULL);


--
-- Name: res_partner__specific_property_product_pricelist_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__specific_property_product_pricelist_index ON public.res_partner USING btree (((specific_property_product_pricelist IS NOT NULL))) WHERE (specific_property_product_pricelist IS NOT NULL);


--
-- Name: res_partner__trust_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__trust_index ON public.res_partner USING btree (((trust IS NOT NULL))) WHERE (trust IS NOT NULL);


--
-- Name: res_partner__vat_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__vat_index ON public.res_partner USING btree (vat);


--
-- Name: res_partner__website_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner__website_id_index ON public.res_partner USING btree (website_id);


--
-- Name: res_partner_bank__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner_bank__partner_id_index ON public.res_partner_bank USING btree (partner_id);


--
-- Name: res_partner_category__parent_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner_category__parent_id_index ON public.res_partner_category USING btree (parent_id);


--
-- Name: res_partner_category__parent_path_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner_category__parent_path_index ON public.res_partner_category USING btree (parent_path);


--
-- Name: res_partner_mobile_partial_gin_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner_mobile_partial_gin_idx ON public.res_partner USING gin (regexp_replace((mobile)::text, '[\s\\./\(\)\-]'::text, ''::text, 'g'::text) public.gin_trgm_ops) WHERE (mobile IS NOT NULL);


--
-- Name: res_partner_mobile_partial_tgm; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner_mobile_partial_tgm ON public.res_partner USING btree (regexp_replace((mobile)::text, '[\s\\./\(\)\-]'::text, ''::text, 'g'::text)) WHERE (mobile IS NOT NULL);


--
-- Name: res_partner_phone_partial_gin_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner_phone_partial_gin_idx ON public.res_partner USING gin (regexp_replace((phone)::text, '[\s\\./\(\)\-]'::text, ''::text, 'g'::text) public.gin_trgm_ops) WHERE (phone IS NOT NULL);


--
-- Name: res_partner_phone_partial_tgm; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner_phone_partial_tgm ON public.res_partner USING btree (regexp_replace((phone)::text, '[\s\\./\(\)\-]'::text, ''::text, 'g'::text)) WHERE (phone IS NOT NULL);


--
-- Name: res_partner_res_partner_category_rel_partner_id_category_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner_res_partner_category_rel_partner_id_category_id_idx ON public.res_partner_res_partner_category_rel USING btree (partner_id, category_id);


--
-- Name: res_users__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_users__partner_id_index ON public.res_users USING btree (partner_id);


--
-- Name: res_users__property_warehouse_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_users__property_warehouse_id_index ON public.res_users USING btree (((property_warehouse_id IS NOT NULL))) WHERE (property_warehouse_id IS NOT NULL);


--
-- Name: res_users_apikeys_user_id_index_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_users_apikeys_user_id_index_idx ON public.res_users_apikeys USING btree (user_id, index);


--
-- Name: res_users_settings__mute_until_dt_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_users_settings__mute_until_dt_index ON public.res_users_settings USING btree (mute_until_dt);


--
-- Name: res_users_settings_volumes__guest_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_users_settings_volumes__guest_id_index ON public.res_users_settings_volumes USING btree (guest_id);


--
-- Name: res_users_settings_volumes__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_users_settings_volumes__partner_id_index ON public.res_users_settings_volumes USING btree (partner_id);


--
-- Name: res_users_settings_volumes__user_setting_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_users_settings_volumes__user_setting_id_index ON public.res_users_settings_volumes USING btree (user_setting_id);


--
-- Name: res_users_settings_volumes_guest_unique; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX res_users_settings_volumes_guest_unique ON public.res_users_settings_volumes USING btree (user_setting_id, guest_id) WHERE (guest_id IS NOT NULL);


--
-- Name: res_users_settings_volumes_partner_unique; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX res_users_settings_volumes_partner_unique ON public.res_users_settings_volumes USING btree (user_setting_id, partner_id) WHERE (partner_id IS NOT NULL);


--
-- Name: res_users_web_tour_tour_rel_res_users_id_web_tour_tour_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_users_web_tour_tour_rel_res_users_id_web_tour_tour_id_idx ON public.res_users_web_tour_tour_rel USING btree (res_users_id, web_tour_tour_id);


--
-- Name: resource_calendar_attendance__dayofweek_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX resource_calendar_attendance__dayofweek_index ON public.resource_calendar_attendance USING btree (dayofweek);


--
-- Name: resource_calendar_attendance__hour_from_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX resource_calendar_attendance__hour_from_index ON public.resource_calendar_attendance USING btree (hour_from);


--
-- Name: resource_calendar_leaves__calendar_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX resource_calendar_leaves__calendar_id_index ON public.resource_calendar_leaves USING btree (calendar_id);


--
-- Name: resource_calendar_leaves__resource_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX resource_calendar_leaves__resource_id_index ON public.resource_calendar_leaves USING btree (resource_id);


--
-- Name: rule_group_rel_group_id_rule_group_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX rule_group_rel_group_id_rule_group_id_idx ON public.rule_group_rel USING btree (group_id, rule_group_id);


--
-- Name: sale_advance_payment_inv_sale_sale_order_id_sale_advance_pa_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_advance_payment_inv_sale_sale_order_id_sale_advance_pa_idx ON public.sale_advance_payment_inv_sale_order_rel USING btree (sale_order_id, sale_advance_payment_inv_id);


--
-- Name: sale_order__campaign_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order__campaign_id_index ON public.sale_order USING btree (campaign_id) WHERE (campaign_id IS NOT NULL);


--
-- Name: sale_order__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order__company_id_index ON public.sale_order USING btree (company_id);


--
-- Name: sale_order__create_date_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order__create_date_index ON public.sale_order USING btree (create_date);


--
-- Name: sale_order__medium_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order__medium_id_index ON public.sale_order USING btree (medium_id) WHERE (medium_id IS NOT NULL);


--
-- Name: sale_order__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order__name_index ON public.sale_order USING gin (name public.gin_trgm_ops);


--
-- Name: sale_order__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order__partner_id_index ON public.sale_order USING btree (partner_id);


--
-- Name: sale_order__partner_invoice_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order__partner_invoice_id_index ON public.sale_order USING btree (partner_invoice_id) WHERE (partner_invoice_id IS NOT NULL);


--
-- Name: sale_order__partner_shipping_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order__partner_shipping_id_index ON public.sale_order USING btree (partner_shipping_id) WHERE (partner_shipping_id IS NOT NULL);


--
-- Name: sale_order__project_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order__project_id_index ON public.sale_order USING btree (project_id) WHERE (project_id IS NOT NULL);


--
-- Name: sale_order__source_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order__source_id_index ON public.sale_order USING btree (source_id) WHERE (source_id IS NOT NULL);


--
-- Name: sale_order__state_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order__state_index ON public.sale_order USING btree (state);


--
-- Name: sale_order__team_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order__team_id_index ON public.sale_order USING btree (team_id);


--
-- Name: sale_order__user_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order__user_id_index ON public.sale_order USING btree (user_id);


--
-- Name: sale_order_cancel__author_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_cancel__author_id_index ON public.sale_order_cancel USING btree (author_id);


--
-- Name: sale_order_date_order_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_date_order_id_idx ON public.sale_order USING btree (date_order DESC, id DESC);


--
-- Name: sale_order_line__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_line__company_id_index ON public.sale_order_line USING btree (company_id);


--
-- Name: sale_order_line__linked_line_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_line__linked_line_id_index ON public.sale_order_line USING btree (linked_line_id);


--
-- Name: sale_order_line__order_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_line__order_id_index ON public.sale_order_line USING btree (order_id);


--
-- Name: sale_order_line__order_partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_line__order_partner_id_index ON public.sale_order_line USING btree (order_partner_id);


--
-- Name: sale_order_line__product_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_line__product_id_index ON public.sale_order_line USING btree (product_id) WHERE (product_id IS NOT NULL);


--
-- Name: sale_order_line__project_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_line__project_id_index ON public.sale_order_line USING btree (project_id);


--
-- Name: sale_order_line__task_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_line__task_id_index ON public.sale_order_line USING btree (task_id);


--
-- Name: sale_order_line_analytic_distribution_accounts_gin_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_line_analytic_distribution_accounts_gin_index ON public.sale_order_line USING gin (regexp_split_to_array((jsonb_path_query_array(analytic_distribution, '$.keyvalue()."key"'::jsonpath))::text, '\D+'::text));


--
-- Name: sale_order_line_invoice_rel_order_line_id_invoice_line_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_line_invoice_rel_order_line_id_invoice_line_id_idx ON public.sale_order_line_invoice_rel USING btree (order_line_id, invoice_line_id);


--
-- Name: sale_order_line_name_search_services_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_line_name_search_services_index ON public.sale_order_line USING btree (order_id DESC, sequence, id) WHERE (is_service = true);


--
-- Name: sale_order_line_product_docum_product_document_id_sale_orde_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_line_product_docum_product_document_id_sale_orde_idx ON public.sale_order_line_product_document_rel USING btree (product_document_id, sale_order_line_id);


--
-- Name: sale_order_mass_cancel_wizard_sale_order_id_sale_mass_cance_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_mass_cancel_wizard_sale_order_id_sale_mass_cance_idx ON public.sale_order_mass_cancel_wizard_rel USING btree (sale_order_id, sale_mass_cancel_orders_id);


--
-- Name: sale_order_option__order_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_option__order_id_index ON public.sale_order_option USING btree (order_id);


--
-- Name: sale_order_tag_rel_tag_id_order_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_tag_rel_tag_id_order_id_idx ON public.sale_order_tag_rel USING btree (tag_id, order_id);


--
-- Name: sale_order_template__journal_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_template__journal_id_index ON public.sale_order_template USING btree (((journal_id IS NOT NULL))) WHERE (journal_id IS NOT NULL);


--
-- Name: sale_order_template_line__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_template_line__company_id_index ON public.sale_order_template_line USING btree (company_id);


--
-- Name: sale_order_template_line__sale_order_template_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_template_line__sale_order_template_id_index ON public.sale_order_template_line USING btree (sale_order_template_id);


--
-- Name: sale_order_template_option__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_template_option__company_id_index ON public.sale_order_template_option USING btree (company_id);


--
-- Name: sale_order_template_option__sale_order_template_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_template_option__sale_order_template_id_index ON public.sale_order_template_option USING btree (sale_order_template_id);


--
-- Name: sale_order_transaction_rel_sale_order_id_transaction_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_transaction_rel_sale_order_id_transaction_id_idx ON public.sale_order_transaction_rel USING btree (sale_order_id, transaction_id);


--
-- Name: scheduled_message_attachment__attachment_id_scheduled_messa_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX scheduled_message_attachment__attachment_id_scheduled_messa_idx ON public.scheduled_message_attachment_rel USING btree (attachment_id, scheduled_message_id);


--
-- Name: sms_sms__mail_message_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sms_sms__mail_message_id_index ON public.sms_sms USING btree (mail_message_id);


--
-- Name: sms_template__model_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sms_template__model_index ON public.sms_template USING btree (model);


--
-- Name: sms_template_sms_template_res_sms_template_id_sms_template__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sms_template_sms_template_res_sms_template_id_sms_template__idx ON public.sms_template_sms_template_reset_rel USING btree (sms_template_id, sms_template_reset_id);


--
-- Name: snailmail_letter__attachment_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX snailmail_letter__attachment_id_index ON public.snailmail_letter USING btree (attachment_id) WHERE (attachment_id IS NOT NULL);


--
-- Name: snailmail_letter__message_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX snailmail_letter__message_id_index ON public.snailmail_letter USING btree (message_id) WHERE (message_id IS NOT NULL);


--
-- Name: stock_conflict_quant_rel_stock_quant_id_stock_inventory_con_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_conflict_quant_rel_stock_quant_id_stock_inventory_con_idx ON public.stock_conflict_quant_rel USING btree (stock_quant_id, stock_inventory_conflict_id);


--
-- Name: stock_inventory_adjustment_na_stock_quant_id_stock_inventor_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_inventory_adjustment_na_stock_quant_id_stock_inventor_idx ON public.stock_inventory_adjustment_name_stock_quant_rel USING btree (stock_quant_id, stock_inventory_adjustment_name_id);


--
-- Name: stock_inventory_conflict_stoc_stock_quant_id_stock_inventor_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_inventory_conflict_stoc_stock_quant_id_stock_inventor_idx ON public.stock_inventory_conflict_stock_quant_rel USING btree (stock_quant_id, stock_inventory_conflict_id);


--
-- Name: stock_inventory_warning_stock_stock_quant_id_stock_inventor_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_inventory_warning_stock_stock_quant_id_stock_inventor_idx ON public.stock_inventory_warning_stock_quant_rel USING btree (stock_quant_id, stock_inventory_warning_id);


--
-- Name: stock_location__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_location__company_id_index ON public.stock_location USING btree (company_id);


--
-- Name: stock_location__location_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_location__location_id_index ON public.stock_location USING btree (location_id);


--
-- Name: stock_location__parent_path_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_location__parent_path_index ON public.stock_location USING btree (parent_path);


--
-- Name: stock_location__usage_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_location__usage_index ON public.stock_location USING btree (usage);


--
-- Name: stock_lot__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_lot__company_id_index ON public.stock_lot USING btree (company_id);


--
-- Name: stock_lot__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_lot__name_index ON public.stock_lot USING gin (name public.gin_trgm_ops);


--
-- Name: stock_lot__product_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_lot__product_id_index ON public.stock_lot USING btree (product_id);


--
-- Name: stock_lot__standard_price_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_lot__standard_price_index ON public.stock_lot USING btree (((standard_price IS NOT NULL))) WHERE (standard_price IS NOT NULL);


--
-- Name: stock_move__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__company_id_index ON public.stock_move USING btree (company_id);


--
-- Name: stock_move__date_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__date_index ON public.stock_move USING btree (date);


--
-- Name: stock_move__group_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__group_id_index ON public.stock_move USING btree (group_id);


--
-- Name: stock_move__location_dest_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__location_dest_id_index ON public.stock_move USING btree (location_dest_id);


--
-- Name: stock_move__location_final_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__location_final_id_index ON public.stock_move USING btree (location_final_id);


--
-- Name: stock_move__location_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__location_id_index ON public.stock_move USING btree (location_id);


--
-- Name: stock_move__orderpoint_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__orderpoint_id_index ON public.stock_move USING btree (orderpoint_id);


--
-- Name: stock_move__origin_returned_move_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__origin_returned_move_id_index ON public.stock_move USING btree (origin_returned_move_id);


--
-- Name: stock_move__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__partner_id_index ON public.stock_move USING btree (partner_id) WHERE (partner_id IS NOT NULL);


--
-- Name: stock_move__picking_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__picking_id_index ON public.stock_move USING btree (picking_id);


--
-- Name: stock_move__product_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__product_id_index ON public.stock_move USING btree (product_id);


--
-- Name: stock_move__purchase_line_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__purchase_line_id_index ON public.stock_move USING btree (purchase_line_id) WHERE (purchase_line_id IS NOT NULL);


--
-- Name: stock_move__repair_line_type_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__repair_line_type_index ON public.stock_move USING btree (repair_line_type);


--
-- Name: stock_move__restrict_partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__restrict_partner_id_index ON public.stock_move USING btree (restrict_partner_id) WHERE (restrict_partner_id IS NOT NULL);


--
-- Name: stock_move__sale_line_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__sale_line_id_index ON public.stock_move USING btree (sale_line_id) WHERE (sale_line_id IS NOT NULL);


--
-- Name: stock_move__state_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move__state_index ON public.stock_move USING btree (state);


--
-- Name: stock_move_created_purchase_l_move_id_created_purchase_line_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move_created_purchase_l_move_id_created_purchase_line_idx ON public.stock_move_created_purchase_line_rel USING btree (move_id, created_purchase_line_id);


--
-- Name: stock_move_line__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move_line__company_id_index ON public.stock_move_line USING btree (company_id);


--
-- Name: stock_move_line__lot_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move_line__lot_id_index ON public.stock_move_line USING btree (lot_id);


--
-- Name: stock_move_line__move_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move_line__move_id_index ON public.stock_move_line USING btree (move_id);


--
-- Name: stock_move_line__owner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move_line__owner_id_index ON public.stock_move_line USING btree (owner_id) WHERE (owner_id IS NOT NULL);


--
-- Name: stock_move_line__picking_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move_line__picking_id_index ON public.stock_move_line USING btree (picking_id);


--
-- Name: stock_move_line__product_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move_line__product_id_index ON public.stock_move_line USING btree (product_id);


--
-- Name: stock_move_line_consume_rel_produce_line_id_consume_line_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move_line_consume_rel_produce_line_id_consume_line_id_idx ON public.stock_move_line_consume_rel USING btree (produce_line_id, consume_line_id);


--
-- Name: stock_move_line_free_reservation_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move_line_free_reservation_index ON public.stock_move_line USING btree (id, company_id, product_id, lot_id, location_id, owner_id, package_id) WHERE (((state IS NULL) OR ((state)::text <> ALL ((ARRAY['cancel'::character varying, 'done'::character varying])::text[]))) AND (quantity_product_uom > (0)::numeric) AND (NOT picked));


--
-- Name: stock_move_move_rel_move_dest_id_move_orig_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move_move_rel_move_dest_id_move_orig_id_idx ON public.stock_move_move_rel USING btree (move_dest_id, move_orig_id);


--
-- Name: stock_move_product_location_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move_product_location_index ON public.stock_move USING btree (product_id, location_id, location_dest_id, company_id, state);


--
-- Name: stock_orderpoint_snooze_stock_stock_warehouse_orderpoint_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_orderpoint_snooze_stock_stock_warehouse_orderpoint_id_idx ON public.stock_orderpoint_snooze_stock_warehouse_orderpoint_rel USING btree (stock_warehouse_orderpoint_id, stock_orderpoint_snooze_id);


--
-- Name: stock_package_level__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_package_level__company_id_index ON public.stock_package_level USING btree (company_id);


--
-- Name: stock_package_type__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_package_type__company_id_index ON public.stock_package_type USING btree (company_id);


--
-- Name: stock_package_type_stock_puta_stock_package_type_id_stock_p_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_package_type_stock_puta_stock_package_type_id_stock_p_idx ON public.stock_package_type_stock_putaway_rule_rel USING btree (stock_package_type_id, stock_putaway_rule_id);


--
-- Name: stock_picking__backorder_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking__backorder_id_index ON public.stock_picking USING btree (backorder_id) WHERE (backorder_id IS NOT NULL);


--
-- Name: stock_picking__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking__company_id_index ON public.stock_picking USING btree (company_id);


--
-- Name: stock_picking__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking__name_index ON public.stock_picking USING gin (name public.gin_trgm_ops);


--
-- Name: stock_picking__origin_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking__origin_index ON public.stock_picking USING gin (origin public.gin_trgm_ops);


--
-- Name: stock_picking__owner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking__owner_id_index ON public.stock_picking USING btree (owner_id) WHERE (owner_id IS NOT NULL);


--
-- Name: stock_picking__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking__partner_id_index ON public.stock_picking USING btree (partner_id) WHERE (partner_id IS NOT NULL);


--
-- Name: stock_picking__picking_type_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking__picking_type_id_index ON public.stock_picking USING btree (picking_type_id);


--
-- Name: stock_picking__return_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking__return_id_index ON public.stock_picking USING btree (return_id) WHERE (return_id IS NOT NULL);


--
-- Name: stock_picking__sale_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking__sale_id_index ON public.stock_picking USING btree (sale_id) WHERE (sale_id IS NOT NULL);


--
-- Name: stock_picking__scheduled_date_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking__scheduled_date_index ON public.stock_picking USING btree (scheduled_date);


--
-- Name: stock_picking__state_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking__state_index ON public.stock_picking USING btree (state);


--
-- Name: stock_picking_backorder_rel_stock_picking_id_stock_backorde_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking_backorder_rel_stock_picking_id_stock_backorde_idx ON public.stock_picking_backorder_rel USING btree (stock_picking_id, stock_backorder_confirmation_id);


--
-- Name: stock_picking_sms_rel_stock_picking_id_confirm_stock_sms_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking_sms_rel_stock_picking_id_confirm_stock_sms_id_idx ON public.stock_picking_sms_rel USING btree (stock_picking_id, confirm_stock_sms_id);


--
-- Name: stock_picking_type__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking_type__company_id_index ON public.stock_picking_type USING btree (company_id);


--
-- Name: stock_putaway_rule__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_putaway_rule__company_id_index ON public.stock_putaway_rule USING btree (company_id);


--
-- Name: stock_putaway_rule__location_in_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_putaway_rule__location_in_id_index ON public.stock_putaway_rule USING btree (location_in_id);


--
-- Name: stock_quant__location_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_quant__location_id_index ON public.stock_quant USING btree (location_id);


--
-- Name: stock_quant__lot_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_quant__lot_id_index ON public.stock_quant USING btree (lot_id);


--
-- Name: stock_quant__owner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_quant__owner_id_index ON public.stock_quant USING btree (owner_id) WHERE (owner_id IS NOT NULL);


--
-- Name: stock_quant__package_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_quant__package_id_index ON public.stock_quant USING btree (package_id);


--
-- Name: stock_quant__product_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_quant__product_id_index ON public.stock_quant USING btree (product_id);


--
-- Name: stock_quant_package__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_quant_package__company_id_index ON public.stock_quant_package USING btree (company_id);


--
-- Name: stock_quant_package__location_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_quant_package__location_id_index ON public.stock_quant_package USING btree (location_id);


--
-- Name: stock_quant_package__name_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_quant_package__name_index ON public.stock_quant_package USING gin (name public.gin_trgm_ops);


--
-- Name: stock_quant_package__package_type_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_quant_package__package_type_id_index ON public.stock_quant_package USING btree (package_type_id);


--
-- Name: stock_quant_stock_quant_reloc_stock_quant_id_stock_quant_re_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_quant_stock_quant_reloc_stock_quant_id_stock_quant_re_idx ON public.stock_quant_stock_quant_relocate_rel USING btree (stock_quant_id, stock_quant_relocate_id);


--
-- Name: stock_quant_stock_request_cou_stock_quant_id_stock_request__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_quant_stock_request_cou_stock_quant_id_stock_request__idx ON public.stock_quant_stock_request_count_rel USING btree (stock_quant_id, stock_request_count_id);


--
-- Name: stock_quant_stock_track_confi_stock_quant_id_stock_track_co_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_quant_stock_track_confi_stock_quant_id_stock_track_co_idx ON public.stock_quant_stock_track_confirmation_rel USING btree (stock_quant_id, stock_track_confirmation_id);


--
-- Name: stock_route__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_route__company_id_index ON public.stock_route USING btree (company_id);


--
-- Name: stock_route_categ_categ_id_route_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_route_categ_categ_id_route_id_idx ON public.stock_route_categ USING btree (categ_id, route_id);


--
-- Name: stock_route_move_route_id_move_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_route_move_route_id_move_id_idx ON public.stock_route_move USING btree (route_id, move_id);


--
-- Name: stock_route_packaging_packaging_id_route_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_route_packaging_packaging_id_route_id_idx ON public.stock_route_packaging USING btree (packaging_id, route_id);


--
-- Name: stock_route_product_product_id_route_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_route_product_product_id_route_id_idx ON public.stock_route_product USING btree (product_id, route_id);


--
-- Name: stock_route_stock_rules_repor_stock_route_id_stock_rules_re_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_route_stock_rules_repor_stock_route_id_stock_rules_re_idx ON public.stock_route_stock_rules_report_rel USING btree (stock_route_id, stock_rules_report_id);


--
-- Name: stock_route_warehouse_warehouse_id_route_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_route_warehouse_warehouse_id_route_id_idx ON public.stock_route_warehouse USING btree (warehouse_id, route_id);


--
-- Name: stock_rule__action_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_rule__action_index ON public.stock_rule USING btree (action);


--
-- Name: stock_rule__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_rule__company_id_index ON public.stock_rule USING btree (company_id);


--
-- Name: stock_rule__location_dest_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_rule__location_dest_id_index ON public.stock_rule USING btree (location_dest_id);


--
-- Name: stock_rule__location_src_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_rule__location_src_id_index ON public.stock_rule USING btree (location_src_id);


--
-- Name: stock_rule__route_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_rule__route_id_index ON public.stock_rule USING btree (route_id);


--
-- Name: stock_rule__warehouse_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_rule__warehouse_id_index ON public.stock_rule USING btree (warehouse_id);


--
-- Name: stock_rules_report_stock_ware_stock_warehouse_id_stock_rule_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_rules_report_stock_ware_stock_warehouse_id_stock_rule_idx ON public.stock_rules_report_stock_warehouse_rel USING btree (stock_warehouse_id, stock_rules_report_id);


--
-- Name: stock_scrap_stock_scrap_reaso_stock_scrap_reason_tag_id_sto_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_scrap_stock_scrap_reaso_stock_scrap_reason_tag_id_sto_idx ON public.stock_scrap_stock_scrap_reason_tag_rel USING btree (stock_scrap_reason_tag_id, stock_scrap_id);


--
-- Name: stock_storage_category_capacity__storage_category_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_storage_category_capacity__storage_category_id_index ON public.stock_storage_category_capacity USING btree (storage_category_id);


--
-- Name: stock_valuation_company_product_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_company_product_index ON public.stock_valuation_layer USING btree (product_id, company_id, id, value, quantity);


--
-- Name: stock_valuation_layer__account_move_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer__account_move_id_index ON public.stock_valuation_layer USING btree (account_move_id) WHERE (account_move_id IS NOT NULL);


--
-- Name: stock_valuation_layer__account_move_line_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer__account_move_line_id_index ON public.stock_valuation_layer USING btree (account_move_line_id) WHERE (account_move_line_id IS NOT NULL);


--
-- Name: stock_valuation_layer__lot_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer__lot_id_index ON public.stock_valuation_layer USING btree (lot_id);


--
-- Name: stock_valuation_layer__stock_move_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer__stock_move_id_index ON public.stock_valuation_layer USING btree (stock_move_id);


--
-- Name: stock_valuation_layer__stock_valuation_layer_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer__stock_valuation_layer_id_index ON public.stock_valuation_layer USING btree (stock_valuation_layer_id);


--
-- Name: stock_valuation_layer_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer_index ON public.stock_valuation_layer USING btree (product_id, remaining_qty, stock_move_id, company_id, create_date);


--
-- Name: stock_valuation_layer_stock_v_stock_valuation_layer_id_stoc_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_valuation_layer_stock_v_stock_valuation_layer_id_stoc_idx ON public.stock_valuation_layer_stock_valuation_layer_revaluation_rel USING btree (stock_valuation_layer_id, stock_valuation_layer_revaluation_id);


--
-- Name: stock_warehouse_orderpoint__company_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_warehouse_orderpoint__company_id_index ON public.stock_warehouse_orderpoint USING btree (company_id);


--
-- Name: stock_warehouse_orderpoint__location_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_warehouse_orderpoint__location_id_index ON public.stock_warehouse_orderpoint USING btree (location_id);


--
-- Name: stock_wh_resupply_table_supplier_wh_id_supplied_wh_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_wh_resupply_table_supplier_wh_id_supplied_wh_id_idx ON public.stock_wh_resupply_table USING btree (supplier_wh_id, supplied_wh_id);


--
-- Name: task_dependencies_rel_depends_on_id_task_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX task_dependencies_rel_depends_on_id_task_id_idx ON public.task_dependencies_rel USING btree (depends_on_id, task_id);


--
-- Name: team_favorite_user_rel_user_id_team_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX team_favorite_user_rel_user_id_team_id_idx ON public.team_favorite_user_rel USING btree (user_id, team_id);


--
-- Name: template_attribute_value_stoc_template_attribute_value_id_m_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX template_attribute_value_stoc_template_attribute_value_id_m_idx ON public.template_attribute_value_stock_move_rel USING btree (template_attribute_value_id, move_id);


--
-- Name: theme_website_menu__parent_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX theme_website_menu__parent_id_index ON public.theme_website_menu USING btree (parent_id);


--
-- Name: unique_mail_message_id_res_partner_id_if_set; Type: INDEX; Schema: public; Owner: odoo
--

CREATE UNIQUE INDEX unique_mail_message_id_res_partner_id_if_set ON public.mail_notification USING btree (mail_message_id, res_partner_id) WHERE (res_partner_id IS NOT NULL);


--
-- Name: utm_tag_rel_campaign_id_tag_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX utm_tag_rel_campaign_id_tag_id_idx ON public.utm_tag_rel USING btree (campaign_id, tag_id);


--
-- Name: website_controller_page__is_published_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_controller_page__is_published_index ON public.website_controller_page USING btree (is_published);


--
-- Name: website_controller_page__website_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_controller_page__website_id_index ON public.website_controller_page USING btree (website_id);


--
-- Name: website_lang_rel_lang_id_website_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_lang_rel_lang_id_website_id_idx ON public.website_lang_rel USING btree (lang_id, website_id);


--
-- Name: website_menu__parent_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_menu__parent_id_index ON public.website_menu USING btree (parent_id);


--
-- Name: website_menu__parent_path_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_menu__parent_path_index ON public.website_menu USING btree (parent_path);


--
-- Name: website_page__is_published_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_page__is_published_index ON public.website_page USING btree (is_published);


--
-- Name: website_page__website_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_page__website_id_index ON public.website_page USING btree (website_id);


--
-- Name: website_rewrite__url_from_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_rewrite__url_from_index ON public.website_rewrite USING btree (url_from);


--
-- Name: website_rewrite__website_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_rewrite__website_id_index ON public.website_rewrite USING btree (website_id);


--
-- Name: website_snippet_filter__is_published_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_snippet_filter__is_published_index ON public.website_snippet_filter USING btree (is_published);


--
-- Name: website_snippet_filter__website_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_snippet_filter__website_id_index ON public.website_snippet_filter USING btree (website_id);


--
-- Name: website_track__page_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_track__page_id_index ON public.website_track USING btree (page_id);


--
-- Name: website_track__url_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_track__url_index ON public.website_track USING btree (url);


--
-- Name: website_track__visitor_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_track__visitor_id_index ON public.website_track USING btree (visitor_id);


--
-- Name: website_visitor__partner_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_visitor__partner_id_index ON public.website_visitor USING btree (partner_id) WHERE (partner_id IS NOT NULL);


--
-- Name: report_project_task_user _RETURN; Type: RULE; Schema: public; Owner: odoo
--

CREATE OR REPLACE VIEW public.report_project_task_user AS
 SELECT ( SELECT 1) AS nbr,
    t.id,
    t.id AS task_id,
    t.active,
    t.create_date,
    t.date_assign,
    t.date_end,
    t.date_last_stage_update,
    t.date_deadline,
    t.project_id,
    t.priority,
    t.name,
    t.company_id,
    t.partner_id,
    t.parent_id,
    t.stage_id,
    t.state,
    t.milestone_id,
        CASE
            WHEN ((t.state)::text = ANY ((ARRAY['1_done'::character varying, '1_canceled'::character varying])::text[])) THEN true
            ELSE false
        END AS is_closed,
        CASE
            WHEN (pm.id IS NOT NULL) THEN true
            ELSE false
        END AS has_late_and_unreached_milestone,
    t.description,
    NULLIF(t.rating_last_value, (0)::double precision) AS rating_last_value,
    avg(rt.rating) AS rating_avg,
    NULLIF(t.working_days_close, (0)::double precision) AS working_days_close,
    NULLIF(t.working_days_open, (0)::double precision) AS working_days_open,
    NULLIF(t.working_hours_open, (0)::numeric) AS working_hours_open,
    NULLIF(t.working_hours_close, (0)::numeric) AS working_hours_close,
    (EXTRACT(epoch FROM (t.date_deadline - (now() AT TIME ZONE 'UTC'::text))) / ((3600 * 24))::numeric) AS delay_endings_days,
    count(td.task_id) AS dependent_ids_count,
    t.sale_line_id,
    t.sale_order_id
   FROM (((public.project_task t
     LEFT JOIN public.rating_rating rt ON (((rt.res_id = t.id) AND ((rt.res_model)::text = 'project.task'::text) AND (rt.consumed = true) AND (rt.rating >= (1)::double precision))))
     LEFT JOIN public.project_milestone pm ON (((pm.id = t.milestone_id) AND (pm.is_reached = false) AND (pm.deadline <= (now())::date))))
     LEFT JOIN public.task_dependencies_rel td ON ((td.depends_on_id = t.id)))
  WHERE (t.project_id IS NOT NULL)
  GROUP BY t.id, t.active, t.create_date, t.date_assign, t.date_end, t.date_last_stage_update, t.date_deadline, t.project_id, t.priority, t.name, t.company_id, t.partner_id, t.parent_id, t.stage_id, t.state, t.rating_last_value, t.working_days_close, t.working_days_open, t.working_hours_open, t.working_hours_close, t.milestone_id, pm.id, td.depends_on_id, t.sale_line_id, t.sale_order_id;


--
-- Name: vendor_delay_report _RETURN; Type: RULE; Schema: public; Owner: odoo
--

CREATE OR REPLACE VIEW public.vendor_delay_report AS
 SELECT pol.id,
    min(m.date) AS date,
    pol.id AS purchase_line_id,
    pol.product_id,
    min(pc.id) AS category_id,
    pol.partner_id,
    pol.product_uom_qty AS qty_total,
    sum(
        CASE
            WHEN (((m.state)::text = 'done'::text) AND ((pol.date_planned)::date >= (m.date)::date)) THEN ((ml.quantity / ml_uom.factor) * pt_uom.factor)
            ELSE (0)::numeric
        END) AS qty_on_time
   FROM (((((((public.stock_move m
     JOIN public.purchase_order_line pol ON ((pol.id = m.purchase_line_id)))
     JOIN public.product_product p ON ((p.id = m.product_id)))
     JOIN public.product_template pt ON ((pt.id = p.product_tmpl_id)))
     JOIN public.uom_uom pt_uom ON ((pt_uom.id = pt.uom_id)))
     JOIN public.product_category pc ON ((pc.id = pt.categ_id)))
     LEFT JOIN public.stock_move_line ml ON ((ml.move_id = m.id)))
     LEFT JOIN public.uom_uom ml_uom ON ((ml_uom.id = ml.product_uom_id)))
  GROUP BY pol.id;


--
-- Name: account_account_account_journal_rel account_account_account_journal_rel_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_journal_rel
    ADD CONSTRAINT account_account_account_journal_rel_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_account_journal_rel account_account_account_journal_rel_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_journal_rel
    ADD CONSTRAINT account_account_account_journal_rel_account_journal_id_fkey FOREIGN KEY (account_journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_account_account_merge_wizard_rel account_account_account_merge_wiza_account_merge_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_merge_wizard_rel
    ADD CONSTRAINT account_account_account_merge_wiza_account_merge_wizard_id_fkey FOREIGN KEY (account_merge_wizard_id) REFERENCES public.account_merge_wizard(id) ON DELETE CASCADE;


--
-- Name: account_account_account_merge_wizard_rel account_account_account_merge_wizard_re_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_merge_wizard_rel
    ADD CONSTRAINT account_account_account_merge_wizard_re_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_account_tag account_account_account_tag_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_tag
    ADD CONSTRAINT account_account_account_tag_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_account_tag account_account_account_tag_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_tag
    ADD CONSTRAINT account_account_account_tag_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE RESTRICT;


--
-- Name: account_account account_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account
    ADD CONSTRAINT account_account_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_account account_account_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account
    ADD CONSTRAINT account_account_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_account_res_company_rel account_account_res_company_rel_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_res_company_rel
    ADD CONSTRAINT account_account_res_company_rel_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_res_company_rel account_account_res_company_rel_res_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_res_company_rel
    ADD CONSTRAINT account_account_res_company_rel_res_company_id_fkey FOREIGN KEY (res_company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_account_tag_account_move_line_rel account_account_tag_account_move_li_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_account_move_line_rel
    ADD CONSTRAINT account_account_tag_account_move_li_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE RESTRICT;


--
-- Name: account_account_tag_account_move_line_rel account_account_tag_account_move_line_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_account_move_line_rel
    ADD CONSTRAINT account_account_tag_account_move_line_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_account_tag_account_tax_repartition_line_rel account_account_tag_account_t_account_tax_repartition_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_account_tax_repartition_line_rel
    ADD CONSTRAINT account_account_tag_account_t_account_tax_repartition_line_fkey FOREIGN KEY (account_tax_repartition_line_id) REFERENCES public.account_tax_repartition_line(id) ON DELETE CASCADE;


--
-- Name: account_account_tag_account_tax_repartition_line_rel account_account_tag_account_tax_rep_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_account_tax_repartition_line_rel
    ADD CONSTRAINT account_account_tag_account_tax_rep_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE RESTRICT;


--
-- Name: account_account_tag account_account_tag_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag
    ADD CONSTRAINT account_account_tag_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: account_account_tag account_account_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag
    ADD CONSTRAINT account_account_tag_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_account_tag_product_template_rel account_account_tag_product_templat_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_product_template_rel
    ADD CONSTRAINT account_account_tag_product_templat_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE CASCADE;


--
-- Name: account_account_tag_product_template_rel account_account_tag_product_template_r_product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_product_template_rel
    ADD CONSTRAINT account_account_tag_product_template_r_product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: account_account_tag account_account_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag
    ADD CONSTRAINT account_account_tag_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_account_tax_default_rel account_account_tax_default_rel_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tax_default_rel
    ADD CONSTRAINT account_account_tax_default_rel_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_tax_default_rel account_account_tax_default_rel_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tax_default_rel
    ADD CONSTRAINT account_account_tax_default_rel_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_account account_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account
    ADD CONSTRAINT account_account_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_accrued_orders_wizard
    ADD CONSTRAINT account_accrued_orders_wizard_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_accrued_orders_wizard
    ADD CONSTRAINT account_accrued_orders_wizard_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_accrued_orders_wizard
    ADD CONSTRAINT account_accrued_orders_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_accrued_orders_wizard
    ADD CONSTRAINT account_accrued_orders_wizard_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_accrued_orders_wizard
    ADD CONSTRAINT account_accrued_orders_wizard_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_accrued_orders_wizard
    ADD CONSTRAINT account_accrued_orders_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_analytic_account account_analytic_account_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_analytic_account account_analytic_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_analytic_account account_analytic_account_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_analytic_account account_analytic_account_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_plan_id_fkey FOREIGN KEY (plan_id) REFERENCES public.account_analytic_plan(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_account account_analytic_account_root_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_root_plan_id_fkey FOREIGN KEY (root_plan_id) REFERENCES public.account_analytic_plan(id) ON DELETE SET NULL;


--
-- Name: account_analytic_account account_analytic_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_analytic_applicability account_analytic_applicability_analytic_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_applicability
    ADD CONSTRAINT account_analytic_applicability_analytic_plan_id_fkey FOREIGN KEY (analytic_plan_id) REFERENCES public.account_analytic_plan(id) ON DELETE SET NULL;


--
-- Name: account_analytic_applicability account_analytic_applicability_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_applicability
    ADD CONSTRAINT account_analytic_applicability_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_analytic_applicability account_analytic_applicability_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_applicability
    ADD CONSTRAINT account_analytic_applicability_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_analytic_applicability account_analytic_applicability_product_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_applicability
    ADD CONSTRAINT account_analytic_applicability_product_categ_id_fkey FOREIGN KEY (product_categ_id) REFERENCES public.product_category(id) ON DELETE SET NULL;


--
-- Name: account_analytic_applicability account_analytic_applicability_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_applicability
    ADD CONSTRAINT account_analytic_applicability_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_partner_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_partner_category_id_fkey FOREIGN KEY (partner_category_id) REFERENCES public.res_partner_category(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_product_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_product_categ_id_fkey FOREIGN KEY (product_categ_id) REFERENCES public.product_category(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_analytic_account(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_line account_analytic_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_line account_analytic_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_general_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_general_account_id_fkey FOREIGN KEY (general_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_line account_analytic_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_move_line_id_fkey FOREIGN KEY (move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_analytic_line account_analytic_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_so_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_so_line_fkey FOREIGN KEY (so_line) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line_stock_move_rel account_analytic_line_stock_move__account_analytic_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line_stock_move_rel
    ADD CONSTRAINT account_analytic_line_stock_move__account_analytic_line_id_fkey FOREIGN KEY (account_analytic_line_id) REFERENCES public.account_analytic_line(id) ON DELETE CASCADE;


--
-- Name: account_analytic_line_stock_move_rel account_analytic_line_stock_move_rel_stock_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line_stock_move_rel
    ADD CONSTRAINT account_analytic_line_stock_move_rel_stock_move_id_fkey FOREIGN KEY (stock_move_id) REFERENCES public.stock_move(id) ON DELETE CASCADE;


--
-- Name: account_analytic_line account_analytic_line_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_analytic_plan account_analytic_plan_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_plan
    ADD CONSTRAINT account_analytic_plan_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_analytic_plan account_analytic_plan_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_plan
    ADD CONSTRAINT account_analytic_plan_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.account_analytic_plan(id) ON DELETE CASCADE;


--
-- Name: account_analytic_plan account_analytic_plan_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_plan
    ADD CONSTRAINT account_analytic_plan_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_automatic_entry_wizard_account_move_line_rel account_automatic_entry_wizar_account_automatic_entry_wiza_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_automatic_entry_wizard_account_move_line_rel
    ADD CONSTRAINT account_automatic_entry_wizar_account_automatic_entry_wiza_fkey FOREIGN KEY (account_automatic_entry_wizard_id) REFERENCES public.account_automatic_entry_wizard(id) ON DELETE CASCADE;


--
-- Name: account_automatic_entry_wizard_account_move_line_rel account_automatic_entry_wizard_accoun_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_automatic_entry_wizard_account_move_line_rel
    ADD CONSTRAINT account_automatic_entry_wizard_accoun_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_automatic_entry_wizard
    ADD CONSTRAINT account_automatic_entry_wizard_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_automatic_entry_wizard
    ADD CONSTRAINT account_automatic_entry_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_destination_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_automatic_entry_wizard
    ADD CONSTRAINT account_automatic_entry_wizard_destination_account_id_fkey FOREIGN KEY (destination_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_automatic_entry_wizard
    ADD CONSTRAINT account_automatic_entry_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_autopost_bills_wizard account_autopost_bills_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_autopost_bills_wizard
    ADD CONSTRAINT account_autopost_bills_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_autopost_bills_wizard account_autopost_bills_wizard_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_autopost_bills_wizard
    ADD CONSTRAINT account_autopost_bills_wizard_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_autopost_bills_wizard account_autopost_bills_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_autopost_bills_wizard
    ADD CONSTRAINT account_autopost_bills_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement account_bank_statement_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement
    ADD CONSTRAINT account_bank_statement_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement account_bank_statement_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement
    ADD CONSTRAINT account_bank_statement_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_ir_attachment_rel account_bank_statement_ir_attach_account_bank_statement_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_ir_attachment_rel
    ADD CONSTRAINT account_bank_statement_ir_attach_account_bank_statement_id_fkey FOREIGN KEY (account_bank_statement_id) REFERENCES public.account_bank_statement(id) ON DELETE CASCADE;


--
-- Name: account_bank_statement_ir_attachment_rel account_bank_statement_ir_attachment_rel_ir_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_ir_attachment_rel
    ADD CONSTRAINT account_bank_statement_ir_attachment_rel_ir_attachment_id_fkey FOREIGN KEY (ir_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: account_bank_statement account_bank_statement_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement
    ADD CONSTRAINT account_bank_statement_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_foreign_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_foreign_currency_id_fkey FOREIGN KEY (foreign_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_bank_statement_line account_bank_statement_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_bank_statement_line account_bank_statement_line_statement_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_statement_id_fkey FOREIGN KEY (statement_id) REFERENCES public.account_bank_statement(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement account_bank_statement_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement
    ADD CONSTRAINT account_bank_statement_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_cash_rounding account_cash_rounding_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_cash_rounding
    ADD CONSTRAINT account_cash_rounding_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_cash_rounding account_cash_rounding_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_cash_rounding
    ADD CONSTRAINT account_cash_rounding_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_edi_proxy_client_user account_edi_proxy_client_user_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_proxy_client_user
    ADD CONSTRAINT account_edi_proxy_client_user_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_edi_proxy_client_user account_edi_proxy_client_user_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_proxy_client_user
    ADD CONSTRAINT account_edi_proxy_client_user_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_edi_proxy_client_user account_edi_proxy_client_user_private_key_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_proxy_client_user
    ADD CONSTRAINT account_edi_proxy_client_user_private_key_id_fkey FOREIGN KEY (private_key_id) REFERENCES public.certificate_key(id) ON DELETE RESTRICT;


--
-- Name: account_edi_proxy_client_user account_edi_proxy_client_user_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_proxy_client_user
    ADD CONSTRAINT account_edi_proxy_client_user_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_financial_year_op account_financial_year_op_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_financial_year_op
    ADD CONSTRAINT account_financial_year_op_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_financial_year_op account_financial_year_op_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_financial_year_op
    ADD CONSTRAINT account_financial_year_op_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_financial_year_op account_financial_year_op_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_financial_year_op
    ADD CONSTRAINT account_financial_year_op_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_account_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_account_dest_id_fkey FOREIGN KEY (account_dest_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_account_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_account_src_id_fkey FOREIGN KEY (account_src_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_position_id_fkey FOREIGN KEY (position_id) REFERENCES public.account_fiscal_position(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position account_fiscal_position_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position
    ADD CONSTRAINT account_fiscal_position_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position account_fiscal_position_country_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position
    ADD CONSTRAINT account_fiscal_position_country_group_id_fkey FOREIGN KEY (country_group_id) REFERENCES public.res_country_group(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position account_fiscal_position_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position
    ADD CONSTRAINT account_fiscal_position_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position account_fiscal_position_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position
    ADD CONSTRAINT account_fiscal_position_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_res_country_state_rel account_fiscal_position_res_cou_account_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_res_country_state_rel
    ADD CONSTRAINT account_fiscal_position_res_cou_account_fiscal_position_id_fkey FOREIGN KEY (account_fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_res_country_state_rel account_fiscal_position_res_country_s_res_country_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_res_country_state_rel
    ADD CONSTRAINT account_fiscal_position_res_country_s_res_country_state_id_fkey FOREIGN KEY (res_country_state_id) REFERENCES public.res_country_state(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax
    ADD CONSTRAINT account_fiscal_position_tax_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax
    ADD CONSTRAINT account_fiscal_position_tax_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax
    ADD CONSTRAINT account_fiscal_position_tax_position_id_fkey FOREIGN KEY (position_id) REFERENCES public.account_fiscal_position(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_tax_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax
    ADD CONSTRAINT account_fiscal_position_tax_tax_dest_id_fkey FOREIGN KEY (tax_dest_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_tax_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax
    ADD CONSTRAINT account_fiscal_position_tax_tax_src_id_fkey FOREIGN KEY (tax_src_id) REFERENCES public.account_tax(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax
    ADD CONSTRAINT account_fiscal_position_tax_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position account_fiscal_position_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position
    ADD CONSTRAINT account_fiscal_position_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_full_reconcile account_full_reconcile_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_full_reconcile
    ADD CONSTRAINT account_full_reconcile_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_full_reconcile account_full_reconcile_exchange_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_full_reconcile
    ADD CONSTRAINT account_full_reconcile_exchange_move_id_fkey FOREIGN KEY (exchange_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_full_reconcile account_full_reconcile_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_full_reconcile
    ADD CONSTRAINT account_full_reconcile_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_group account_group_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_group
    ADD CONSTRAINT account_group_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_group account_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_group
    ADD CONSTRAINT account_group_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_group account_group_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_group
    ADD CONSTRAINT account_group_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.account_group(id) ON DELETE CASCADE;


--
-- Name: account_group account_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_group
    ADD CONSTRAINT account_group_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_incoterms account_incoterms_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_incoterms
    ADD CONSTRAINT account_incoterms_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_incoterms account_incoterms_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_incoterms
    ADD CONSTRAINT account_incoterms_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_invoice_transaction_rel account_invoice_transaction_rel_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_invoice_transaction_rel
    ADD CONSTRAINT account_invoice_transaction_rel_invoice_id_fkey FOREIGN KEY (invoice_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_invoice_transaction_rel account_invoice_transaction_rel_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_invoice_transaction_rel
    ADD CONSTRAINT account_invoice_transaction_rel_transaction_id_fkey FOREIGN KEY (transaction_id) REFERENCES public.payment_transaction(id) ON DELETE CASCADE;


--
-- Name: account_journal_account_journal_group_rel account_journal_account_journal_g_account_journal_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_account_journal_group_rel
    ADD CONSTRAINT account_journal_account_journal_g_account_journal_group_id_fkey FOREIGN KEY (account_journal_group_id) REFERENCES public.account_journal_group(id) ON DELETE CASCADE;


--
-- Name: account_journal_account_journal_group_rel account_journal_account_journal_group_r_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_account_journal_group_rel
    ADD CONSTRAINT account_journal_account_journal_group_r_account_journal_id_fkey FOREIGN KEY (account_journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_journal_account_reconcile_model_rel account_journal_account_reconci_account_reconcile_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_account_reconcile_model_rel
    ADD CONSTRAINT account_journal_account_reconci_account_reconcile_model_id_fkey FOREIGN KEY (account_reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_journal_account_reconcile_model_rel account_journal_account_reconcile_model_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_account_reconcile_model_rel
    ADD CONSTRAINT account_journal_account_reconcile_model_account_journal_id_fkey FOREIGN KEY (account_journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_journal account_journal_alias_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_alias_id_fkey FOREIGN KEY (alias_id) REFERENCES public.mail_alias(id) ON DELETE RESTRICT;


--
-- Name: account_journal account_journal_bank_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_bank_account_id_fkey FOREIGN KEY (bank_account_id) REFERENCES public.res_partner_bank(id) ON DELETE RESTRICT;


--
-- Name: account_journal account_journal_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_journal account_journal_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_default_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_default_account_id_fkey FOREIGN KEY (default_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_journal_group account_journal_group_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_group
    ADD CONSTRAINT account_journal_group_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_journal_group account_journal_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_group
    ADD CONSTRAINT account_journal_group_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_journal_group account_journal_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_group
    ADD CONSTRAINT account_journal_group_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_loss_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_loss_account_id_fkey FOREIGN KEY (loss_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_profit_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_profit_account_id_fkey FOREIGN KEY (profit_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_suspense_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_suspense_account_id_fkey FOREIGN KEY (suspense_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_journal account_journal_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_lock_exception account_lock_exception_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_lock_exception
    ADD CONSTRAINT account_lock_exception_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_lock_exception account_lock_exception_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_lock_exception
    ADD CONSTRAINT account_lock_exception_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_lock_exception account_lock_exception_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_lock_exception
    ADD CONSTRAINT account_lock_exception_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_lock_exception account_lock_exception_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_lock_exception
    ADD CONSTRAINT account_lock_exception_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_merge_wizard account_merge_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_merge_wizard
    ADD CONSTRAINT account_merge_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_merge_wizard_line account_merge_wizard_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_merge_wizard_line
    ADD CONSTRAINT account_merge_wizard_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_merge_wizard_line account_merge_wizard_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_merge_wizard_line
    ADD CONSTRAINT account_merge_wizard_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_merge_wizard_line account_merge_wizard_line_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_merge_wizard_line
    ADD CONSTRAINT account_merge_wizard_line_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.account_merge_wizard(id) ON DELETE CASCADE;


--
-- Name: account_merge_wizard_line account_merge_wizard_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_merge_wizard_line
    ADD CONSTRAINT account_merge_wizard_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_merge_wizard account_merge_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_merge_wizard
    ADD CONSTRAINT account_merge_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move__account_payment account_move__account_payment_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move__account_payment
    ADD CONSTRAINT account_move__account_payment_invoice_id_fkey FOREIGN KEY (invoice_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move__account_payment account_move__account_payment_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move__account_payment
    ADD CONSTRAINT account_move__account_payment_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment(id) ON DELETE CASCADE;


--
-- Name: account_move_account_move_send_batch_wizard_rel account_move_account_move_sen_account_move_send_batch_wiza_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_move_send_batch_wizard_rel
    ADD CONSTRAINT account_move_account_move_sen_account_move_send_batch_wiza_fkey FOREIGN KEY (account_move_send_batch_wizard_id) REFERENCES public.account_move_send_batch_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_account_move_send_batch_wizard_rel account_move_account_move_send_batch_wizar_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_move_send_batch_wizard_rel
    ADD CONSTRAINT account_move_account_move_send_batch_wizar_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_account_peppol_rejection_wizard_rel account_move_account_peppol_r_account_peppol_rejection_wiz_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_peppol_rejection_wizard_rel
    ADD CONSTRAINT account_move_account_peppol_r_account_peppol_rejection_wiz_fkey FOREIGN KEY (account_peppol_rejection_wizard_id) REFERENCES public.account_peppol_rejection_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_account_peppol_rejection_wizard_rel account_move_account_peppol_rejection_wiza_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_peppol_rejection_wizard_rel
    ADD CONSTRAINT account_move_account_peppol_rejection_wiza_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_account_resequence_wizard_rel account_move_account_resequen_account_resequence_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_resequence_wizard_rel
    ADD CONSTRAINT account_move_account_resequen_account_resequence_wizard_id_fkey FOREIGN KEY (account_resequence_wizard_id) REFERENCES public.account_resequence_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_account_resequence_wizard_rel account_move_account_resequence_wizard_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_resequence_wizard_rel
    ADD CONSTRAINT account_move_account_resequence_wizard_rel_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move account_move_auto_post_origin_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_auto_post_origin_id_fkey FOREIGN KEY (auto_post_origin_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_campaign(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_commercial_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_commercial_partner_id_fkey FOREIGN KEY (commercial_partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_move account_move_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: account_move account_move_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_fiscal_position_id_fkey FOREIGN KEY (fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE RESTRICT;


--
-- Name: account_move account_move_invoice_cash_rounding_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_cash_rounding_id_fkey FOREIGN KEY (invoice_cash_rounding_id) REFERENCES public.account_cash_rounding(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_invoice_incoterm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_incoterm_id_fkey FOREIGN KEY (invoice_incoterm_id) REFERENCES public.account_incoterms(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_invoice_payment_term_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_payment_term_id_fkey FOREIGN KEY (invoice_payment_term_id) REFERENCES public.account_payment_term(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_invoice_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_user_id_fkey FOREIGN KEY (invoice_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_move_line_account_tax_rel account_move_line_account_tax_rel_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line_account_tax_rel
    ADD CONSTRAINT account_move_line_account_tax_rel_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_move_line_account_tax_rel account_move_line_account_tax_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line_account_tax_rel
    ADD CONSTRAINT account_move_line_account_tax_rel_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_move_line account_move_line_cogs_origin_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_cogs_origin_id_fkey FOREIGN KEY (cogs_origin_id) REFERENCES public.account_move_line(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_company_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_company_currency_id_fkey FOREIGN KEY (company_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_full_reconcile_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_full_reconcile_id_fkey FOREIGN KEY (full_reconcile_id) REFERENCES public.account_full_reconcile(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_group_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_group_tax_id_fkey FOREIGN KEY (group_tax_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_line account_move_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_purchase_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_purchase_line_id_fkey FOREIGN KEY (purchase_line_id) REFERENCES public.purchase_order_line(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_reconcile_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_reconcile_model_id_fkey FOREIGN KEY (reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_statement_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_statement_id_fkey FOREIGN KEY (statement_id) REFERENCES public.account_bank_statement(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_statement_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_statement_line_id_fkey FOREIGN KEY (statement_line_id) REFERENCES public.account_bank_statement_line(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_tax_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_tax_group_id_fkey FOREIGN KEY (tax_group_id) REFERENCES public.account_tax_group(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_tax_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_tax_line_id_fkey FOREIGN KEY (tax_line_id) REFERENCES public.account_tax(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_tax_repartition_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_tax_repartition_line_id_fkey FOREIGN KEY (tax_repartition_line_id) REFERENCES public.account_tax_repartition_line(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_medium_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_medium_id_fkey FOREIGN KEY (medium_id) REFERENCES public.utm_medium(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_origin_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_origin_payment_id_fkey FOREIGN KEY (origin_payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_partner_bank_id_fkey FOREIGN KEY (partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE RESTRICT;


--
-- Name: account_move account_move_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_move account_move_partner_shipping_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_partner_shipping_id_fkey FOREIGN KEY (partner_shipping_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_preferred_payment_method_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_preferred_payment_method_line_id_fkey FOREIGN KEY (preferred_payment_method_line_id) REFERENCES public.account_payment_method_line(id) ON DELETE SET NULL;


--
-- Name: account_move_purchase_order_rel account_move_purchase_order_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_purchase_order_rel
    ADD CONSTRAINT account_move_purchase_order_rel_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_purchase_order_rel account_move_purchase_order_rel_purchase_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_purchase_order_rel
    ADD CONSTRAINT account_move_purchase_order_rel_purchase_order_id_fkey FOREIGN KEY (purchase_order_id) REFERENCES public.purchase_order(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal account_move_reversal_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal
    ADD CONSTRAINT account_move_reversal_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal account_move_reversal_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal
    ADD CONSTRAINT account_move_reversal_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move_reversal account_move_reversal_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal
    ADD CONSTRAINT account_move_reversal_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal_move account_move_reversal_move_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal_move
    ADD CONSTRAINT account_move_reversal_move_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal_move account_move_reversal_move_reversal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal_move
    ADD CONSTRAINT account_move_reversal_move_reversal_id_fkey FOREIGN KEY (reversal_id) REFERENCES public.account_move_reversal(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal_new_move account_move_reversal_new_move_new_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal_new_move
    ADD CONSTRAINT account_move_reversal_new_move_new_move_id_fkey FOREIGN KEY (new_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal_new_move account_move_reversal_new_move_reversal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal_new_move
    ADD CONSTRAINT account_move_reversal_new_move_reversal_id_fkey FOREIGN KEY (reversal_id) REFERENCES public.account_move_reversal(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal account_move_reversal_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal
    ADD CONSTRAINT account_move_reversal_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_reversed_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_reversed_entry_id_fkey FOREIGN KEY (reversed_entry_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_move_send_batch_wizard account_move_send_batch_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_batch_wizard
    ADD CONSTRAINT account_move_send_batch_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move_send_batch_wizard account_move_send_batch_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_batch_wizard
    ADD CONSTRAINT account_move_send_batch_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move_send_wizard account_move_send_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard
    ADD CONSTRAINT account_move_send_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move_send_wizard account_move_send_wizard_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard
    ADD CONSTRAINT account_move_send_wizard_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: account_move_send_wizard account_move_send_wizard_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard
    ADD CONSTRAINT account_move_send_wizard_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_send_wizard account_move_send_wizard_pdf_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard
    ADD CONSTRAINT account_move_send_wizard_pdf_report_id_fkey FOREIGN KEY (pdf_report_id) REFERENCES public.ir_act_report_xml(id) ON DELETE SET NULL;


--
-- Name: account_move_send_wizard_res_partner_rel account_move_send_wizard_res_p_account_move_send_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard_res_partner_rel
    ADD CONSTRAINT account_move_send_wizard_res_p_account_move_send_wizard_id_fkey FOREIGN KEY (account_move_send_wizard_id) REFERENCES public.account_move_send_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_send_wizard_res_partner_rel account_move_send_wizard_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard_res_partner_rel
    ADD CONSTRAINT account_move_send_wizard_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: account_move_send_wizard account_move_send_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard
    ADD CONSTRAINT account_move_send_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_source_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_source_id_fkey FOREIGN KEY (source_id) REFERENCES public.utm_source(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_statement_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_statement_line_id_fkey FOREIGN KEY (statement_line_id) REFERENCES public.account_bank_statement_line(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_stock_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_stock_move_id_fkey FOREIGN KEY (stock_move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_tax_cash_basis_origin_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_tax_cash_basis_origin_move_id_fkey FOREIGN KEY (tax_cash_basis_origin_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_tax_cash_basis_rec_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_tax_cash_basis_rec_id_fkey FOREIGN KEY (tax_cash_basis_rec_id) REFERENCES public.account_partial_reconcile(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_team_id_fkey FOREIGN KEY (team_id) REFERENCES public.crm_team(id) ON DELETE SET NULL;


--
-- Name: account_move_validate_account_move_rel account_move_validate_account_mov_validate_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_validate_account_move_rel
    ADD CONSTRAINT account_move_validate_account_mov_validate_account_move_id_fkey FOREIGN KEY (validate_account_move_id) REFERENCES public.validate_account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_validate_account_move_rel account_move_validate_account_move_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_validate_account_move_rel
    ADD CONSTRAINT account_move_validate_account_move_rel_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move account_move_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_credit_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_credit_currency_id_fkey FOREIGN KEY (credit_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_credit_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_credit_move_id_fkey FOREIGN KEY (credit_move_id) REFERENCES public.account_move_line(id) ON DELETE RESTRICT;


--
-- Name: account_partial_reconcile account_partial_reconcile_debit_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_debit_currency_id_fkey FOREIGN KEY (debit_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_debit_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_debit_move_id_fkey FOREIGN KEY (debit_move_id) REFERENCES public.account_move_line(id) ON DELETE RESTRICT;


--
-- Name: account_partial_reconcile account_partial_reconcile_exchange_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_exchange_move_id_fkey FOREIGN KEY (exchange_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_full_reconcile_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_full_reconcile_id_fkey FOREIGN KEY (full_reconcile_id) REFERENCES public.account_full_reconcile(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_account_bank_statement_line_rel account_payment_account_bank__account_bank_statement_line__fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_account_bank_statement_line_rel
    ADD CONSTRAINT account_payment_account_bank__account_bank_statement_line__fkey FOREIGN KEY (account_bank_statement_line_id) REFERENCES public.account_bank_statement_line(id) ON DELETE CASCADE;


--
-- Name: account_payment_account_bank_statement_line_rel account_payment_account_bank_statement__account_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_account_bank_statement_line_rel
    ADD CONSTRAINT account_payment_account_bank_statement__account_payment_id_fkey FOREIGN KEY (account_payment_id) REFERENCES public.account_payment(id) ON DELETE CASCADE;


--
-- Name: account_payment account_payment_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_destination_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_destination_account_id_fkey FOREIGN KEY (destination_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: account_payment_method account_payment_method_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method
    ADD CONSTRAINT account_payment_method_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_method_line account_payment_method_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_method_line account_payment_method_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_payment_method_line account_payment_method_line_payment_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_payment_account_id_fkey FOREIGN KEY (payment_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_payment_method_line account_payment_method_line_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_payment_method_id_fkey FOREIGN KEY (payment_method_id) REFERENCES public.account_payment_method(id) ON DELETE RESTRICT;


--
-- Name: account_payment_method_line account_payment_method_line_payment_provider_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_payment_provider_id_fkey FOREIGN KEY (payment_provider_id) REFERENCES public.payment_provider(id) ON DELETE SET NULL;


--
-- Name: account_payment_method_line account_payment_method_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_method account_payment_method_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method
    ADD CONSTRAINT account_payment_method_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_outstanding_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_outstanding_account_id_fkey FOREIGN KEY (outstanding_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_paired_internal_transfer_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_paired_internal_transfer_payment_id_fkey FOREIGN KEY (paired_internal_transfer_payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_partner_bank_id_fkey FOREIGN KEY (partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_method_id_fkey FOREIGN KEY (payment_method_id) REFERENCES public.account_payment_method(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_payment_method_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_method_line_id_fkey FOREIGN KEY (payment_method_line_id) REFERENCES public.account_payment_method_line(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_payment_token_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_token_id_fkey FOREIGN KEY (payment_token_id) REFERENCES public.payment_token(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_payment_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_transaction_id_fkey FOREIGN KEY (payment_transaction_id) REFERENCES public.payment_transaction(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_custom_user_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_custom_user_currency_id_fkey FOREIGN KEY (custom_user_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_payment_register_move_line_rel account_payment_register_move_line_rel_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register_move_line_rel
    ADD CONSTRAINT account_payment_register_move_line_rel_line_id_fkey FOREIGN KEY (line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_payment_register_move_line_rel account_payment_register_move_line_rel_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register_move_line_rel
    ADD CONSTRAINT account_payment_register_move_line_rel_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.account_payment_register(id) ON DELETE CASCADE;


--
-- Name: account_payment_register account_payment_register_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_partner_bank_id_fkey FOREIGN KEY (partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_payment_register account_payment_register_payment_method_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_payment_method_line_id_fkey FOREIGN KEY (payment_method_line_id) REFERENCES public.account_payment_method_line(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_payment_token_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_payment_token_id_fkey FOREIGN KEY (payment_token_id) REFERENCES public.payment_token(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_source_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_source_currency_id_fkey FOREIGN KEY (source_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_writeoff_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_writeoff_account_id_fkey FOREIGN KEY (writeoff_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_source_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_source_payment_id_fkey FOREIGN KEY (source_payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_payment_term account_payment_term_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_term
    ADD CONSTRAINT account_payment_term_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_payment_term account_payment_term_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_term
    ADD CONSTRAINT account_payment_term_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_term_line account_payment_term_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_term_line
    ADD CONSTRAINT account_payment_term_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_term_line account_payment_term_line_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_term_line
    ADD CONSTRAINT account_payment_term_line_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment_term(id) ON DELETE CASCADE;


--
-- Name: account_payment_term_line account_payment_term_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_term_line
    ADD CONSTRAINT account_payment_term_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment_term account_payment_term_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_term
    ADD CONSTRAINT account_payment_term_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_peppol_clarification account_peppol_clarification_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_clarification
    ADD CONSTRAINT account_peppol_clarification_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_peppol_clarification account_peppol_clarification_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_clarification
    ADD CONSTRAINT account_peppol_clarification_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_peppol_rejection_action_rel account_peppol_rejection_acti_account_peppol_clarification_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_action_rel
    ADD CONSTRAINT account_peppol_rejection_acti_account_peppol_clarification_fkey FOREIGN KEY (account_peppol_clarification_id) REFERENCES public.account_peppol_clarification(id) ON DELETE CASCADE;


--
-- Name: account_peppol_rejection_action_rel account_peppol_rejection_acti_account_peppol_rejection_wiz_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_action_rel
    ADD CONSTRAINT account_peppol_rejection_acti_account_peppol_rejection_wiz_fkey FOREIGN KEY (account_peppol_rejection_wizard_id) REFERENCES public.account_peppol_rejection_wizard(id) ON DELETE CASCADE;


--
-- Name: account_peppol_rejection_reason_rel account_peppol_rejection_reas_account_peppol_clarification_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_reason_rel
    ADD CONSTRAINT account_peppol_rejection_reas_account_peppol_clarification_fkey FOREIGN KEY (account_peppol_clarification_id) REFERENCES public.account_peppol_clarification(id) ON DELETE CASCADE;


--
-- Name: account_peppol_rejection_reason_rel account_peppol_rejection_reas_account_peppol_rejection_wiz_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_reason_rel
    ADD CONSTRAINT account_peppol_rejection_reas_account_peppol_rejection_wiz_fkey FOREIGN KEY (account_peppol_rejection_wizard_id) REFERENCES public.account_peppol_rejection_wizard(id) ON DELETE CASCADE;


--
-- Name: account_peppol_rejection_wizard account_peppol_rejection_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_wizard
    ADD CONSTRAINT account_peppol_rejection_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_peppol_rejection_wizard account_peppol_rejection_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_wizard
    ADD CONSTRAINT account_peppol_rejection_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_peppol_response account_peppol_response_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_response
    ADD CONSTRAINT account_peppol_response_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_peppol_response account_peppol_response_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_response
    ADD CONSTRAINT account_peppol_response_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_peppol_response account_peppol_response_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_response
    ADD CONSTRAINT account_peppol_response_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_peppol_service account_peppol_service_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_service
    ADD CONSTRAINT account_peppol_service_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_peppol_service_wizard account_peppol_service_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_service_wizard
    ADD CONSTRAINT account_peppol_service_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_peppol_service_wizard account_peppol_service_wizard_edi_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_service_wizard
    ADD CONSTRAINT account_peppol_service_wizard_edi_user_id_fkey FOREIGN KEY (edi_user_id) REFERENCES public.account_edi_proxy_client_user(id) ON DELETE SET NULL;


--
-- Name: account_peppol_service account_peppol_service_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_service
    ADD CONSTRAINT account_peppol_service_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.account_peppol_service_wizard(id) ON DELETE SET NULL;


--
-- Name: account_peppol_service_wizard account_peppol_service_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_service_wizard
    ADD CONSTRAINT account_peppol_service_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_peppol_service account_peppol_service_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_service
    ADD CONSTRAINT account_peppol_service_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model account_reconcile_model_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model
    ADD CONSTRAINT account_reconcile_model_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_reconcile_model account_reconcile_model_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model
    ADD CONSTRAINT account_reconcile_model_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model_line_account_tax_rel account_reconcile_model_line__account_reconcile_model_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line_account_tax_rel
    ADD CONSTRAINT account_reconcile_model_line__account_reconcile_model_line_fkey FOREIGN KEY (account_reconcile_model_line_id) REFERENCES public.account_reconcile_model_line(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_line_account_tax_rel account_reconcile_model_line_account_tax_re_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line_account_tax_rel
    ADD CONSTRAINT account_reconcile_model_line_account_tax_re_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE RESTRICT;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_partner_mapping
    ADD CONSTRAINT account_reconcile_model_partner_mapping_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_partner_mapping
    ADD CONSTRAINT account_reconcile_model_partner_mapping_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_partner_mapping
    ADD CONSTRAINT account_reconcile_model_partner_mapping_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_partner_mapping
    ADD CONSTRAINT account_reconcile_model_partner_mapping_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model_res_partner_category_rel account_reconcile_model_res_pa_account_reconcile_model_id_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_category_rel
    ADD CONSTRAINT account_reconcile_model_res_pa_account_reconcile_model_id_fkey1 FOREIGN KEY (account_reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_res_partner_rel account_reconcile_model_res_par_account_reconcile_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_rel
    ADD CONSTRAINT account_reconcile_model_res_par_account_reconcile_model_id_fkey FOREIGN KEY (account_reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_res_partner_category_rel account_reconcile_model_res_partne_res_partner_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_category_rel
    ADD CONSTRAINT account_reconcile_model_res_partne_res_partner_category_id_fkey FOREIGN KEY (res_partner_category_id) REFERENCES public.res_partner_category(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_res_partner_rel account_reconcile_model_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_rel
    ADD CONSTRAINT account_reconcile_model_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model account_reconcile_model_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model
    ADD CONSTRAINT account_reconcile_model_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_column account_report_column_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_column
    ADD CONSTRAINT account_report_column_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_column account_report_column_custom_audit_action_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_column
    ADD CONSTRAINT account_report_column_custom_audit_action_id_fkey FOREIGN KEY (custom_audit_action_id) REFERENCES public.ir_act_window(id) ON DELETE SET NULL;


--
-- Name: account_report_column account_report_column_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_column
    ADD CONSTRAINT account_report_column_report_id_fkey FOREIGN KEY (report_id) REFERENCES public.account_report(id) ON DELETE SET NULL;


--
-- Name: account_report_column account_report_column_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_column
    ADD CONSTRAINT account_report_column_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report account_report_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report
    ADD CONSTRAINT account_report_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: account_report account_report_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report
    ADD CONSTRAINT account_report_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_expression account_report_expression_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_expression
    ADD CONSTRAINT account_report_expression_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_expression account_report_expression_report_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_expression
    ADD CONSTRAINT account_report_expression_report_line_id_fkey FOREIGN KEY (report_line_id) REFERENCES public.account_report_line(id) ON DELETE CASCADE;


--
-- Name: account_report_expression account_report_expression_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_expression
    ADD CONSTRAINT account_report_expression_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_external_value account_report_external_value_carryover_origin_report_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_carryover_origin_report_line_fkey FOREIGN KEY (carryover_origin_report_line_id) REFERENCES public.account_report_line(id) ON DELETE SET NULL;


--
-- Name: account_report_external_value account_report_external_value_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_report_external_value account_report_external_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_external_value account_report_external_value_foreign_vat_fiscal_position__fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_foreign_vat_fiscal_position__fkey FOREIGN KEY (foreign_vat_fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE SET NULL;


--
-- Name: account_report_external_value account_report_external_value_target_report_expression_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_target_report_expression_id_fkey FOREIGN KEY (target_report_expression_id) REFERENCES public.account_report_expression(id) ON DELETE CASCADE;


--
-- Name: account_report_external_value account_report_external_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_line account_report_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_line
    ADD CONSTRAINT account_report_line_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report_line account_report_line_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_line
    ADD CONSTRAINT account_report_line_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.account_report_line(id) ON DELETE SET NULL;


--
-- Name: account_report_line account_report_line_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_line
    ADD CONSTRAINT account_report_line_report_id_fkey FOREIGN KEY (report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_report_line account_report_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_line
    ADD CONSTRAINT account_report_line_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_report account_report_root_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report
    ADD CONSTRAINT account_report_root_report_id_fkey FOREIGN KEY (root_report_id) REFERENCES public.account_report(id) ON DELETE SET NULL;


--
-- Name: account_report_section_rel account_report_section_rel_main_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_section_rel
    ADD CONSTRAINT account_report_section_rel_main_report_id_fkey FOREIGN KEY (main_report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_report_section_rel account_report_section_rel_sub_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_section_rel
    ADD CONSTRAINT account_report_section_rel_sub_report_id_fkey FOREIGN KEY (sub_report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_report account_report_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report
    ADD CONSTRAINT account_report_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_resequence_wizard account_resequence_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_resequence_wizard
    ADD CONSTRAINT account_resequence_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_resequence_wizard account_resequence_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_resequence_wizard
    ADD CONSTRAINT account_resequence_wizard_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_secure_entries_wizard account_secure_entries_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_secure_entries_wizard
    ADD CONSTRAINT account_secure_entries_wizard_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_secure_entries_wizard account_secure_entries_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_secure_entries_wizard
    ADD CONSTRAINT account_secure_entries_wizard_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
