-- Name: website_track website_track_pkey; Type: CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_track
    ADD CONSTRAINT website_track_pkey PRIMARY KEY (id);


--
-- Name: website_visitor website_visitor_access_token_unique; Type: CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_access_token_unique UNIQUE (access_token);


--
-- Name: CONSTRAINT website_visitor_access_token_unique ON website_visitor; Type: COMMENT; Schema: public; Owner: odoo
--

COMMENT ON CONSTRAINT website_visitor_access_token_unique ON public.website_visitor IS 'unique(access_token)';


--
-- Name: website_visitor website_visitor_pkey; Type: CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.website_visitor
    ADD CONSTRAINT website_visitor_pkey PRIMARY KEY (id);


--
-- Name: wizard_ir_model_menu_create wizard_ir_model_menu_create_pkey; Type: CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.wizard_ir_model_menu_create
    ADD CONSTRAINT wizard_ir_model_menu_create_pkey PRIMARY KEY (id);


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

CREATE INDEX account_account_account_journ_account_journal_id_account_ac_idx ON public.account_account_account_journal_rel USING btree (account_journal_id, account_account_id);


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

CREATE INDEX account_account_account_tag_account_account_tag_id_account__idx ON public.account_account_account_tag USING btree (account_account_tag_id, account_account_id);


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

CREATE INDEX account_account_account_type_index ON public.account_account USING btree (account_type);


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

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


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

CREATE INDEX account_account_tag_account_m_account_account_tag_id_accoun_idx ON public.account_account_tag_account_move_line_rel USING btree (account_account_tag_id, account_move_line_id);


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

CREATE INDEX account_account_tag_account_t_account_account_tag_id_accoun_idx ON public.account_account_tag_account_tax_repartition_line_rel USING btree (account_account_tag_id, account_tax_repartition_line_id);


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

CREATE INDEX account_account_tag_product_t_account_account_tag_id_produc_idx ON public.account_account_tag_product_template_rel USING btree (account_account_tag_id, product_template_id);


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

CREATE INDEX account_account_tax_default_rel_tax_id_account_id_idx ON public.account_account_tax_default_rel USING btree (tax_id, account_id);


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

CREATE INDEX account_account_template_acco_account_account_tag_id_accoun_idx ON public.account_account_template_account_tag USING btree (account_account_tag_id, account_account_template_id);


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

CREATE INDEX account_account_template_tax_rel_tax_id_account_id_idx ON public.account_account_template_tax_rel USING btree (tax_id, account_id);


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

CREATE INDEX account_analytic_account_code_index ON public.account_analytic_account USING btree (code);


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

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


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

CREATE INDEX account_analytic_distribution_model_analytic_distribution_gin_i ON public.account_analytic_distribution_model USING gin (analytic_distribution);


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

CREATE INDEX account_analytic_line_account_id_index ON public.account_analytic_line USING btree (account_id);


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

CREATE INDEX account_analytic_line_date_index ON public.account_analytic_line USING btree (date);


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

CREATE INDEX account_analytic_line_move_line_id_index ON public.account_analytic_line USING btree (move_line_id);


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

CREATE INDEX account_analytic_line_user_id_index ON public.account_analytic_line USING btree (user_id);


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

CREATE INDEX account_analytic_plan_parent_path_index ON public.account_analytic_plan USING btree (parent_path);


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

CREATE INDEX account_automatic_entry_wizar_account_move_line_id_account__idx ON public.account_automatic_entry_wizard_account_move_line_rel USING btree (account_move_line_id, account_automatic_entry_wizard_id);


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

CREATE INDEX account_bank_statement_date_index ON public.account_bank_statement USING btree (date);


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

CREATE INDEX account_bank_statement_first_line_index_index ON public.account_bank_statement USING btree (first_line_index);


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

CREATE INDEX account_bank_statement_ir_att_ir_attachment_id_account_bank_idx ON public.account_bank_statement_ir_attachment_rel USING btree (ir_attachment_id, account_bank_statement_id);


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

CREATE INDEX account_bank_statement_line_internal_index_index ON public.account_bank_statement_line USING btree (internal_index);


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

CREATE INDEX account_bank_statement_line_move_id_index ON public.account_bank_statement_line USING btree (move_id);


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

CREATE INDEX account_edi_document_move_id_index ON public.account_edi_document USING btree (move_id);


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

CREATE INDEX account_edi_format_account_jo_account_edi_format_id_account_idx ON public.account_edi_format_account_journal_rel USING btree (account_edi_format_id, account_journal_id);


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

CREATE INDEX account_fiscal_position_res_c_res_country_state_id_account__idx ON public.account_fiscal_position_res_country_state_rel USING btree (res_country_state_id, account_fiscal_position_id);


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

CREATE INDEX account_fiscal_position_templ_res_country_state_id_account__idx ON public.account_fiscal_position_template_res_country_state_rel USING btree (res_country_state_id, account_fiscal_position_template_id);


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

CREATE INDEX account_full_reconcile_exchange_move_id_index ON public.account_full_reconcile USING btree (exchange_move_id) WHERE (exchange_move_id IS NOT NULL);


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

CREATE INDEX account_group_parent_id_index ON public.account_group USING btree (parent_id);


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

CREATE INDEX account_group_parent_path_index ON public.account_group USING btree (parent_path);


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

CREATE INDEX account_invoice_transaction_rel_transaction_id_invoice_id_idx ON public.account_invoice_transaction_rel USING btree (transaction_id, invoice_id);


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

CREATE INDEX account_journal_account_journ_account_journal_id_account_jo_idx ON public.account_journal_account_journal_group_rel USING btree (account_journal_id, account_journal_group_id);


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

CREATE INDEX account_journal_account_recon_account_journal_id_account_r_idx1 ON public.account_journal_account_reconcile_model_template_rel USING btree (account_journal_id, account_reconcile_model_template_id);


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

CREATE INDEX account_journal_account_recon_account_journal_id_account_re_idx ON public.account_journal_account_reconcile_model_rel USING btree (account_journal_id, account_reconcile_model_id);


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

CREATE INDEX account_journal_company_id_index ON public.account_journal USING btree (company_id);


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

CREATE INDEX account_move_account_invoice__account_move_id_account_invoi_idx ON public.account_move_account_invoice_send_rel USING btree (account_move_id, account_invoice_send_id);


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

CREATE INDEX account_move_account_resequen_account_move_id_account_reseq_idx ON public.account_move_account_resequence_wizard_rel USING btree (account_move_id, account_resequence_wizard_id);


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

CREATE INDEX account_move_auto_post_origin_id_index ON public.account_move USING btree (auto_post_origin_id) WHERE (auto_post_origin_id IS NOT NULL);


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

CREATE INDEX account_move_company_id_index ON public.account_move USING btree (company_id);


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

CREATE INDEX account_move_date_index ON public.account_move USING btree (date);


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

CREATE INDEX account_move_invoice_date_due_index ON public.account_move USING btree (invoice_date_due);


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

CREATE INDEX account_move_invoice_date_index ON public.account_move USING btree (invoice_date);


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

CREATE INDEX account_move_line_account_id_index ON public.account_move_line USING btree (account_id);


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

CREATE INDEX account_move_line_account_tax_account_tax_id_account_move_l_idx ON public.account_move_line_account_tax_rel USING btree (account_tax_id, account_move_line_id);


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

CREATE INDEX account_move_line_analytic_distribution_gin_index ON public.account_move_line USING gin (analytic_distribution);


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

CREATE INDEX account_move_line_company_id_index ON public.account_move_line USING btree (company_id);


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

CREATE INDEX account_move_line_date_maturity_index ON public.account_move_line USING btree (date_maturity);


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

CREATE INDEX account_move_line_date_name_id_idx ON public.account_move_line USING btree (date DESC, move_name DESC, id);


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

CREATE INDEX account_move_line_full_reconcile_id_index ON public.account_move_line USING btree (full_reconcile_id) WHERE (full_reconcile_id IS NOT NULL);


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

CREATE INDEX account_move_line_group_tax_id_index ON public.account_move_line USING btree (group_tax_id) WHERE (group_tax_id IS NOT NULL);


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

CREATE INDEX account_move_line_journal_id_index ON public.account_move_line USING btree (journal_id);


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

CREATE INDEX account_move_line_move_id_index ON public.account_move_line USING btree (move_id);


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

CREATE INDEX account_move_line_move_name_index ON public.account_move_line USING btree (move_name);


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

CREATE INDEX account_move_line_partner_id_ref_idx ON public.account_move_line USING btree (partner_id, ref);


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

CREATE INDEX account_move_line_payment_id_index ON public.account_move_line USING btree (payment_id) WHERE (payment_id IS NOT NULL);


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

CREATE INDEX account_move_line_product_id_index ON public.account_move_line USING btree (product_id);


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

CREATE INDEX account_move_line_purchase_line_id_index ON public.account_move_line USING btree (purchase_line_id) WHERE (purchase_line_id IS NOT NULL);


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

CREATE INDEX account_move_line_ref_index ON public.account_move_line USING gin (ref public.gin_trgm_ops);


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

CREATE INDEX account_move_line_statement_id_index ON public.account_move_line USING btree (statement_id) WHERE (statement_id IS NOT NULL);


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

CREATE INDEX account_move_line_statement_line_id_index ON public.account_move_line USING btree (statement_line_id) WHERE (statement_line_id IS NOT NULL);


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

CREATE INDEX account_move_move_type_index ON public.account_move USING btree (move_type);


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

CREATE INDEX account_move_name_index ON public.account_move USING gin (name public.gin_trgm_ops);


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

CREATE INDEX account_move_partner_id_index ON public.account_move USING btree (partner_id);


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

CREATE INDEX account_move_payment_id_index ON public.account_move USING btree (payment_id) WHERE (payment_id IS NOT NULL);


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

CREATE INDEX account_move_payment_idx ON public.account_move USING btree (journal_id, state, payment_state, move_type, date);


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

CREATE INDEX account_move_payment_reference_index ON public.account_move USING gin (payment_reference public.gin_trgm_ops);


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

CREATE INDEX account_move_purchase_order_r_account_move_id_purchase_orde_idx ON public.account_move_purchase_order_rel USING btree (account_move_id, purchase_order_id);


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

CREATE INDEX account_move_reversal_move_move_id_reversal_id_idx ON public.account_move_reversal_move USING btree (move_id, reversal_id);


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

CREATE INDEX account_move_reversal_new_move_new_move_id_reversal_id_idx ON public.account_move_reversal_new_move USING btree (new_move_id, reversal_id);


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

CREATE INDEX account_move_reversed_entry_id_index ON public.account_move USING btree (reversed_entry_id) WHERE (reversed_entry_id IS NOT NULL);


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

CREATE INDEX account_move_secure_sequence_number_index ON public.account_move USING btree (secure_sequence_number);


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

CREATE INDEX account_move_sequence_index ON public.account_move USING btree (journal_id, sequence_prefix DESC, sequence_number DESC, name);


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

CREATE INDEX account_move_sequence_index2 ON public.account_move USING btree (journal_id, id DESC, sequence_prefix);


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

CREATE INDEX account_move_sequence_index3 ON public.account_move USING btree (journal_id, sequence_prefix DESC, ((sequence_number + 1)) DESC);


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

CREATE INDEX account_move_statement_line_id_index ON public.account_move USING btree (statement_line_id) WHERE (statement_line_id IS NOT NULL);


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

CREATE INDEX account_move_stock_move_id_index ON public.account_move USING btree (stock_move_id) WHERE (stock_move_id IS NOT NULL);


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

CREATE INDEX account_move_tax_cash_basis_origin_move_id_index ON public.account_move USING btree (tax_cash_basis_origin_move_id) WHERE (tax_cash_basis_origin_move_id IS NOT NULL);


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

CREATE INDEX account_move_tax_cash_basis_rec_id_index ON public.account_move USING btree (tax_cash_basis_rec_id) WHERE (tax_cash_basis_rec_id IS NOT NULL);


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

CREATE INDEX account_move_to_check_idx ON public.account_move USING btree (journal_id) WHERE (to_check = true);


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

CREATE UNIQUE INDEX account_move_unique_name ON public.account_move USING btree (name, journal_id) WHERE (((state)::text = 'posted'::text) AND ((name)::text <> '/'::text));


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

CREATE INDEX account_partial_reconcile_credit_move_id_index ON public.account_partial_reconcile USING btree (credit_move_id);


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

CREATE INDEX account_partial_reconcile_debit_move_id_index ON public.account_partial_reconcile USING btree (debit_move_id);


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

CREATE INDEX account_partial_reconcile_exchange_move_id_index ON public.account_partial_reconcile USING btree (exchange_move_id) WHERE (exchange_move_id IS NOT NULL);


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

CREATE INDEX account_partial_reconcile_full_reconcile_id_index ON public.account_partial_reconcile USING btree (full_reconcile_id) WHERE (full_reconcile_id IS NOT NULL);


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

CREATE INDEX account_payment_account_bank__account_payment_id_account_ba_idx ON public.account_payment_account_bank_statement_line_rel USING btree (account_payment_id, account_bank_statement_line_id);


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

CREATE INDEX account_payment_move_id_index ON public.account_payment USING btree (move_id);


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

CREATE INDEX account_payment_paired_internal_transfer_payment_id_index ON public.account_payment USING btree (paired_internal_transfer_payment_id) WHERE (paired_internal_transfer_payment_id IS NOT NULL);


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

CREATE INDEX account_payment_register_move_line_rel_line_id_wizard_id_idx ON public.account_payment_register_move_line_rel USING btree (line_id, wizard_id);


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

CREATE INDEX account_payment_source_payment_id_index ON public.account_payment USING btree (source_payment_id) WHERE (source_payment_id IS NOT NULL);


--
-- 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_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__account_tax_template_id_accou_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_reconcile_model_line__account_tax_template_id_accou_idx ON public.account_reconcile_model_line_template_account_tax_template_rel USING btree (account_tax_template_id, account_reconcile_model_line_template_id);


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

CREATE INDEX account_reconcile_model_line_analytic_distribution_gin_index ON public.account_reconcile_model_line USING gin (analytic_distribution);


--
-- 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_reconcile_model_templ_res_partner_category_id_accou_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_reconcile_model_templ_res_partner_category_id_accou_idx ON public.account_reconcile_model_template_res_partner_category_rel USING btree (res_partner_category_id, account_reconcile_model_template_id);


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

CREATE INDEX account_reconcile_model_templ_res_partner_id_account_reconc_idx ON public.account_reconcile_model_template_res_partner_rel USING btree (res_partner_id, account_reconcile_model_template_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_hr_expense_split__account_tax_id_hr_expense_spl_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_tax_hr_expense_split__account_tax_id_hr_expense_spl_idx ON public.account_tax_hr_expense_split_rel USING btree (account_tax_id, hr_expense_split_id);


--
-- 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_rep_template_minu_account_report_expression_id__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_tax_rep_template_minu_account_report_expression_id__idx ON public.account_tax_rep_template_minus USING btree (account_report_expression_id, account_tax_repartition_line_template_id);


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

CREATE INDEX account_tax_rep_template_plus_account_report_expression_id__idx ON public.account_tax_rep_template_plus USING btree (account_report_expression_id, account_tax_repartition_line_template_id);


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

CREATE INDEX account_tax_repartition_finan_account_account_tag_id_accoun_idx ON public.account_tax_repartition_financial_tags USING btree (account_account_tag_id, account_tax_repartition_line_template_id);


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

CREATE INDEX account_tax_sale_advance_paym_account_tax_id_sale_advance_p_idx ON public.account_tax_sale_advance_payment_inv_rel USING btree (account_tax_id, sale_advance_payment_inv_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: account_tax_template_filiation_rel_child_tax_parent_tax_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX account_tax_template_filiation_rel_child_tax_parent_tax_idx ON public.account_tax_template_filiation_rel USING btree (child_tax, parent_tax);


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

CREATE INDEX account_tour_upload_bill_ir_a_ir_attachment_id_account_tour_idx ON public.account_tour_upload_bill_ir_attachments_rel USING btree (ir_attachment_id, account_tour_upload_bill_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: 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_opportunity_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX calendar_event_opportunity_id_index ON public.calendar_event USING btree (opportunity_id);


--
-- 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: chatbot_script_answer_chatbot_chatbot_script_answer_id_chat_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX chatbot_script_answer_chatbot_chatbot_script_answer_id_chat_idx ON public.chatbot_script_answer_chatbot_script_step_rel USING btree (chatbot_script_answer_id, chatbot_script_step_id);


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

CREATE INDEX crm_convert_lead_mass_lead_re_crm_lead_id_crm_lead2opportun_idx ON public.crm_convert_lead_mass_lead_rel USING btree (crm_lead_id, crm_lead2opportunity_partner_mass_id);


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

CREATE INDEX crm_iap_lead_industry_crm_iap_crm_iap_lead_industry_id_crm__idx ON public.crm_iap_lead_industry_crm_iap_lead_mining_request_rel USING btree (crm_iap_lead_industry_id, crm_iap_lead_mining_request_id);


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

CREATE INDEX crm_iap_lead_mining_request_c_crm_iap_lead_role_id_crm_iap__idx ON public.crm_iap_lead_mining_request_crm_iap_lead_role_rel USING btree (crm_iap_lead_role_id, crm_iap_lead_mining_request_id);


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

CREATE INDEX crm_iap_lead_mining_request_c_crm_tag_id_crm_iap_lead_minin_idx ON public.crm_iap_lead_mining_request_crm_tag_rel USING btree (crm_tag_id, crm_iap_lead_mining_request_id);


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

CREATE INDEX crm_iap_lead_mining_request_r_res_country_id_crm_iap_lead_m_idx ON public.crm_iap_lead_mining_request_res_country_rel USING btree (res_country_id, crm_iap_lead_mining_request_id);


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

CREATE INDEX crm_iap_lead_mining_request_r_res_country_state_id_crm_iap__idx ON public.crm_iap_lead_mining_request_res_country_state_rel USING btree (res_country_state_id, crm_iap_lead_mining_request_id);


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

CREATE INDEX crm_lead2opportunity_partner__res_users_id_crm_lead2opportu_idx ON public.crm_lead2opportunity_partner_mass_res_users_rel USING btree (res_users_id, crm_lead2opportunity_partner_mass_id);


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

CREATE INDEX crm_lead_company_id_index ON public.crm_lead USING btree (company_id);


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

CREATE INDEX crm_lead_create_date_team_id_idx ON public.crm_lead USING btree (create_date, team_id);


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

CREATE INDEX crm_lead_crm_lead2opportunity_crm_lead_id_crm_lead2opportu_idx1 ON public.crm_lead_crm_lead2opportunity_partner_mass_rel USING btree (crm_lead_id, crm_lead2opportunity_partner_mass_id);


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

CREATE INDEX crm_lead_crm_lead2opportunity_crm_lead_id_crm_lead2opportun_idx ON public.crm_lead_crm_lead2opportunity_partner_rel USING btree (crm_lead_id, crm_lead2opportunity_partner_id);


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

CREATE INDEX crm_lead_date_last_stage_update_index ON public.crm_lead USING btree (date_last_stage_update);


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

CREATE INDEX crm_lead_email_from_index ON public.crm_lead USING gin (email_from public.gin_trgm_ops);


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

CREATE INDEX crm_lead_lead_mining_request_id_index ON public.crm_lead USING btree (lead_mining_request_id) WHERE (lead_mining_request_id IS NOT NULL);


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

CREATE INDEX crm_lead_lost_reason_id_index ON public.crm_lead USING btree (lost_reason_id);


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

CREATE INDEX crm_lead_name_index ON public.crm_lead USING gin (name public.gin_trgm_ops);


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

CREATE INDEX crm_lead_partner_id_index ON public.crm_lead USING btree (partner_id);


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

CREATE INDEX crm_lead_pls_update_crm_lead__crm_lead_scoring_frequency_fi_idx ON public.crm_lead_pls_update_crm_lead_scoring_frequency_field_rel USING btree (crm_lead_scoring_frequency_field_id, crm_lead_pls_update_id);


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

CREATE INDEX crm_lead_priority_index ON public.crm_lead USING btree (priority);


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

CREATE INDEX crm_lead_scoring_frequency_variable_index ON public.crm_lead_scoring_frequency USING btree (variable);


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

CREATE INDEX crm_lead_stage_id_index ON public.crm_lead USING btree (stage_id);


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

CREATE INDEX crm_lead_team_id_index ON public.crm_lead USING btree (team_id);


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

CREATE INDEX crm_lead_type_index ON public.crm_lead USING btree (type);


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

CREATE INDEX crm_lead_user_id_index ON public.crm_lead USING btree (user_id);


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

CREATE INDEX crm_lead_user_id_team_id_type_index ON public.crm_lead USING btree (user_id, team_id, type);


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

CREATE INDEX crm_lead_website_visitor_rel_website_visitor_id_crm_lead_id_idx ON public.crm_lead_website_visitor_rel USING btree (website_visitor_id, crm_lead_id);


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

CREATE INDEX crm_tag_rel_tag_id_lead_id_idx ON public.crm_tag_rel USING btree (tag_id, lead_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: 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_emp_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX employee_category_rel_category_id_emp_id_idx ON public.employee_category_rel USING btree (category_id, emp_id);


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

CREATE INDEX expense_tax_tax_id_expense_id_idx ON public.expense_tax USING btree (tax_id, expense_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_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: hr_contract_date_start_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_contract_date_start_index ON public.hr_contract USING btree (date_start);


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

CREATE INDEX hr_contract_resource_calendar_id_index ON public.hr_contract USING btree (resource_calendar_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_mail_channel_re_hr_department_id_mail_channel_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_department_mail_channel_re_hr_department_id_mail_channel_idx ON public.hr_department_mail_channel_rel USING btree (hr_department_id, mail_channel_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_hr_plan_wizard_rel_plan_wizard_id_employee_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_employee_hr_plan_wizard_rel_plan_wizard_id_employee_id_idx ON public.hr_employee_hr_plan_wizard_rel USING btree (plan_wizard_id, employee_id);


--
-- 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_expense_analytic_distribution_gin_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX hr_expense_analytic_distribution_gin_index ON public.hr_expense USING gin (analytic_distribution);


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

CREATE INDEX hr_expense_approve_duplicate__hr_expense_sheet_id_hr_expens_idx ON public.hr_expense_approve_duplicate_hr_expense_sheet_rel USING btree (hr_expense_sheet_id, hr_expense_approve_duplicate_id);


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

CREATE INDEX hr_expense_hr_expense_approve_hr_expense_id_hr_expense_appr_idx ON public.hr_expense_hr_expense_approve_duplicate_rel USING btree (hr_expense_id, hr_expense_approve_duplicate_id);


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

CREATE INDEX hr_expense_hr_expense_refuse__hr_expense_id_hr_expense_refu_idx ON public.hr_expense_hr_expense_refuse_wizard_rel USING btree (hr_expense_id, hr_expense_refuse_wizard_id);


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

CREATE INDEX hr_expense_sheet_state_index ON public.hr_expense_sheet USING btree (state);


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

CREATE INDEX hr_expense_split_analytic_distribution_gin_index ON public.hr_expense_split USING gin (analytic_distribution);


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

CREATE INDEX hr_expense_state_index ON public.hr_expense USING btree (state);


--
-- 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: 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: im_livechat_channel_country_rel_country_id_channel_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX im_livechat_channel_country_rel_country_id_channel_id_idx ON public.im_livechat_channel_country_rel USING btree (country_id, channel_id);


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

CREATE INDEX im_livechat_channel_im_user_user_id_channel_id_idx ON public.im_livechat_channel_im_user USING btree (user_id, channel_id);


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

CREATE INDEX im_livechat_channel_is_published_index ON public.im_livechat_channel USING btree (is_published);


--
-- 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_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_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_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_checksum_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX ir_attachment_checksum_index ON public.ir_attachment USING btree (checksum);


--
-- 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_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_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_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_exports_resource_index; Type: INDEX; Schema: public; Owner: odoo
--

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


--
-- 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));


--
-- 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_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_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_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_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_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_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_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_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_profile_session_index; Type: INDEX; Schema: public; Owner: odoo
--

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


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

CREATE INDEX ir_property_company_id_index ON public.ir_property USING btree (company_id);


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

CREATE INDEX ir_property_name_index ON public.ir_property USING btree (name);


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

CREATE INDEX ir_property_res_id_index ON public.ir_property USING btree (res_id);


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

CREATE INDEX ir_property_type_index ON public.ir_property USING btree (type);


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

CREATE UNIQUE INDEX ir_property_unique_index ON public.ir_property USING btree (fields_id, COALESCE(company_id, 0), COALESCE(res_id, ''::character varying));


--
-- 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_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_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_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_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_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: 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_pickin_stock_picking_id_lot_label_la_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX lot_label_layout_stock_pickin_stock_picking_id_lot_label_la_idx ON public.lot_label_layout_stock_picking_rel USING btree (stock_picking_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_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_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_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_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_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_channel_livechat_channel_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_channel_livechat_channel_id_index ON public.mail_channel USING btree (livechat_channel_id) WHERE (livechat_channel_id IS NOT NULL);


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

CREATE INDEX mail_channel_livechat_visitor_id_index ON public.mail_channel USING btree (livechat_visitor_id) WHERE (livechat_visitor_id IS NOT NULL);


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

CREATE INDEX mail_channel_member_fetched_message_id_index ON public.mail_channel_member USING btree (fetched_message_id) WHERE (fetched_message_id IS NOT NULL);


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

CREATE INDEX mail_channel_member_guest_id_index ON public.mail_channel_member USING btree (guest_id);


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

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


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

CREATE INDEX mail_channel_member_partner_id_index ON public.mail_channel_member USING btree (partner_id);


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

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


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

CREATE INDEX mail_channel_member_seen_message_id_idx ON public.mail_channel_member USING btree (channel_id, partner_id, seen_message_id);


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

CREATE INDEX mail_channel_member_seen_message_id_index ON public.mail_channel_member USING btree (seen_message_id) WHERE (seen_message_id IS NOT NULL);


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

CREATE INDEX mail_channel_res_groups_rel_res_groups_id_mail_channel_id_idx ON public.mail_channel_res_groups_rel USING btree (res_groups_id, mail_channel_id);


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

CREATE INDEX mail_channel_rtc_session_write_date_index ON public.mail_channel_rtc_session USING btree (write_date);


--
-- 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_mailing__mailing_list_id_mail_compose__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_compose_message_mailing__mailing_list_id_mail_compose__idx ON public.mail_compose_message_mailing_list_rel USING btree (mailing_list_id, mail_compose_message_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_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_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_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_mass_mailing_list_rel_mailing_mailing_id_mailing_list__idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_mass_mailing_list_rel_mailing_mailing_id_mailing_list__idx ON public.mail_mass_mailing_list_rel USING btree (mailing_mailing_id, mailing_list_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_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_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);


--
-- 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_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_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_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_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_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_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_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_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_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_notification_sms_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mail_notification_sms_id_index ON public.mail_notification USING btree (sms_id) WHERE (sms_id IS NOT NULL);


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

CREATE INDEX mail_shortcode_source_index ON public.mail_shortcode USING gin (source public.gin_trgm_ops);


--
-- 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_template_model_index; Type: INDEX; Schema: public; Owner: odoo
--

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


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

CREATE INDEX mail_tracking_value_field_index ON public.mail_tracking_value USING btree (field);


--
-- 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 = 7835);


--
-- 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: mailing_contact_import_mailin_mailing_list_id_mailing_conta_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX mailing_contact_import_mailin_mailing_list_id_mailing_conta_idx ON public.mailing_contact_import_mailing_list_rel USING btree (mailing_list_id, mailing_contact_import_id);


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

CREATE INDEX mailing_contact_mailing_conta_mailing_contact_id_mailing_co_idx ON public.mailing_contact_mailing_contact_to_list_rel USING btree (mailing_contact_id, mailing_contact_to_list_id);


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

CREATE INDEX mailing_contact_res_partner_c_res_partner_category_id_maili_idx ON public.mailing_contact_res_partner_category_rel USING btree (res_partner_category_id, mailing_contact_id);


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

CREATE INDEX mailing_filter_create_uid_index ON public.mailing_filter USING btree (create_uid);


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

CREATE INDEX mailing_list_mailing_list_mer_mailing_list_id_mailing_list__idx ON public.mailing_list_mailing_list_merge_rel USING btree (mailing_list_id, mailing_list_merge_id);


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

CREATE INDEX mailing_mailing_campaign_id_index ON public.mailing_mailing USING btree (campaign_id);


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

CREATE INDEX mailing_trace_campaign_id_index ON public.mailing_trace USING btree (campaign_id) WHERE (campaign_id IS NOT NULL);


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

CREATE INDEX mailing_trace_mail_mail_id_index ON public.mailing_trace USING btree (mail_mail_id) WHERE (mail_mail_id IS NOT NULL);


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

CREATE INDEX mailing_trace_mail_mail_id_int_index ON public.mailing_trace USING btree (mail_mail_id_int) WHERE (mail_mail_id_int IS NOT NULL);


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

CREATE INDEX mailing_trace_mass_mailing_id_index ON public.mailing_trace USING btree (mass_mailing_id);


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

CREATE INDEX mass_mailing_ir_attachments_r_attachment_id_mass_mailing_id_idx ON public.mass_mailing_ir_attachments_rel USING btree (attachment_id, mass_mailing_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: merge_opportunity_rel_opportunity_id_merge_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX merge_opportunity_rel_opportunity_id_merge_id_idx ON public.merge_opportunity_rel USING btree (opportunity_id, merge_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: note_stage_rel_stage_id_note_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX note_stage_rel_stage_id_note_id_idx ON public.note_stage_rel USING btree (stage_id, note_id);


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

CREATE INDEX note_tags_rel_tag_id_note_id_idx ON public.note_tags_rel USING btree (tag_id, note_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_icon_payment_provider_payment_icon_id_payment_provi_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX payment_icon_payment_provider_payment_icon_id_payment_provi_idx ON public.payment_icon_payment_provider_rel USING btree (payment_icon_id, payment_provider_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: 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_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_sequence_index; Type: INDEX; Schema: public; Owner: odoo
--

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


--
-- 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_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_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_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_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_line_id_product_la_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_label_layout_stock_mo_stock_move_line_id_product_la_idx ON public.product_label_layout_stock_move_line_rel USING btree (stock_move_line_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_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_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_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_replenish_stock_route_stock_route_id_product_replen_idx; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_replenish_stock_route_stock_route_id_product_replen_idx ON public.product_replenish_stock_route_rel USING btree (stock_route_id, product_replenish_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_attribute_exclusion_product_template_attribute; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template_attribute_exclusion_product_template_attribute 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_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_value_id_ind; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX product_template_attribute_value_product_attribute_value_id_ind 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_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_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_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_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_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_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_ancestor_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task_ancestor_id_index ON public.project_task USING btree (ancestor_id) WHERE (ancestor_id IS NOT NULL);


--
-- 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_display_project_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX project_task_display_project_id_index ON public.project_task USING btree (display_project_id);


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

CREATE INDEX project_task_email_from_index ON public.project_task USING gin (email_from public.gin_trgm_ops);


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

CREATE INDEX project_task_is_closed_index ON public.project_task USING btree (is_closed);


--
-- 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_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_project_id_type_id_idx; Type: INDEX; Schema: public; Owner: odoo
--

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


--
-- 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_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_line_analytic_distribution_gin_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX purchase_order_line_analytic_distribution_gin_index ON public.purchase_order_line USING gin (analytic_distribution);


--
-- 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_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_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_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_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: 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: 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_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: 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_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_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_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_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_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_date_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner_date_index ON public.res_partner USING btree (date);


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

CREATE INDEX res_partner_display_name_index ON public.res_partner USING btree (display_name);


--
-- 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_ref_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX res_partner_ref_index ON public.res_partner USING btree (ref);


--
-- 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_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_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_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_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_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_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_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_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: 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_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_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_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_analytic_distribution_gin_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_line_analytic_distribution_gin_index ON public.sale_order_line USING gin (analytic_distribution);


--
-- 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_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_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_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_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_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_state_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX sale_order_state_index ON public.sale_order USING btree (state);


--
-- 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_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: 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: 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_move_analytic_account_line_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move_analytic_account_line_id_index ON public.stock_move USING btree (analytic_account_line_id) WHERE (analytic_account_line_id 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_created_purchase_line_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_move_created_purchase_line_id_index ON public.stock_move USING btree (created_purchase_line_id) WHERE (created_purchase_line_id IS NOT NULL);


--
-- 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_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_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 (reserved_qty > (0)::numeric));


--
-- 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_state_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_picking_state_index ON public.stock_picking USING btree (state);


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

CREATE INDEX stock_picking_transfer_rel_stock_picking_id_stock_immediate_idx ON public.stock_picking_transfer_rel USING btree (stock_picking_id, stock_immediate_transfer_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_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_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_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_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_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_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_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_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_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_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_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_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_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_warehouse_orderpoint_warehouse_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX stock_warehouse_orderpoint_warehouse_id_index ON public.stock_warehouse_orderpoint USING btree (warehouse_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: survey_invite_author_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX survey_invite_author_id_index ON public.survey_invite USING btree (author_id);


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

CREATE INDEX survey_invite_partner_ids_partner_id_invite_id_idx ON public.survey_invite_partner_ids USING btree (partner_id, invite_id);


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

CREATE INDEX survey_mail_compose_message_ir_atta_attachment_id_wizard_id_idx ON public.survey_mail_compose_message_ir_attachments_rel USING btree (attachment_id, wizard_id);


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

CREATE INDEX survey_question_survey_user_i_survey_question_id_survey_use_idx ON public.survey_question_survey_user_input_rel USING btree (survey_question_id, survey_user_input_id);


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

CREATE INDEX survey_user_input_line_user_input_id_index ON public.survey_user_input_line USING btree (user_input_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: 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_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_livechat_operator_id_index; Type: INDEX; Schema: public; Owner: odoo
--

CREATE INDEX website_visitor_livechat_operator_id_index ON public.website_visitor USING btree (livechat_operator_id) WHERE (livechat_operator_id IS NOT NULL);


--
-- 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: im_livechat_report_channel _RETURN; Type: RULE; Schema: public; Owner: odoo
--

CREATE OR REPLACE VIEW public.im_livechat_report_channel AS
 SELECT c.id,
    c.uuid,
    c.id AS channel_id,
    c.name AS channel_name,
    concat(l.name, ' / ', c.id) AS technical_name,
    c.livechat_channel_id,
    c.create_date AS start_date,
    to_char(date_trunc('hour'::text, c.create_date), 'YYYY-MM-DD HH24:MI:SS'::text) AS start_date_hour,
    to_char(date_trunc('hour'::text, c.create_date), 'HH24'::text) AS start_hour,
    EXTRACT(dow FROM c.create_date) AS day_number,
    EXTRACT(epoch FROM (max(m.create_date) - min(m.create_date))) AS duration,
    EXTRACT(epoch FROM (min(mo.create_date) - min(m.create_date))) AS time_to_answer,
    count(DISTINCT c.livechat_operator_id) AS nbr_speaker,
    count(DISTINCT m.id) AS nbr_message,
        CASE
            WHEN (EXISTS ( SELECT DISTINCT m_1.author_id
               FROM public.mail_message m_1
              WHERE ((m_1.author_id = c.livechat_operator_id) AND (m_1.res_id = c.id) AND ((m_1.model)::text = 'mail.channel'::text) AND (c.livechat_operator_id = m_1.author_id)))) THEN 0
            ELSE 1
        END AS is_without_answer,
    (date_part('day'::text, (date_trunc('day'::text, now()) - (date_trunc('day'::text, c.create_date))::timestamp with time zone)) + (1)::double precision) AS days_of_activity,
        CASE
            WHEN (c.anonymous_name IS NULL) THEN 0
            ELSE 1
        END AS is_anonymous,
    c.country_id,
        CASE
            WHEN (rate.rating = (5)::double precision) THEN 1
            ELSE 0
        END AS is_happy,
    rate.rating,
        CASE
            WHEN (rate.rating = (1)::double precision) THEN 'Unhappy'::text
            WHEN (rate.rating = (5)::double precision) THEN 'Happy'::text
            WHEN (rate.rating = (3)::double precision) THEN 'Neutral'::text
            ELSE NULL::text
        END AS rating_text,
        CASE
            WHEN (rate.rating > (0)::double precision) THEN 0
            ELSE 1
        END AS is_unrated,
    c.livechat_operator_id AS partner_id
   FROM ((((public.mail_channel c
     JOIN public.mail_message m ON (((m.res_id = c.id) AND ((m.model)::text = 'mail.channel'::text))))
     JOIN public.im_livechat_channel l ON ((l.id = c.livechat_channel_id)))
     LEFT JOIN public.mail_message mo ON (((mo.res_id = c.id) AND ((mo.model)::text = 'mail.channel'::text) AND (mo.author_id = c.livechat_operator_id))))
     LEFT JOIN public.rating_rating rate ON (((rate.res_id = c.id) AND ((rate.res_model)::text = 'mail.channel'::text) AND ((rate.parent_res_model)::text = 'im_livechat.channel'::text))))
  WHERE (c.livechat_operator_id IS NOT NULL)
  GROUP BY c.livechat_operator_id, c.id, c.name, c.livechat_channel_id, l.name, c.create_date, c.uuid, rate.rating;


--
-- Name: im_livechat_report_operator _RETURN; Type: RULE; Schema: public; Owner: odoo
--

CREATE OR REPLACE VIEW public.im_livechat_report_operator AS
 SELECT row_number() OVER () AS id,
    c.livechat_operator_id AS partner_id,
    c.livechat_channel_id,
    count(DISTINCT c.id) AS nbr_channel,
    c.id AS channel_id,
    c.create_date AS start_date,
    EXTRACT(epoch FROM (max(m.create_date) - min(m.create_date))) AS duration,
    EXTRACT(epoch FROM (min(mo.create_date) - min(m.create_date))) AS time_to_answer
   FROM ((public.mail_channel c
     JOIN public.mail_message m ON (((m.res_id = c.id) AND ((m.model)::text = 'mail.channel'::text))))
     LEFT JOIN public.mail_message mo ON (((mo.res_id = c.id) AND ((mo.model)::text = 'mail.channel'::text) AND (mo.author_id = c.livechat_operator_id))))
  WHERE (c.livechat_channel_id IS NOT NULL)
  GROUP BY c.id, c.livechat_operator_id;


--
-- Name: vendor_delay_report _RETURN; Type: RULE; Schema: public; Owner: odoo
--

CREATE OR REPLACE VIEW public.vendor_delay_report AS
 SELECT m.id,
    m.date,
    m.purchase_line_id,
    m.product_id,
    min(pc.id) AS category_id,
    min(po.partner_id) AS partner_id,
    min(m.product_qty) AS qty_total,
    sum(
        CASE
            WHEN (((m.state)::text = 'done'::text) AND ((pol.date_planned)::date >= (m.date)::date)) THEN ((ml.qty_done / 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.purchase_order po ON ((po.id = pol.order_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 m.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_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_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account
    ADD CONSTRAINT account_account_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(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 account_account_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account
    ADD CONSTRAINT account_account_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.account_group(id) ON DELETE SET NULL;


--
-- Name: account_account account_account_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account
    ADD CONSTRAINT account_account_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- 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_template_account_tag account_account_template_accou_account_account_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_template_account_tag
    ADD CONSTRAINT account_account_template_accou_account_account_template_id_fkey FOREIGN KEY (account_account_template_id) REFERENCES public.account_account_template(id) ON DELETE CASCADE;


--
-- Name: account_account_template_account_tag account_account_template_account_ta_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_template_account_tag
    ADD CONSTRAINT account_account_template_account_ta_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE CASCADE;


--
-- Name: account_account_template account_account_template_chart_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_template
    ADD CONSTRAINT account_account_template_chart_template_id_fkey FOREIGN KEY (chart_template_id) REFERENCES public.account_chart_template(id) ON DELETE SET NULL;


--
-- Name: account_account_template account_account_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_template
    ADD CONSTRAINT account_account_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_account_template account_account_template_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_template
    ADD CONSTRAINT account_account_template_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_account_template account_account_template_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_template
    ADD CONSTRAINT account_account_template_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: account_account_template_tax_rel account_account_template_tax_rel_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_template_tax_rel
    ADD CONSTRAINT account_account_template_tax_rel_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account_template(id) ON DELETE CASCADE;


--
-- Name: account_account_template_tax_rel account_account_template_tax_rel_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_template_tax_rel
    ADD CONSTRAINT account_account_template_tax_rel_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax_template(id) ON DELETE CASCADE;


--
-- Name: account_account_template account_account_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_template
    ADD CONSTRAINT account_account_template_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- 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_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_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(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_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_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_plan_id_fkey FOREIGN KEY (plan_id) REFERENCES public.account_analytic_plan(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 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_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_plan
    ADD CONSTRAINT account_analytic_plan_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(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_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_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_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_chart_template account_chart_template_account_journal_early_pay_discount__fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_account_journal_early_pay_discount__fkey FOREIGN KEY (account_journal_early_pay_discount_loss_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_account_journal_early_pay_discount_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_account_journal_early_pay_discount_fkey1 FOREIGN KEY (account_journal_early_pay_discount_gain_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_account_journal_payment_credit_acco_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_account_journal_payment_credit_acco_fkey FOREIGN KEY (account_journal_payment_credit_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_account_journal_payment_debit_accou_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_account_journal_payment_debit_accou_fkey FOREIGN KEY (account_journal_payment_debit_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_account_journal_suspense_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_account_journal_suspense_account_id_fkey FOREIGN KEY (account_journal_suspense_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE RESTRICT;


--
-- Name: account_chart_template account_chart_template_default_cash_difference_expense_acc_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_default_cash_difference_expense_acc_fkey FOREIGN KEY (default_cash_difference_expense_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_default_cash_difference_income_acco_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_default_cash_difference_income_acco_fkey FOREIGN KEY (default_cash_difference_income_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_default_pos_receivable_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_default_pos_receivable_account_id_fkey FOREIGN KEY (default_pos_receivable_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_expense_currency_exchange_account_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_expense_currency_exchange_account_i_fkey FOREIGN KEY (expense_currency_exchange_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_income_currency_exchange_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_income_currency_exchange_account_id_fkey FOREIGN KEY (income_currency_exchange_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.account_chart_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_property_account_expense_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_property_account_expense_categ_id_fkey FOREIGN KEY (property_account_expense_categ_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_property_account_expense_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_property_account_expense_id_fkey FOREIGN KEY (property_account_expense_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_property_account_income_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_property_account_income_categ_id_fkey FOREIGN KEY (property_account_income_categ_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_property_account_income_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_property_account_income_id_fkey FOREIGN KEY (property_account_income_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_property_account_payable_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_property_account_payable_id_fkey FOREIGN KEY (property_account_payable_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_property_account_receivable_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_property_account_receivable_id_fkey FOREIGN KEY (property_account_receivable_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_property_advance_tax_payment_accoun_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_property_advance_tax_payment_accoun_fkey FOREIGN KEY (property_advance_tax_payment_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_property_cash_basis_base_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_property_cash_basis_base_account_id_fkey FOREIGN KEY (property_cash_basis_base_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_property_stock_account_input_categ__fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_property_stock_account_input_categ__fkey FOREIGN KEY (property_stock_account_input_categ_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_property_stock_account_output_categ_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_property_stock_account_output_categ_fkey FOREIGN KEY (property_stock_account_output_categ_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_property_stock_valuation_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_property_stock_valuation_account_id_fkey FOREIGN KEY (property_stock_valuation_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_property_tax_payable_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_property_tax_payable_account_id_fkey FOREIGN KEY (property_tax_payable_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_property_tax_receivable_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_property_tax_receivable_account_id_fkey FOREIGN KEY (property_tax_receivable_account_id) REFERENCES public.account_account_template(id) ON DELETE SET NULL;


--
-- Name: account_chart_template account_chart_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_chart_template
    ADD CONSTRAINT account_chart_template_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_edi_document account_edi_document_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_document
    ADD CONSTRAINT account_edi_document_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: account_edi_document account_edi_document_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_document
    ADD CONSTRAINT account_edi_document_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_edi_document account_edi_document_edi_format_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_document
    ADD CONSTRAINT account_edi_document_edi_format_id_fkey FOREIGN KEY (edi_format_id) REFERENCES public.account_edi_format(id) ON DELETE RESTRICT;


--
-- Name: account_edi_document account_edi_document_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_document
    ADD CONSTRAINT account_edi_document_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_edi_document account_edi_document_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_document
    ADD CONSTRAINT account_edi_document_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_edi_format_account_journal_rel account_edi_format_account_journal_r_account_edi_format_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_format_account_journal_rel
    ADD CONSTRAINT account_edi_format_account_journal_r_account_edi_format_id_fkey FOREIGN KEY (account_edi_format_id) REFERENCES public.account_edi_format(id) ON DELETE CASCADE;


--
-- Name: account_edi_format_account_journal_rel account_edi_format_account_journal_rel_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_format_account_journal_rel
    ADD CONSTRAINT account_edi_format_account_journal_rel_account_journal_id_fkey FOREIGN KEY (account_journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_edi_format account_edi_format_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_format
    ADD CONSTRAINT account_edi_format_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_edi_format account_edi_format_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_format
    ADD CONSTRAINT account_edi_format_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_template account_fiscal_position_account_template_account_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account_template
    ADD CONSTRAINT account_fiscal_position_account_template_account_dest_id_fkey FOREIGN KEY (account_dest_id) REFERENCES public.account_account_template(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_account_template account_fiscal_position_account_template_account_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account_template
    ADD CONSTRAINT account_fiscal_position_account_template_account_src_id_fkey FOREIGN KEY (account_src_id) REFERENCES public.account_account_template(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_account_template account_fiscal_position_account_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account_template
    ADD CONSTRAINT account_fiscal_position_account_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_account_template account_fiscal_position_account_template_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account_template
    ADD CONSTRAINT account_fiscal_position_account_template_position_id_fkey FOREIGN KEY (position_id) REFERENCES public.account_fiscal_position_template(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_account_template account_fiscal_position_account_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account_template
    ADD CONSTRAINT account_fiscal_position_account_template_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_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_template account_fiscal_position_tax_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax_template
    ADD CONSTRAINT account_fiscal_position_tax_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_tax_template account_fiscal_position_tax_template_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax_template
    ADD CONSTRAINT account_fiscal_position_tax_template_position_id_fkey FOREIGN KEY (position_id) REFERENCES public.account_fiscal_position_template(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_tax_template account_fiscal_position_tax_template_tax_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax_template
    ADD CONSTRAINT account_fiscal_position_tax_template_tax_dest_id_fkey FOREIGN KEY (tax_dest_id) REFERENCES public.account_tax_template(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_tax_template account_fiscal_position_tax_template_tax_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax_template
    ADD CONSTRAINT account_fiscal_position_tax_template_tax_src_id_fkey FOREIGN KEY (tax_src_id) REFERENCES public.account_tax_template(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_tax_template account_fiscal_position_tax_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax_template
    ADD CONSTRAINT account_fiscal_position_tax_template_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- 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_template_res_country_state_rel account_fiscal_position_templ_account_fiscal_position_temp_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_template_res_country_state_rel
    ADD CONSTRAINT account_fiscal_position_templ_account_fiscal_position_temp_fkey FOREIGN KEY (account_fiscal_position_template_id) REFERENCES public.account_fiscal_position_template(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_template account_fiscal_position_template_chart_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_template
    ADD CONSTRAINT account_fiscal_position_template_chart_template_id_fkey FOREIGN KEY (chart_template_id) REFERENCES public.account_chart_template(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_template account_fiscal_position_template_country_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_template
    ADD CONSTRAINT account_fiscal_position_template_country_group_id_fkey FOREIGN KEY (country_group_id) REFERENCES public.res_country_group(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_template account_fiscal_position_template_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_template
    ADD CONSTRAINT account_fiscal_position_template_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_template account_fiscal_position_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_template
    ADD CONSTRAINT account_fiscal_position_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_template_res_country_state_rel account_fiscal_position_template_res__res_country_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_template_res_country_state_rel
    ADD CONSTRAINT account_fiscal_position_template_res__res_country_state_id_fkey FOREIGN KEY (res_country_state_id) REFERENCES public.res_country_state(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_template account_fiscal_position_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_template
    ADD CONSTRAINT account_fiscal_position_template_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_template account_group_template_chart_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_group_template
    ADD CONSTRAINT account_group_template_chart_template_id_fkey FOREIGN KEY (chart_template_id) REFERENCES public.account_chart_template(id) ON DELETE RESTRICT;


--
-- Name: account_group_template account_group_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_group_template
    ADD CONSTRAINT account_group_template_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_group_template account_group_template_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_group_template
    ADD CONSTRAINT account_group_template_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.account_group_template(id) ON DELETE CASCADE;


--
-- Name: account_group_template account_group_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_group_template
    ADD CONSTRAINT account_group_template_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- 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_send account_invoice_send_composer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_invoice_send
    ADD CONSTRAINT account_invoice_send_composer_id_fkey FOREIGN KEY (composer_id) REFERENCES public.mail_compose_message(id) ON DELETE CASCADE;


--
-- Name: account_invoice_send account_invoice_send_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_invoice_send
    ADD CONSTRAINT account_invoice_send_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_invoice_send account_invoice_send_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_invoice_send
    ADD CONSTRAINT account_invoice_send_template_id_fkey FOREIGN KEY (template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: account_invoice_send account_invoice_send_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_invoice_send
    ADD CONSTRAINT account_invoice_send_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_template_rel account_journal_account_recon_account_reconcile_model_temp_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_account_reconcile_model_template_rel
    ADD CONSTRAINT account_journal_account_recon_account_reconcile_model_temp_fkey FOREIGN KEY (account_reconcile_model_template_id) REFERENCES public.account_reconcile_model_template(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_template_rel account_journal_account_reconcile_mode_account_journal_id_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_account_reconcile_model_template_rel
    ADD CONSTRAINT account_journal_account_reconcile_mode_account_journal_id_fkey1 FOREIGN KEY (account_journal_id) REFERENCES public.account_journal(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 SET NULL;


--
-- 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 RESTRICT;


--
-- 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_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_message_main_attachment_id_fkey FOREIGN KEY (message_main_attachment_id) REFERENCES public.ir_attachment(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_sale_activity_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_sale_activity_type_id_fkey FOREIGN KEY (sale_activity_type_id) REFERENCES public.mail_activity_type(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_sale_activity_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_sale_activity_user_id_fkey FOREIGN KEY (sale_activity_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_journal account_journal_secure_sequence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_secure_sequence_id_fkey FOREIGN KEY (secure_sequence_id) REFERENCES public.ir_sequence(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_move_account_invoice_send_rel account_move_account_invoice_send__account_invoice_send_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_invoice_send_rel
    ADD CONSTRAINT account_move_account_invoice_send__account_invoice_send_id_fkey FOREIGN KEY (account_invoice_send_id) REFERENCES public.account_invoice_send(id) ON DELETE CASCADE;


--
-- Name: account_move_account_invoice_send_rel account_move_account_invoice_send_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_invoice_send_rel
    ADD CONSTRAINT account_move_account_invoice_send_rel_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 CASCADE;


--
-- 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_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_expense_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_expense_id_fkey FOREIGN KEY (expense_id) REFERENCES public.hr_expense(id) ON DELETE SET NULL;


--
-- 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_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 SET NULL;


--
-- 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_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment(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 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 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_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_destination_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_destination_journal_id_fkey FOREIGN KEY (destination_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- 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 CASCADE;


--
-- 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 CASCADE;


--
-- 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 CASCADE;


--
-- 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 SET NULL;


--
-- 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_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_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_template_account_tax_template_rel account_reconcile_model_line_account_reconcile_model_line_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line_template_account_tax_template_rel
    ADD CONSTRAINT account_reconcile_model_line_account_reconcile_model_line_fkey1 FOREIGN KEY (account_reconcile_model_line_template_id) REFERENCES public.account_reconcile_model_line_template(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_template_account_tax_template_rel account_reconcile_model_line_templ_account_tax_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line_template_account_tax_template_rel
    ADD CONSTRAINT account_reconcile_model_line_templ_account_tax_template_id_fkey FOREIGN KEY (account_tax_template_id) REFERENCES public.account_tax_template(id) ON DELETE RESTRICT;


--
