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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

CREATE INDEX product_category__property_stock_account_production_co_a9ab1a9e ON public.product_category USING btree (((property_stock_account_production_cost_id IS NOT NULL))) WHERE (property_stock_account_production_cost_id IS NOT NULL);


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

CREATE INDEX res_partner__property_account_receivable_id_index ON public.res_partner USING btree (((property_account_receivable_id IS NOT NULL))) WHERE (property_account_receivable_id IS NOT NULL);


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

CREATE INDEX res_partner__property_inbound_payment_method_line_id_index ON public.res_partner USING btree (((property_inbound_payment_method_line_id IS NOT NULL))) WHERE (property_inbound_payment_method_line_id IS NOT NULL);


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

CREATE INDEX res_partner__property_outbound_payment_method_line_id_index ON public.res_partner USING btree (((property_outbound_payment_method_line_id IS NOT NULL))) WHERE (property_outbound_payment_method_line_id IS NOT NULL);


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

CREATE INDEX res_partner__property_payment_term_id_index ON public.res_partner USING btree (((property_payment_term_id IS NOT NULL))) WHERE (property_payment_term_id IS NOT NULL);


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

CREATE INDEX res_partner__property_purchase_currency_id_index ON public.res_partner USING btree (((property_purchase_currency_id IS NOT NULL))) WHERE (property_purchase_currency_id IS NOT NULL);


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

CREATE INDEX res_partner__property_stock_customer_index ON public.res_partner USING btree (((property_stock_customer IS NOT NULL))) WHERE (property_stock_customer IS NOT NULL);


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

CREATE INDEX res_partner__property_stock_supplier_index ON public.res_partner USING btree (((property_stock_supplier IS NOT NULL))) WHERE (property_stock_supplier IS NOT NULL);


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

CREATE INDEX res_partner__property_supplier_payment_term_id_index ON public.res_partner USING btree (((property_supplier_payment_term_id IS NOT NULL))) WHERE (property_supplier_payment_term_id IS NOT NULL);


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

CREATE INDEX res_partner__receipt_reminder_email_index ON public.res_partner USING btree (((receipt_reminder_email IS NOT NULL))) WHERE (receipt_reminder_email IS NOT NULL);


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

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


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

CREATE INDEX res_partner__reminder_date_before_receipt_index ON public.res_partner USING btree (((reminder_date_before_receipt IS NOT NULL))) WHERE (reminder_date_before_receipt IS NOT NULL);


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

CREATE INDEX res_partner__specific_property_product_pricelist_index ON public.res_partner USING btree (((specific_property_product_pricelist IS NOT NULL))) WHERE (specific_property_product_pricelist IS NOT NULL);


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

CREATE INDEX res_partner__trust_index ON public.res_partner USING btree (((trust IS NOT NULL))) WHERE (trust IS NOT NULL);


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

CREATE INDEX res_partner__vat_index ON public.res_partner USING btree (vat);


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

CREATE INDEX res_partner__website_id_index ON public.res_partner USING btree (website_id);


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

CREATE INDEX res_partner_bank__partner_id_index ON public.res_partner_bank USING btree (partner_id);


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

CREATE INDEX res_partner_category__parent_id_index ON public.res_partner_category USING btree (parent_id);


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

CREATE INDEX res_partner_category__parent_path_index ON public.res_partner_category USING btree (parent_path);


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

CREATE INDEX res_partner_mobile_partial_gin_idx ON public.res_partner USING gin (regexp_replace((mobile)::text, '[\s\\./\(\)\-]'::text, ''::text, 'g'::text) public.gin_trgm_ops) WHERE (mobile IS NOT NULL);


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

CREATE INDEX res_partner_mobile_partial_tgm ON public.res_partner USING btree (regexp_replace((mobile)::text, '[\s\\./\(\)\-]'::text, ''::text, 'g'::text)) WHERE (mobile IS NOT NULL);


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

CREATE INDEX res_partner_phone_partial_gin_idx ON public.res_partner USING gin (regexp_replace((phone)::text, '[\s\\./\(\)\-]'::text, ''::text, 'g'::text) public.gin_trgm_ops) WHERE (phone IS NOT NULL);


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

CREATE INDEX res_partner_phone_partial_tgm ON public.res_partner USING btree (regexp_replace((phone)::text, '[\s\\./\(\)\-]'::text, ''::text, 'g'::text)) WHERE (phone IS NOT NULL);


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

CREATE INDEX res_partner_res_partner_category_rel_partner_id_category_id_idx ON public.res_partner_res_partner_category_rel USING btree (partner_id, category_id);


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

CREATE INDEX res_users__partner_id_index ON public.res_users USING btree (partner_id);


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

CREATE INDEX res_users__property_warehouse_id_index ON public.res_users USING btree (((property_warehouse_id IS NOT NULL))) WHERE (property_warehouse_id IS NOT NULL);


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

CREATE INDEX res_users_apikeys_user_id_index_idx ON public.res_users_apikeys USING btree (user_id, index);


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

CREATE INDEX res_users_settings__mute_until_dt_index ON public.res_users_settings USING btree (mute_until_dt);


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

CREATE INDEX res_users_settings_volumes__guest_id_index ON public.res_users_settings_volumes USING btree (guest_id);


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

CREATE INDEX res_users_settings_volumes__partner_id_index ON public.res_users_settings_volumes USING btree (partner_id);


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

CREATE INDEX res_users_settings_volumes__user_setting_id_index ON public.res_users_settings_volumes USING btree (user_setting_id);


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

CREATE UNIQUE INDEX res_users_settings_volumes_guest_unique ON public.res_users_settings_volumes USING btree (user_setting_id, guest_id) WHERE (guest_id IS NOT NULL);


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

CREATE UNIQUE INDEX res_users_settings_volumes_partner_unique ON public.res_users_settings_volumes USING btree (user_setting_id, partner_id) WHERE (partner_id IS NOT NULL);


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

CREATE INDEX res_users_web_tour_tour_rel_res_users_id_web_tour_tour_id_idx ON public.res_users_web_tour_tour_rel USING btree (res_users_id, web_tour_tour_id);


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

CREATE INDEX resource_calendar_attendance__dayofweek_index ON public.resource_calendar_attendance USING btree (dayofweek);


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

CREATE INDEX resource_calendar_attendance__hour_from_index ON public.resource_calendar_attendance USING btree (hour_from);


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

CREATE INDEX resource_calendar_leaves__calendar_id_index ON public.resource_calendar_leaves USING btree (calendar_id);


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

CREATE INDEX resource_calendar_leaves__resource_id_index ON public.resource_calendar_leaves USING btree (resource_id);


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

CREATE INDEX rule_group_rel_group_id_rule_group_id_idx ON public.rule_group_rel USING btree (group_id, rule_group_id);


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

CREATE INDEX sale_advance_payment_inv_sale_sale_order_id_sale_advance_pa_idx ON public.sale_advance_payment_inv_sale_order_rel USING btree (sale_order_id, sale_advance_payment_inv_id);


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

CREATE INDEX sale_order__campaign_id_index ON public.sale_order USING btree (campaign_id) WHERE (campaign_id IS NOT NULL);


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

CREATE INDEX sale_order__company_id_index ON public.sale_order USING btree (company_id);


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

CREATE INDEX sale_order__create_date_index ON public.sale_order USING btree (create_date);


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

CREATE INDEX sale_order__medium_id_index ON public.sale_order USING btree (medium_id) WHERE (medium_id IS NOT NULL);


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

CREATE INDEX sale_order__name_index ON public.sale_order USING gin (name public.gin_trgm_ops);


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

CREATE INDEX sale_order__partner_id_index ON public.sale_order USING btree (partner_id);


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

CREATE INDEX sale_order__partner_invoice_id_index ON public.sale_order USING btree (partner_invoice_id) WHERE (partner_invoice_id IS NOT NULL);


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

CREATE INDEX sale_order__partner_shipping_id_index ON public.sale_order USING btree (partner_shipping_id) WHERE (partner_shipping_id IS NOT NULL);


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

CREATE INDEX sale_order__project_id_index ON public.sale_order USING btree (project_id) WHERE (project_id IS NOT NULL);


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

CREATE INDEX sale_order__source_id_index ON public.sale_order USING btree (source_id) WHERE (source_id IS NOT NULL);


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

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


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

CREATE INDEX sale_order__team_id_index ON public.sale_order USING btree (team_id);


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

CREATE INDEX sale_order__user_id_index ON public.sale_order USING btree (user_id);


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

CREATE INDEX sale_order_cancel__author_id_index ON public.sale_order_cancel USING btree (author_id);


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

CREATE INDEX sale_order_date_order_id_idx ON public.sale_order USING btree (date_order DESC, id DESC);


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

CREATE INDEX sale_order_line__company_id_index ON public.sale_order_line USING btree (company_id);


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

CREATE INDEX sale_order_line__linked_line_id_index ON public.sale_order_line USING btree (linked_line_id);


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

CREATE INDEX sale_order_line__order_id_index ON public.sale_order_line USING btree (order_id);


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

CREATE INDEX sale_order_line__order_partner_id_index ON public.sale_order_line USING btree (order_partner_id);


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

CREATE INDEX sale_order_line__product_id_index ON public.sale_order_line USING btree (product_id) WHERE (product_id IS NOT NULL);


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

CREATE INDEX sale_order_line__project_id_index ON public.sale_order_line USING btree (project_id);


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

CREATE INDEX sale_order_line__task_id_index ON public.sale_order_line USING btree (task_id);


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

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


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

CREATE INDEX sale_order_line_invoice_rel_order_line_id_invoice_line_id_idx ON public.sale_order_line_invoice_rel USING btree (order_line_id, invoice_line_id);


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

CREATE INDEX sale_order_line_name_search_services_index ON public.sale_order_line USING btree (order_id DESC, sequence, id) WHERE (is_service = true);


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

CREATE INDEX sale_order_line_product_docum_product_document_id_sale_orde_idx ON public.sale_order_line_product_document_rel USING btree (product_document_id, sale_order_line_id);


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

CREATE INDEX sale_order_mass_cancel_wizard_sale_order_id_sale_mass_cance_idx ON public.sale_order_mass_cancel_wizard_rel USING btree (sale_order_id, sale_mass_cancel_orders_id);


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

CREATE INDEX sale_order_option__order_id_index ON public.sale_order_option USING btree (order_id);


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

CREATE INDEX sale_order_tag_rel_tag_id_order_id_idx ON public.sale_order_tag_rel USING btree (tag_id, order_id);


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

CREATE INDEX sale_order_template__journal_id_index ON public.sale_order_template USING btree (((journal_id IS NOT NULL))) WHERE (journal_id IS NOT NULL);


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

CREATE INDEX sale_order_template_line__company_id_index ON public.sale_order_template_line USING btree (company_id);


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

CREATE INDEX sale_order_template_line__sale_order_template_id_index ON public.sale_order_template_line USING btree (sale_order_template_id);


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

CREATE INDEX sale_order_template_option__company_id_index ON public.sale_order_template_option USING btree (company_id);


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

CREATE INDEX sale_order_template_option__sale_order_template_id_index ON public.sale_order_template_option USING btree (sale_order_template_id);


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

CREATE INDEX sale_order_transaction_rel_sale_order_id_transaction_id_idx ON public.sale_order_transaction_rel USING btree (sale_order_id, transaction_id);


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

CREATE INDEX scheduled_message_attachment__attachment_id_scheduled_messa_idx ON public.scheduled_message_attachment_rel USING btree (attachment_id, scheduled_message_id);


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

CREATE INDEX sms_sms__mail_message_id_index ON public.sms_sms USING btree (mail_message_id);


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

CREATE INDEX sms_template__model_index ON public.sms_template USING btree (model);


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

CREATE INDEX sms_template_sms_template_res_sms_template_id_sms_template__idx ON public.sms_template_sms_template_reset_rel USING btree (sms_template_id, sms_template_reset_id);


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

CREATE INDEX snailmail_letter__attachment_id_index ON public.snailmail_letter USING btree (attachment_id) WHERE (attachment_id IS NOT NULL);


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

CREATE INDEX snailmail_letter__message_id_index ON public.snailmail_letter USING btree (message_id) WHERE (message_id IS NOT NULL);


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

CREATE INDEX stock_conflict_quant_rel_stock_quant_id_stock_inventory_con_idx ON public.stock_conflict_quant_rel USING btree (stock_quant_id, stock_inventory_conflict_id);


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

CREATE INDEX stock_inventory_adjustment_na_stock_quant_id_stock_inventor_idx ON public.stock_inventory_adjustment_name_stock_quant_rel USING btree (stock_quant_id, stock_inventory_adjustment_name_id);


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

CREATE INDEX stock_inventory_conflict_stoc_stock_quant_id_stock_inventor_idx ON public.stock_inventory_conflict_stock_quant_rel USING btree (stock_quant_id, stock_inventory_conflict_id);


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

CREATE INDEX stock_inventory_warning_stock_stock_quant_id_stock_inventor_idx ON public.stock_inventory_warning_stock_quant_rel USING btree (stock_quant_id, stock_inventory_warning_id);


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

CREATE INDEX stock_location__company_id_index ON public.stock_location USING btree (company_id);


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

CREATE INDEX stock_location__location_id_index ON public.stock_location USING btree (location_id);


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

CREATE INDEX stock_location__parent_path_index ON public.stock_location USING btree (parent_path);


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

CREATE INDEX stock_location__usage_index ON public.stock_location USING btree (usage);


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

CREATE INDEX stock_lot__company_id_index ON public.stock_lot USING btree (company_id);


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

CREATE INDEX stock_lot__name_index ON public.stock_lot USING gin (name public.gin_trgm_ops);


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

CREATE INDEX stock_lot__product_id_index ON public.stock_lot USING btree (product_id);


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

CREATE INDEX stock_lot__standard_price_index ON public.stock_lot USING btree (((standard_price IS NOT NULL))) WHERE (standard_price IS NOT NULL);


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

CREATE INDEX stock_move__company_id_index ON public.stock_move USING btree (company_id);


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

CREATE INDEX stock_move__created_production_id_index ON public.stock_move USING btree (created_production_id);


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

CREATE INDEX stock_move__date_index ON public.stock_move USING btree (date);


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

CREATE INDEX stock_move__group_id_index ON public.stock_move USING btree (group_id);


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

CREATE INDEX stock_move__location_dest_id_index ON public.stock_move USING btree (location_dest_id);


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

CREATE INDEX stock_move__location_final_id_index ON public.stock_move USING btree (location_final_id);


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

CREATE INDEX stock_move__location_id_index ON public.stock_move USING btree (location_id);


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

CREATE INDEX stock_move__order_finished_lot_id_index ON public.stock_move USING btree (order_finished_lot_id) WHERE (order_finished_lot_id IS NOT NULL);


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

CREATE INDEX stock_move__orderpoint_id_index ON public.stock_move USING btree (orderpoint_id);


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

CREATE INDEX stock_move__origin_returned_move_id_index ON public.stock_move USING btree (origin_returned_move_id);


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

CREATE INDEX stock_move__partner_id_index ON public.stock_move USING btree (partner_id) WHERE (partner_id IS NOT NULL);


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

CREATE INDEX stock_move__picking_id_index ON public.stock_move USING btree (picking_id);


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

CREATE INDEX stock_move__product_id_index ON public.stock_move USING btree (product_id);


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

CREATE INDEX stock_move__production_id_index ON public.stock_move USING btree (production_id) WHERE (production_id IS NOT NULL);


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

CREATE INDEX stock_move__raw_material_production_id_index ON public.stock_move USING btree (raw_material_production_id) WHERE (raw_material_production_id IS NOT NULL);


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

CREATE INDEX stock_move__repair_line_type_index ON public.stock_move USING btree (repair_line_type);


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

CREATE INDEX stock_move__restrict_partner_id_index ON public.stock_move USING btree (restrict_partner_id) WHERE (restrict_partner_id IS NOT NULL);


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

CREATE INDEX stock_move__sale_line_id_index ON public.stock_move USING btree (sale_line_id) WHERE (sale_line_id IS NOT NULL);


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

CREATE INDEX stock_move__state_index ON public.stock_move USING btree (state);


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

CREATE INDEX stock_move__workorder_id_index ON public.stock_move USING btree (workorder_id) WHERE (workorder_id IS NOT NULL);


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

CREATE INDEX stock_move_created_purchase_l_move_id_created_purchase_line_idx ON public.stock_move_created_purchase_line_rel USING btree (move_id, created_purchase_line_id);


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

CREATE INDEX stock_move_line__company_id_index ON public.stock_move_line USING btree (company_id);


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

CREATE INDEX stock_move_line__lot_id_index ON public.stock_move_line USING btree (lot_id);


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

CREATE INDEX stock_move_line__move_id_index ON public.stock_move_line USING btree (move_id);


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

CREATE INDEX stock_move_line__owner_id_index ON public.stock_move_line USING btree (owner_id) WHERE (owner_id IS NOT NULL);


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

CREATE INDEX stock_move_line__picking_id_index ON public.stock_move_line USING btree (picking_id);


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

CREATE INDEX stock_move_line__product_id_index ON public.stock_move_line USING btree (product_id);


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

CREATE INDEX stock_move_line_consume_rel_produce_line_id_consume_line_id_idx ON public.stock_move_line_consume_rel USING btree (produce_line_id, consume_line_id);


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

CREATE INDEX stock_move_line_free_reservation_index ON public.stock_move_line USING btree (id, company_id, product_id, lot_id, location_id, owner_id, package_id) WHERE (((state IS NULL) OR ((state)::text <> ALL ((ARRAY['cancel'::character varying, 'done'::character varying])::text[]))) AND (quantity_product_uom > (0)::numeric) AND (NOT picked));


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

CREATE INDEX stock_move_move_rel_move_dest_id_move_orig_id_idx ON public.stock_move_move_rel USING btree (move_dest_id, move_orig_id);


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

CREATE INDEX stock_move_product_location_index ON public.stock_move USING btree (product_id, location_id, location_dest_id, company_id, state);


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

CREATE INDEX stock_orderpoint_snooze_stock_stock_warehouse_orderpoint_id_idx ON public.stock_orderpoint_snooze_stock_warehouse_orderpoint_rel USING btree (stock_warehouse_orderpoint_id, stock_orderpoint_snooze_id);


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

CREATE INDEX stock_package_level__company_id_index ON public.stock_package_level USING btree (company_id);


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

CREATE INDEX stock_package_type__company_id_index ON public.stock_package_type USING btree (company_id);


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

CREATE INDEX stock_package_type_stock_puta_stock_package_type_id_stock_p_idx ON public.stock_package_type_stock_putaway_rule_rel USING btree (stock_package_type_id, stock_putaway_rule_id);


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

CREATE INDEX stock_picking__backorder_id_index ON public.stock_picking USING btree (backorder_id) WHERE (backorder_id IS NOT NULL);


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

CREATE INDEX stock_picking__company_id_index ON public.stock_picking USING btree (company_id);


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

CREATE INDEX stock_picking__name_index ON public.stock_picking USING gin (name public.gin_trgm_ops);


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

CREATE INDEX stock_picking__origin_index ON public.stock_picking USING gin (origin public.gin_trgm_ops);


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

CREATE INDEX stock_picking__owner_id_index ON public.stock_picking USING btree (owner_id) WHERE (owner_id IS NOT NULL);


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

CREATE INDEX stock_picking__partner_id_index ON public.stock_picking USING btree (partner_id) WHERE (partner_id IS NOT NULL);


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

CREATE INDEX stock_picking__picking_type_id_index ON public.stock_picking USING btree (picking_type_id);


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

CREATE INDEX stock_picking__return_id_index ON public.stock_picking USING btree (return_id) WHERE (return_id IS NOT NULL);


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

CREATE INDEX stock_picking__sale_id_index ON public.stock_picking USING btree (sale_id) WHERE (sale_id IS NOT NULL);


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

CREATE INDEX stock_picking__scheduled_date_index ON public.stock_picking USING btree (scheduled_date);


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

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


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

CREATE INDEX stock_picking_backorder_rel_stock_picking_id_stock_backorde_idx ON public.stock_picking_backorder_rel USING btree (stock_picking_id, stock_backorder_confirmation_id);


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

CREATE INDEX stock_picking_sms_rel_stock_picking_id_confirm_stock_sms_id_idx ON public.stock_picking_sms_rel USING btree (stock_picking_id, confirm_stock_sms_id);


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

CREATE INDEX stock_picking_type__company_id_index ON public.stock_picking_type USING btree (company_id);


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

CREATE INDEX stock_putaway_rule__company_id_index ON public.stock_putaway_rule USING btree (company_id);


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

CREATE INDEX stock_putaway_rule__location_in_id_index ON public.stock_putaway_rule USING btree (location_in_id);


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

CREATE INDEX stock_quant__location_id_index ON public.stock_quant USING btree (location_id);


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

CREATE INDEX stock_quant__lot_id_index ON public.stock_quant USING btree (lot_id);


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

CREATE INDEX stock_quant__owner_id_index ON public.stock_quant USING btree (owner_id) WHERE (owner_id IS NOT NULL);


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

CREATE INDEX stock_quant__package_id_index ON public.stock_quant USING btree (package_id);


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

CREATE INDEX stock_quant__product_id_index ON public.stock_quant USING btree (product_id);


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

CREATE INDEX stock_quant_package__company_id_index ON public.stock_quant_package USING btree (company_id);


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

CREATE INDEX stock_quant_package__location_id_index ON public.stock_quant_package USING btree (location_id);


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

CREATE INDEX stock_quant_package__name_index ON public.stock_quant_package USING gin (name public.gin_trgm_ops);


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

CREATE INDEX stock_quant_package__package_type_id_index ON public.stock_quant_package USING btree (package_type_id);


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

CREATE INDEX stock_quant_stock_quant_reloc_stock_quant_id_stock_quant_re_idx ON public.stock_quant_stock_quant_relocate_rel USING btree (stock_quant_id, stock_quant_relocate_id);


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

CREATE INDEX stock_quant_stock_request_cou_stock_quant_id_stock_request__idx ON public.stock_quant_stock_request_count_rel USING btree (stock_quant_id, stock_request_count_id);


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

CREATE INDEX stock_quant_stock_track_confi_stock_quant_id_stock_track_co_idx ON public.stock_quant_stock_track_confirmation_rel USING btree (stock_quant_id, stock_track_confirmation_id);


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

CREATE INDEX stock_route__company_id_index ON public.stock_route USING btree (company_id);


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

CREATE INDEX stock_route_categ_categ_id_route_id_idx ON public.stock_route_categ USING btree (categ_id, route_id);


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

CREATE INDEX stock_route_move_route_id_move_id_idx ON public.stock_route_move USING btree (route_id, move_id);


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

CREATE INDEX stock_route_packaging_packaging_id_route_id_idx ON public.stock_route_packaging USING btree (packaging_id, route_id);


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

CREATE INDEX stock_route_product_product_id_route_id_idx ON public.stock_route_product USING btree (product_id, route_id);


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

CREATE INDEX stock_route_stock_rules_repor_stock_route_id_stock_rules_re_idx ON public.stock_route_stock_rules_report_rel USING btree (stock_route_id, stock_rules_report_id);


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

CREATE INDEX stock_route_warehouse_warehouse_id_route_id_idx ON public.stock_route_warehouse USING btree (warehouse_id, route_id);


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

CREATE INDEX stock_rule__action_index ON public.stock_rule USING btree (action);


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

CREATE INDEX stock_rule__company_id_index ON public.stock_rule USING btree (company_id);


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

CREATE INDEX stock_rule__location_dest_id_index ON public.stock_rule USING btree (location_dest_id);


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

CREATE INDEX stock_rule__location_src_id_index ON public.stock_rule USING btree (location_src_id);


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

CREATE INDEX stock_rule__route_id_index ON public.stock_rule USING btree (route_id);


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

CREATE INDEX stock_rule__warehouse_id_index ON public.stock_rule USING btree (warehouse_id);


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

CREATE INDEX stock_rules_report_stock_ware_stock_warehouse_id_stock_rule_idx ON public.stock_rules_report_stock_warehouse_rel USING btree (stock_warehouse_id, stock_rules_report_id);


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

CREATE INDEX stock_scrap_stock_scrap_reaso_stock_scrap_reason_tag_id_sto_idx ON public.stock_scrap_stock_scrap_reason_tag_rel USING btree (stock_scrap_reason_tag_id, stock_scrap_id);


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

CREATE INDEX stock_storage_category_capacity__storage_category_id_index ON public.stock_storage_category_capacity USING btree (storage_category_id);


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

CREATE INDEX stock_valuation_company_product_index ON public.stock_valuation_layer USING btree (product_id, company_id, id, value, quantity);


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

CREATE INDEX stock_valuation_layer__account_move_id_index ON public.stock_valuation_layer USING btree (account_move_id) WHERE (account_move_id IS NOT NULL);


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

CREATE INDEX stock_valuation_layer__account_move_line_id_index ON public.stock_valuation_layer USING btree (account_move_line_id) WHERE (account_move_line_id IS NOT NULL);


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

CREATE INDEX stock_valuation_layer__lot_id_index ON public.stock_valuation_layer USING btree (lot_id);


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

CREATE INDEX stock_valuation_layer__stock_move_id_index ON public.stock_valuation_layer USING btree (stock_move_id);


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

CREATE INDEX stock_valuation_layer__stock_valuation_layer_id_index ON public.stock_valuation_layer USING btree (stock_valuation_layer_id);


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

CREATE INDEX stock_valuation_layer_index ON public.stock_valuation_layer USING btree (product_id, remaining_qty, stock_move_id, company_id, create_date);


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

CREATE INDEX stock_valuation_layer_stock_v_stock_valuation_layer_id_stoc_idx ON public.stock_valuation_layer_stock_valuation_layer_revaluation_rel USING btree (stock_valuation_layer_id, stock_valuation_layer_revaluation_id);


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

CREATE INDEX stock_warehouse_orderpoint__company_id_index ON public.stock_warehouse_orderpoint USING btree (company_id);


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

CREATE INDEX stock_warehouse_orderpoint__location_id_index ON public.stock_warehouse_orderpoint USING btree (location_id);


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

CREATE INDEX stock_wh_resupply_table_supplier_wh_id_supplied_wh_id_idx ON public.stock_wh_resupply_table USING btree (supplier_wh_id, supplied_wh_id);


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

CREATE INDEX task_dependencies_rel_depends_on_id_task_id_idx ON public.task_dependencies_rel USING btree (depends_on_id, task_id);


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

CREATE INDEX team_favorite_user_rel_user_id_team_id_idx ON public.team_favorite_user_rel USING btree (user_id, team_id);


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

CREATE INDEX template_attribute_value_mrp__template_attribute_value_id_p_idx ON public.template_attribute_value_mrp_production_rel USING btree (template_attribute_value_id, production_id);


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

CREATE INDEX template_attribute_value_stoc_template_attribute_value_id_m_idx ON public.template_attribute_value_stock_move_rel USING btree (template_attribute_value_id, move_id);


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

CREATE INDEX theme_website_menu__parent_id_index ON public.theme_website_menu USING btree (parent_id);


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

CREATE UNIQUE INDEX unique_mail_message_id_res_partner_id_if_set ON public.mail_notification USING btree (mail_message_id, res_partner_id) WHERE (res_partner_id IS NOT NULL);


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

CREATE INDEX utm_tag_rel_campaign_id_tag_id_idx ON public.utm_tag_rel USING btree (campaign_id, tag_id);


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

CREATE INDEX website_controller_page__is_published_index ON public.website_controller_page USING btree (is_published);


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

CREATE INDEX website_controller_page__website_id_index ON public.website_controller_page USING btree (website_id);


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

CREATE INDEX website_lang_rel_lang_id_website_id_idx ON public.website_lang_rel USING btree (lang_id, website_id);


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

CREATE INDEX website_menu__parent_id_index ON public.website_menu USING btree (parent_id);


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

CREATE INDEX website_menu__parent_path_index ON public.website_menu USING btree (parent_path);


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

CREATE INDEX website_page__is_published_index ON public.website_page USING btree (is_published);


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

CREATE INDEX website_page__website_id_index ON public.website_page USING btree (website_id);


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

CREATE INDEX website_rewrite__url_from_index ON public.website_rewrite USING btree (url_from);


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

CREATE INDEX website_rewrite__website_id_index ON public.website_rewrite USING btree (website_id);


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

CREATE INDEX website_snippet_filter__is_published_index ON public.website_snippet_filter USING btree (is_published);


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

CREATE INDEX website_snippet_filter__website_id_index ON public.website_snippet_filter USING btree (website_id);


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

CREATE INDEX website_track__page_id_index ON public.website_track USING btree (page_id);


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

CREATE INDEX website_track__url_index ON public.website_track USING btree (url);


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

CREATE INDEX website_track__visitor_id_index ON public.website_track USING btree (visitor_id);


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

CREATE INDEX website_visitor__partner_id_index ON public.website_visitor USING btree (partner_id) WHERE (partner_id IS NOT NULL);


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

CREATE OR REPLACE VIEW public.report_project_task_user AS
 SELECT ( SELECT 1) AS nbr,
    t.id,
    t.id AS task_id,
    t.active,
    t.create_date,
    t.date_assign,
    t.date_end,
    t.date_last_stage_update,
    t.date_deadline,
    t.project_id,
    t.priority,
    t.name,
    t.company_id,
    t.partner_id,
    t.parent_id,
    t.stage_id,
    t.state,
    t.milestone_id,
        CASE
            WHEN ((t.state)::text = ANY ((ARRAY['1_done'::character varying, '1_canceled'::character varying])::text[])) THEN true
            ELSE false
        END AS is_closed,
        CASE
            WHEN (pm.id IS NOT NULL) THEN true
            ELSE false
        END AS has_late_and_unreached_milestone,
    t.description,
    NULLIF(t.rating_last_value, (0)::double precision) AS rating_last_value,
    avg(rt.rating) AS rating_avg,
    NULLIF(t.working_days_close, (0)::double precision) AS working_days_close,
    NULLIF(t.working_days_open, (0)::double precision) AS working_days_open,
    NULLIF(t.working_hours_open, (0)::numeric) AS working_hours_open,
    NULLIF(t.working_hours_close, (0)::numeric) AS working_hours_close,
    (EXTRACT(epoch FROM (t.date_deadline - (now() AT TIME ZONE 'UTC'::text))) / ((3600 * 24))::numeric) AS delay_endings_days,
    count(td.task_id) AS dependent_ids_count,
    t.sale_line_id,
    t.sale_order_id
   FROM (((public.project_task t
     LEFT JOIN public.rating_rating rt ON (((rt.res_id = t.id) AND ((rt.res_model)::text = 'project.task'::text) AND (rt.consumed = true) AND (rt.rating >= (1)::double precision))))
     LEFT JOIN public.project_milestone pm ON (((pm.id = t.milestone_id) AND (pm.is_reached = false) AND (pm.deadline <= (now())::date))))
     LEFT JOIN public.task_dependencies_rel td ON ((td.depends_on_id = t.id)))
  WHERE (t.project_id IS NOT NULL)
  GROUP BY t.id, t.active, t.create_date, t.date_assign, t.date_end, t.date_last_stage_update, t.date_deadline, t.project_id, t.priority, t.name, t.company_id, t.partner_id, t.parent_id, t.stage_id, t.state, t.rating_last_value, t.working_days_close, t.working_days_open, t.working_hours_open, t.working_hours_close, t.milestone_id, pm.id, td.depends_on_id, t.sale_line_id, t.sale_order_id;


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

CREATE OR REPLACE VIEW public.vendor_delay_report AS
 SELECT pol.id,
    min(m.date) AS date,
    pol.id AS purchase_line_id,
    pol.product_id,
    min(pc.id) AS category_id,
    pol.partner_id,
    pol.product_uom_qty AS qty_total,
    sum(
        CASE
            WHEN (((m.state)::text = 'done'::text) AND ((pol.date_planned)::date >= (m.date)::date)) THEN ((ml.quantity / ml_uom.factor) * pt_uom.factor)
            ELSE (0)::numeric
        END) AS qty_on_time
   FROM (((((((public.stock_move m
     JOIN public.purchase_order_line pol ON ((pol.id = m.purchase_line_id)))
     JOIN public.product_product p ON ((p.id = m.product_id)))
     JOIN public.product_template pt ON ((pt.id = p.product_tmpl_id)))
     JOIN public.uom_uom pt_uom ON ((pt_uom.id = pt.uom_id)))
     JOIN public.product_category pc ON ((pc.id = pt.categ_id)))
     LEFT JOIN public.stock_move_line ml ON ((ml.move_id = m.id)))
     LEFT JOIN public.uom_uom ml_uom ON ((ml_uom.id = ml.product_uom_id)))
  GROUP BY pol.id;


--
-- Name: account_account_account_journal_rel account_account_account_journal_rel_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_journal_rel
    ADD CONSTRAINT account_account_account_journal_rel_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_account_journal_rel account_account_account_journal_rel_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_account_account_merge_wizard_rel account_account_account_merge_wiza_account_merge_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_merge_wizard_rel
    ADD CONSTRAINT account_account_account_merge_wiza_account_merge_wizard_id_fkey FOREIGN KEY (account_merge_wizard_id) REFERENCES public.account_merge_wizard(id) ON DELETE CASCADE;


--
-- Name: account_account_account_merge_wizard_rel account_account_account_merge_wizard_re_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_merge_wizard_rel
    ADD CONSTRAINT account_account_account_merge_wizard_re_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_account_tag account_account_account_tag_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_tag
    ADD CONSTRAINT account_account_account_tag_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_account_tag account_account_account_tag_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_account_tag
    ADD CONSTRAINT account_account_account_tag_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE RESTRICT;


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

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


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

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


--
-- Name: account_account_res_company_rel account_account_res_company_rel_account_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_res_company_rel
    ADD CONSTRAINT account_account_res_company_rel_account_account_id_fkey FOREIGN KEY (account_account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_res_company_rel account_account_res_company_rel_res_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_res_company_rel
    ADD CONSTRAINT account_account_res_company_rel_res_company_id_fkey FOREIGN KEY (res_company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_account_tag_account_move_line_rel account_account_tag_account_move_li_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_account_move_line_rel
    ADD CONSTRAINT account_account_tag_account_move_li_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE RESTRICT;


--
-- Name: account_account_tag_account_move_line_rel account_account_tag_account_move_line_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_account_move_line_rel
    ADD CONSTRAINT account_account_tag_account_move_line_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_account_tag_account_tax_repartition_line_rel account_account_tag_account_t_account_tax_repartition_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_account_tax_repartition_line_rel
    ADD CONSTRAINT account_account_tag_account_t_account_tax_repartition_line_fkey FOREIGN KEY (account_tax_repartition_line_id) REFERENCES public.account_tax_repartition_line(id) ON DELETE CASCADE;


--
-- Name: account_account_tag_account_tax_repartition_line_rel account_account_tag_account_tax_rep_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_account_tax_repartition_line_rel
    ADD CONSTRAINT account_account_tag_account_tax_rep_account_account_tag_id_fkey FOREIGN KEY (account_account_tag_id) REFERENCES public.account_account_tag(id) ON DELETE RESTRICT;


--
-- Name: account_account_tag account_account_tag_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_account_tag account_account_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_account_tag_product_template_rel account_account_tag_product_templat_account_account_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_account_tag_product_template_rel account_account_tag_product_template_r_product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tag_product_template_rel
    ADD CONSTRAINT account_account_tag_product_template_r_product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: account_account_tag account_account_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_account_tax_default_rel account_account_tax_default_rel_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tax_default_rel
    ADD CONSTRAINT account_account_tax_default_rel_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_account_tax_default_rel account_account_tax_default_rel_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_account_tax_default_rel
    ADD CONSTRAINT account_account_tax_default_rel_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


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

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_accrued_orders_wizard
    ADD CONSTRAINT account_accrued_orders_wizard_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_accrued_orders_wizard
    ADD CONSTRAINT account_accrued_orders_wizard_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_accrued_orders_wizard
    ADD CONSTRAINT account_accrued_orders_wizard_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_accrued_orders_wizard account_accrued_orders_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_account account_analytic_account_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_analytic_account account_analytic_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_account_mrp_bom_rel account_analytic_account_mrp_b_account_analytic_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account_mrp_bom_rel
    ADD CONSTRAINT account_analytic_account_mrp_b_account_analytic_account_id_fkey FOREIGN KEY (account_analytic_account_id) REFERENCES public.account_analytic_account(id) ON DELETE CASCADE;


--
-- Name: account_analytic_account_mrp_bom_rel account_analytic_account_mrp_bom_rel_mrp_bom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account_mrp_bom_rel
    ADD CONSTRAINT account_analytic_account_mrp_bom_rel_mrp_bom_id_fkey FOREIGN KEY (mrp_bom_id) REFERENCES public.mrp_bom(id) ON DELETE CASCADE;


--
-- Name: account_analytic_account_mrp_production_rel account_analytic_account_mrp_p_account_analytic_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account_mrp_production_rel
    ADD CONSTRAINT account_analytic_account_mrp_p_account_analytic_account_id_fkey FOREIGN KEY (account_analytic_account_id) REFERENCES public.account_analytic_account(id) ON DELETE CASCADE;


--
-- Name: account_analytic_account_mrp_production_rel account_analytic_account_mrp_production__mrp_production_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account_mrp_production_rel
    ADD CONSTRAINT account_analytic_account_mrp_production__mrp_production_id_fkey FOREIGN KEY (mrp_production_id) REFERENCES public.mrp_production(id) ON DELETE CASCADE;


--
-- Name: account_analytic_account_mrp_workcenter_rel account_analytic_account_mrp_w_account_analytic_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account_mrp_workcenter_rel
    ADD CONSTRAINT account_analytic_account_mrp_w_account_analytic_account_id_fkey FOREIGN KEY (account_analytic_account_id) REFERENCES public.account_analytic_account(id) ON DELETE CASCADE;


--
-- Name: account_analytic_account_mrp_workcenter_rel account_analytic_account_mrp_workcenter__mrp_workcenter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account_mrp_workcenter_rel
    ADD CONSTRAINT account_analytic_account_mrp_workcenter__mrp_workcenter_id_fkey FOREIGN KEY (mrp_workcenter_id) REFERENCES public.mrp_workcenter(id) ON DELETE CASCADE;


--
-- Name: account_analytic_account account_analytic_account_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_analytic_account account_analytic_account_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_plan_id_fkey FOREIGN KEY (plan_id) REFERENCES public.account_analytic_plan(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_account account_analytic_account_root_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_account
    ADD CONSTRAINT account_analytic_account_root_plan_id_fkey FOREIGN KEY (root_plan_id) REFERENCES public.account_analytic_plan(id) ON DELETE SET NULL;


--
-- Name: account_analytic_account account_analytic_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_applicability account_analytic_applicability_analytic_plan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_applicability
    ADD CONSTRAINT account_analytic_applicability_analytic_plan_id_fkey FOREIGN KEY (analytic_plan_id) REFERENCES public.account_analytic_plan(id) ON DELETE SET NULL;


--
-- Name: account_analytic_applicability account_analytic_applicability_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_applicability
    ADD CONSTRAINT account_analytic_applicability_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_analytic_applicability account_analytic_applicability_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_applicability account_analytic_applicability_product_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_applicability
    ADD CONSTRAINT account_analytic_applicability_product_categ_id_fkey FOREIGN KEY (product_categ_id) REFERENCES public.product_category(id) ON DELETE SET NULL;


--
-- Name: account_analytic_applicability account_analytic_applicability_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_partner_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_partner_category_id_fkey FOREIGN KEY (partner_category_id) REFERENCES public.res_partner_category(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_product_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_product_categ_id_fkey FOREIGN KEY (product_categ_id) REFERENCES public.product_category(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_distribution_model
    ADD CONSTRAINT account_analytic_distribution_model_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: account_analytic_distribution_model account_analytic_distribution_model_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_line account_analytic_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_analytic_account(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_line account_analytic_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_line account_analytic_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_line account_analytic_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_line account_analytic_line_general_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_general_account_id_fkey FOREIGN KEY (general_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_analytic_line account_analytic_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_move_line_id_fkey FOREIGN KEY (move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_analytic_line account_analytic_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_so_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_so_line_fkey FOREIGN KEY (so_line) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line_stock_move_rel account_analytic_line_stock_move__account_analytic_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line_stock_move_rel
    ADD CONSTRAINT account_analytic_line_stock_move__account_analytic_line_id_fkey FOREIGN KEY (account_analytic_line_id) REFERENCES public.account_analytic_line(id) ON DELETE CASCADE;


--
-- Name: account_analytic_line_stock_move_rel account_analytic_line_stock_move_rel_stock_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line_stock_move_rel
    ADD CONSTRAINT account_analytic_line_stock_move_rel_stock_move_id_fkey FOREIGN KEY (stock_move_id) REFERENCES public.stock_move(id) ON DELETE CASCADE;


--
-- Name: account_analytic_line account_analytic_line_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_analytic_line
    ADD CONSTRAINT account_analytic_line_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_analytic_line account_analytic_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_plan account_analytic_plan_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_plan account_analytic_plan_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_analytic_plan account_analytic_plan_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_automatic_entry_wizard_account_move_line_rel account_automatic_entry_wizar_account_automatic_entry_wiza_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_automatic_entry_wizard_account_move_line_rel
    ADD CONSTRAINT account_automatic_entry_wizar_account_automatic_entry_wiza_fkey FOREIGN KEY (account_automatic_entry_wizard_id) REFERENCES public.account_automatic_entry_wizard(id) ON DELETE CASCADE;


--
-- Name: account_automatic_entry_wizard_account_move_line_rel account_automatic_entry_wizard_accoun_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_automatic_entry_wizard_account_move_line_rel
    ADD CONSTRAINT account_automatic_entry_wizard_accoun_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_automatic_entry_wizard
    ADD CONSTRAINT account_automatic_entry_wizard_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_destination_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_automatic_entry_wizard
    ADD CONSTRAINT account_automatic_entry_wizard_destination_account_id_fkey FOREIGN KEY (destination_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_automatic_entry_wizard account_automatic_entry_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_autopost_bills_wizard account_autopost_bills_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_autopost_bills_wizard account_autopost_bills_wizard_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_autopost_bills_wizard
    ADD CONSTRAINT account_autopost_bills_wizard_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_autopost_bills_wizard account_autopost_bills_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement account_bank_statement_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement
    ADD CONSTRAINT account_bank_statement_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement account_bank_statement_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement_ir_attachment_rel account_bank_statement_ir_attach_account_bank_statement_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_ir_attachment_rel
    ADD CONSTRAINT account_bank_statement_ir_attach_account_bank_statement_id_fkey FOREIGN KEY (account_bank_statement_id) REFERENCES public.account_bank_statement(id) ON DELETE CASCADE;


--
-- Name: account_bank_statement_ir_attachment_rel account_bank_statement_ir_attachment_rel_ir_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_ir_attachment_rel
    ADD CONSTRAINT account_bank_statement_ir_attachment_rel_ir_attachment_id_fkey FOREIGN KEY (ir_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: account_bank_statement account_bank_statement_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement
    ADD CONSTRAINT account_bank_statement_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_foreign_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_foreign_currency_id_fkey FOREIGN KEY (foreign_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement_line account_bank_statement_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_bank_statement_line account_bank_statement_line_statement_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_bank_statement_line
    ADD CONSTRAINT account_bank_statement_line_statement_id_fkey FOREIGN KEY (statement_id) REFERENCES public.account_bank_statement(id) ON DELETE SET NULL;


--
-- Name: account_bank_statement_line account_bank_statement_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_bank_statement account_bank_statement_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_cash_rounding account_cash_rounding_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_cash_rounding account_cash_rounding_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_edi_proxy_client_user account_edi_proxy_client_user_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_proxy_client_user
    ADD CONSTRAINT account_edi_proxy_client_user_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_edi_proxy_client_user account_edi_proxy_client_user_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_edi_proxy_client_user account_edi_proxy_client_user_private_key_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_edi_proxy_client_user
    ADD CONSTRAINT account_edi_proxy_client_user_private_key_id_fkey FOREIGN KEY (private_key_id) REFERENCES public.certificate_key(id) ON DELETE RESTRICT;


--
-- Name: account_edi_proxy_client_user account_edi_proxy_client_user_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_financial_year_op account_financial_year_op_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_financial_year_op
    ADD CONSTRAINT account_financial_year_op_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_financial_year_op account_financial_year_op_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_financial_year_op account_financial_year_op_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position_account account_fiscal_position_account_account_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_account_dest_id_fkey FOREIGN KEY (account_dest_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_account_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_account_src_id_fkey FOREIGN KEY (account_src_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position_account account_fiscal_position_account_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_account
    ADD CONSTRAINT account_fiscal_position_account_position_id_fkey FOREIGN KEY (position_id) REFERENCES public.account_fiscal_position(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_account account_fiscal_position_account_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position account_fiscal_position_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position
    ADD CONSTRAINT account_fiscal_position_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position account_fiscal_position_country_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position account_fiscal_position_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position account_fiscal_position_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position_res_country_state_rel account_fiscal_position_res_cou_account_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_res_country_state_rel
    ADD CONSTRAINT account_fiscal_position_res_cou_account_fiscal_position_id_fkey FOREIGN KEY (account_fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_res_country_state_rel account_fiscal_position_res_country_s_res_country_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax
    ADD CONSTRAINT account_fiscal_position_tax_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax
    ADD CONSTRAINT account_fiscal_position_tax_position_id_fkey FOREIGN KEY (position_id) REFERENCES public.account_fiscal_position(id) ON DELETE CASCADE;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_tax_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax
    ADD CONSTRAINT account_fiscal_position_tax_tax_dest_id_fkey FOREIGN KEY (tax_dest_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_tax_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_fiscal_position_tax
    ADD CONSTRAINT account_fiscal_position_tax_tax_src_id_fkey FOREIGN KEY (tax_src_id) REFERENCES public.account_tax(id) ON DELETE RESTRICT;


--
-- Name: account_fiscal_position_tax account_fiscal_position_tax_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_fiscal_position account_fiscal_position_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_full_reconcile account_full_reconcile_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_full_reconcile account_full_reconcile_exchange_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_full_reconcile
    ADD CONSTRAINT account_full_reconcile_exchange_move_id_fkey FOREIGN KEY (exchange_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_full_reconcile account_full_reconcile_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_group account_group_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_group
    ADD CONSTRAINT account_group_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_group account_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_group account_group_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_group account_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_incoterms account_incoterms_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_incoterms account_incoterms_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_invoice_transaction_rel account_invoice_transaction_rel_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_invoice_transaction_rel
    ADD CONSTRAINT account_invoice_transaction_rel_invoice_id_fkey FOREIGN KEY (invoice_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_invoice_transaction_rel account_invoice_transaction_rel_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_invoice_transaction_rel
    ADD CONSTRAINT account_invoice_transaction_rel_transaction_id_fkey FOREIGN KEY (transaction_id) REFERENCES public.payment_transaction(id) ON DELETE CASCADE;


--
-- Name: account_journal_account_journal_group_rel account_journal_account_journal_g_account_journal_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_account_journal_group_rel
    ADD CONSTRAINT account_journal_account_journal_g_account_journal_group_id_fkey FOREIGN KEY (account_journal_group_id) REFERENCES public.account_journal_group(id) ON DELETE CASCADE;


--
-- Name: account_journal_account_journal_group_rel account_journal_account_journal_group_r_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_journal_account_reconcile_model_rel account_journal_account_reconci_account_reconcile_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_account_reconcile_model_rel
    ADD CONSTRAINT account_journal_account_reconci_account_reconcile_model_id_fkey FOREIGN KEY (account_reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_journal_account_reconcile_model_rel account_journal_account_reconcile_model_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


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

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_alias_id_fkey FOREIGN KEY (alias_id) REFERENCES public.mail_alias(id) ON DELETE RESTRICT;


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

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_bank_account_id_fkey FOREIGN KEY (bank_account_id) REFERENCES public.res_partner_bank(id) ON DELETE RESTRICT;


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

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


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

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


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

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


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

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_default_account_id_fkey FOREIGN KEY (default_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_journal_group account_journal_group_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_journal_group
    ADD CONSTRAINT account_journal_group_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_journal_group account_journal_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_journal_group account_journal_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


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

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_loss_account_id_fkey FOREIGN KEY (loss_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


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

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_profit_account_id_fkey FOREIGN KEY (profit_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


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

ALTER TABLE ONLY public.account_journal
    ADD CONSTRAINT account_journal_suspense_account_id_fkey FOREIGN KEY (suspense_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


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

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


--
-- Name: account_lock_exception account_lock_exception_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_lock_exception
    ADD CONSTRAINT account_lock_exception_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_lock_exception account_lock_exception_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_lock_exception account_lock_exception_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_lock_exception
    ADD CONSTRAINT account_lock_exception_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_lock_exception account_lock_exception_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_merge_wizard account_merge_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_merge_wizard_line account_merge_wizard_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_merge_wizard_line
    ADD CONSTRAINT account_merge_wizard_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_merge_wizard_line account_merge_wizard_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_merge_wizard_line account_merge_wizard_line_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_merge_wizard_line
    ADD CONSTRAINT account_merge_wizard_line_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.account_merge_wizard(id) ON DELETE CASCADE;


--
-- Name: account_merge_wizard_line account_merge_wizard_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_merge_wizard account_merge_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move__account_payment account_move__account_payment_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move__account_payment
    ADD CONSTRAINT account_move__account_payment_invoice_id_fkey FOREIGN KEY (invoice_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move__account_payment account_move__account_payment_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move__account_payment
    ADD CONSTRAINT account_move__account_payment_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment(id) ON DELETE CASCADE;


--
-- Name: account_move_account_move_send_batch_wizard_rel account_move_account_move_sen_account_move_send_batch_wiza_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_move_send_batch_wizard_rel
    ADD CONSTRAINT account_move_account_move_sen_account_move_send_batch_wiza_fkey FOREIGN KEY (account_move_send_batch_wizard_id) REFERENCES public.account_move_send_batch_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_account_move_send_batch_wizard_rel account_move_account_move_send_batch_wizar_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_move_send_batch_wizard_rel
    ADD CONSTRAINT account_move_account_move_send_batch_wizar_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_account_peppol_rejection_wizard_rel account_move_account_peppol_r_account_peppol_rejection_wiz_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_peppol_rejection_wizard_rel
    ADD CONSTRAINT account_move_account_peppol_r_account_peppol_rejection_wiz_fkey FOREIGN KEY (account_peppol_rejection_wizard_id) REFERENCES public.account_peppol_rejection_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_account_peppol_rejection_wizard_rel account_move_account_peppol_rejection_wiza_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_peppol_rejection_wizard_rel
    ADD CONSTRAINT account_move_account_peppol_rejection_wiza_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_account_resequence_wizard_rel account_move_account_resequen_account_resequence_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_resequence_wizard_rel
    ADD CONSTRAINT account_move_account_resequen_account_resequence_wizard_id_fkey FOREIGN KEY (account_resequence_wizard_id) REFERENCES public.account_resequence_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_account_resequence_wizard_rel account_move_account_resequence_wizard_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_account_resequence_wizard_rel
    ADD CONSTRAINT account_move_account_resequence_wizard_rel_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move account_move_auto_post_origin_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_auto_post_origin_id_fkey FOREIGN KEY (auto_post_origin_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_campaign(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_commercial_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_commercial_partner_id_fkey FOREIGN KEY (commercial_partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_move account_move_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_fiscal_position_id_fkey FOREIGN KEY (fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE RESTRICT;


--
-- Name: account_move account_move_invoice_cash_rounding_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_cash_rounding_id_fkey FOREIGN KEY (invoice_cash_rounding_id) REFERENCES public.account_cash_rounding(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_invoice_incoterm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_incoterm_id_fkey FOREIGN KEY (invoice_incoterm_id) REFERENCES public.account_incoterms(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_invoice_payment_term_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_payment_term_id_fkey FOREIGN KEY (invoice_payment_term_id) REFERENCES public.account_payment_term(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_invoice_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_invoice_user_id_fkey FOREIGN KEY (invoice_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_move_line_account_tax_rel account_move_line_account_tax_rel_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line_account_tax_rel
    ADD CONSTRAINT account_move_line_account_tax_rel_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_move_line_account_tax_rel account_move_line_account_tax_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line_account_tax_rel
    ADD CONSTRAINT account_move_line_account_tax_rel_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_move_line account_move_line_cogs_origin_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_cogs_origin_id_fkey FOREIGN KEY (cogs_origin_id) REFERENCES public.account_move_line(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_company_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_company_currency_id_fkey FOREIGN KEY (company_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_line account_move_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_line account_move_line_full_reconcile_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_full_reconcile_id_fkey FOREIGN KEY (full_reconcile_id) REFERENCES public.account_full_reconcile(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_group_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_group_tax_id_fkey FOREIGN KEY (group_tax_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_line account_move_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_purchase_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_purchase_line_id_fkey FOREIGN KEY (purchase_line_id) REFERENCES public.purchase_order_line(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_reconcile_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_reconcile_model_id_fkey FOREIGN KEY (reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_statement_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_statement_id_fkey FOREIGN KEY (statement_id) REFERENCES public.account_bank_statement(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_statement_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_statement_line_id_fkey FOREIGN KEY (statement_line_id) REFERENCES public.account_bank_statement_line(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_tax_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_tax_group_id_fkey FOREIGN KEY (tax_group_id) REFERENCES public.account_tax_group(id) ON DELETE SET NULL;


--
-- Name: account_move_line account_move_line_tax_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_tax_line_id_fkey FOREIGN KEY (tax_line_id) REFERENCES public.account_tax(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_tax_repartition_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_line
    ADD CONSTRAINT account_move_line_tax_repartition_line_id_fkey FOREIGN KEY (tax_repartition_line_id) REFERENCES public.account_tax_repartition_line(id) ON DELETE RESTRICT;


--
-- Name: account_move_line account_move_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_medium_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_medium_id_fkey FOREIGN KEY (medium_id) REFERENCES public.utm_medium(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_mrp_production_rel account_move_mrp_production_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_mrp_production_rel
    ADD CONSTRAINT account_move_mrp_production_rel_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_mrp_production_rel account_move_mrp_production_rel_mrp_production_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_mrp_production_rel
    ADD CONSTRAINT account_move_mrp_production_rel_mrp_production_id_fkey FOREIGN KEY (mrp_production_id) REFERENCES public.mrp_production(id) ON DELETE CASCADE;


--
-- Name: account_move account_move_origin_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_origin_payment_id_fkey FOREIGN KEY (origin_payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_partner_bank_id_fkey FOREIGN KEY (partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE RESTRICT;


--
-- Name: account_move account_move_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_move account_move_partner_shipping_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_partner_shipping_id_fkey FOREIGN KEY (partner_shipping_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_preferred_payment_method_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_preferred_payment_method_line_id_fkey FOREIGN KEY (preferred_payment_method_line_id) REFERENCES public.account_payment_method_line(id) ON DELETE SET NULL;


--
-- Name: account_move_purchase_order_rel account_move_purchase_order_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_purchase_order_rel
    ADD CONSTRAINT account_move_purchase_order_rel_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_purchase_order_rel account_move_purchase_order_rel_purchase_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_purchase_order_rel
    ADD CONSTRAINT account_move_purchase_order_rel_purchase_order_id_fkey FOREIGN KEY (purchase_order_id) REFERENCES public.purchase_order(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal account_move_reversal_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal
    ADD CONSTRAINT account_move_reversal_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal account_move_reversal_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_reversal account_move_reversal_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal
    ADD CONSTRAINT account_move_reversal_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal_move account_move_reversal_move_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_reversal_move account_move_reversal_move_reversal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal_move
    ADD CONSTRAINT account_move_reversal_move_reversal_id_fkey FOREIGN KEY (reversal_id) REFERENCES public.account_move_reversal(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal_new_move account_move_reversal_new_move_new_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal_new_move
    ADD CONSTRAINT account_move_reversal_new_move_new_move_id_fkey FOREIGN KEY (new_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal_new_move account_move_reversal_new_move_reversal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_reversal_new_move
    ADD CONSTRAINT account_move_reversal_new_move_reversal_id_fkey FOREIGN KEY (reversal_id) REFERENCES public.account_move_reversal(id) ON DELETE CASCADE;


--
-- Name: account_move_reversal account_move_reversal_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_reversed_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_reversed_entry_id_fkey FOREIGN KEY (reversed_entry_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_move_send_batch_wizard account_move_send_batch_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_send_batch_wizard account_move_send_batch_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_send_wizard account_move_send_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_send_wizard account_move_send_wizard_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard
    ADD CONSTRAINT account_move_send_wizard_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: account_move_send_wizard account_move_send_wizard_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move_send_wizard account_move_send_wizard_pdf_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard
    ADD CONSTRAINT account_move_send_wizard_pdf_report_id_fkey FOREIGN KEY (pdf_report_id) REFERENCES public.ir_act_report_xml(id) ON DELETE SET NULL;


--
-- Name: account_move_send_wizard_res_partner_rel account_move_send_wizard_res_p_account_move_send_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard_res_partner_rel
    ADD CONSTRAINT account_move_send_wizard_res_p_account_move_send_wizard_id_fkey FOREIGN KEY (account_move_send_wizard_id) REFERENCES public.account_move_send_wizard(id) ON DELETE CASCADE;


--
-- Name: account_move_send_wizard_res_partner_rel account_move_send_wizard_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_send_wizard_res_partner_rel
    ADD CONSTRAINT account_move_send_wizard_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: account_move_send_wizard account_move_send_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_move account_move_source_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_source_id_fkey FOREIGN KEY (source_id) REFERENCES public.utm_source(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_statement_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_statement_line_id_fkey FOREIGN KEY (statement_line_id) REFERENCES public.account_bank_statement_line(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_stock_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_stock_move_id_fkey FOREIGN KEY (stock_move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_tax_cash_basis_origin_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_tax_cash_basis_origin_move_id_fkey FOREIGN KEY (tax_cash_basis_origin_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_tax_cash_basis_rec_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_tax_cash_basis_rec_id_fkey FOREIGN KEY (tax_cash_basis_rec_id) REFERENCES public.account_partial_reconcile(id) ON DELETE SET NULL;


--
-- Name: account_move account_move_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move
    ADD CONSTRAINT account_move_team_id_fkey FOREIGN KEY (team_id) REFERENCES public.crm_team(id) ON DELETE SET NULL;


--
-- Name: account_move_validate_account_move_rel account_move_validate_account_mov_validate_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_validate_account_move_rel
    ADD CONSTRAINT account_move_validate_account_mov_validate_account_move_id_fkey FOREIGN KEY (validate_account_move_id) REFERENCES public.validate_account_move(id) ON DELETE CASCADE;


--
-- Name: account_move_validate_account_move_rel account_move_validate_account_move_rel_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_move_validate_account_move_rel
    ADD CONSTRAINT account_move_validate_account_move_rel_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE CASCADE;


--
-- Name: account_move account_move_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_partial_reconcile account_partial_reconcile_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_partial_reconcile account_partial_reconcile_credit_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_credit_currency_id_fkey FOREIGN KEY (credit_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_credit_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_credit_move_id_fkey FOREIGN KEY (credit_move_id) REFERENCES public.account_move_line(id) ON DELETE RESTRICT;


--
-- Name: account_partial_reconcile account_partial_reconcile_debit_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_debit_currency_id_fkey FOREIGN KEY (debit_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_debit_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_debit_move_id_fkey FOREIGN KEY (debit_move_id) REFERENCES public.account_move_line(id) ON DELETE RESTRICT;


--
-- Name: account_partial_reconcile account_partial_reconcile_exchange_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_exchange_move_id_fkey FOREIGN KEY (exchange_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_full_reconcile_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_partial_reconcile
    ADD CONSTRAINT account_partial_reconcile_full_reconcile_id_fkey FOREIGN KEY (full_reconcile_id) REFERENCES public.account_full_reconcile(id) ON DELETE SET NULL;


--
-- Name: account_partial_reconcile account_partial_reconcile_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_account_bank_statement_line_rel account_payment_account_bank__account_bank_statement_line__fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_account_bank_statement_line_rel
    ADD CONSTRAINT account_payment_account_bank__account_bank_statement_line__fkey FOREIGN KEY (account_bank_statement_line_id) REFERENCES public.account_bank_statement_line(id) ON DELETE CASCADE;


--
-- Name: account_payment_account_bank_statement_line_rel account_payment_account_bank_statement__account_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_account_bank_statement_line_rel
    ADD CONSTRAINT account_payment_account_bank_statement__account_payment_id_fkey FOREIGN KEY (account_payment_id) REFERENCES public.account_payment(id) ON DELETE CASCADE;


--
-- Name: account_payment account_payment_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment account_payment_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment account_payment_destination_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_destination_account_id_fkey FOREIGN KEY (destination_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_message_main_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_method account_payment_method_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_method_line account_payment_method_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_method_line account_payment_method_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_payment_method_line account_payment_method_line_payment_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_payment_account_id_fkey FOREIGN KEY (payment_account_id) REFERENCES public.account_account(id) ON DELETE RESTRICT;


--
-- Name: account_payment_method_line account_payment_method_line_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_payment_method_id_fkey FOREIGN KEY (payment_method_id) REFERENCES public.account_payment_method(id) ON DELETE RESTRICT;


--
-- Name: account_payment_method_line account_payment_method_line_payment_provider_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_method_line
    ADD CONSTRAINT account_payment_method_line_payment_provider_id_fkey FOREIGN KEY (payment_provider_id) REFERENCES public.payment_provider(id) ON DELETE SET NULL;


--
-- Name: account_payment_method_line account_payment_method_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_method account_payment_method_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment account_payment_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_outstanding_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_outstanding_account_id_fkey FOREIGN KEY (outstanding_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_paired_internal_transfer_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_paired_internal_transfer_payment_id_fkey FOREIGN KEY (paired_internal_transfer_payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_partner_bank_id_fkey FOREIGN KEY (partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_payment account_payment_payment_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_method_id_fkey FOREIGN KEY (payment_method_id) REFERENCES public.account_payment_method(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_payment_method_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_method_line_id_fkey FOREIGN KEY (payment_method_line_id) REFERENCES public.account_payment_method_line(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_payment_token_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_token_id_fkey FOREIGN KEY (payment_token_id) REFERENCES public.payment_token(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_payment_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_payment_transaction_id_fkey FOREIGN KEY (payment_transaction_id) REFERENCES public.payment_transaction(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_register account_payment_register_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_register account_payment_register_custom_user_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_custom_user_currency_id_fkey FOREIGN KEY (custom_user_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: account_payment_register_move_line_rel account_payment_register_move_line_rel_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register_move_line_rel
    ADD CONSTRAINT account_payment_register_move_line_rel_line_id_fkey FOREIGN KEY (line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: account_payment_register_move_line_rel account_payment_register_move_line_rel_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register_move_line_rel
    ADD CONSTRAINT account_payment_register_move_line_rel_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.account_payment_register(id) ON DELETE CASCADE;


--
-- Name: account_payment_register account_payment_register_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_partner_bank_id_fkey FOREIGN KEY (partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: account_payment_register account_payment_register_payment_method_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_payment_method_line_id_fkey FOREIGN KEY (payment_method_line_id) REFERENCES public.account_payment_method_line(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_payment_token_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_payment_token_id_fkey FOREIGN KEY (payment_token_id) REFERENCES public.payment_token(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_source_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_source_currency_id_fkey FOREIGN KEY (source_currency_id) REFERENCES public.res_currency(id) ON DELETE SET NULL;


--
-- Name: account_payment_register account_payment_register_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_register account_payment_register_writeoff_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_register
    ADD CONSTRAINT account_payment_register_writeoff_account_id_fkey FOREIGN KEY (writeoff_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_payment account_payment_source_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment
    ADD CONSTRAINT account_payment_source_payment_id_fkey FOREIGN KEY (source_payment_id) REFERENCES public.account_payment(id) ON DELETE SET NULL;


--
-- Name: account_payment_term account_payment_term_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_term
    ADD CONSTRAINT account_payment_term_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_payment_term account_payment_term_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_term_line account_payment_term_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_term_line account_payment_term_line_payment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_payment_term_line
    ADD CONSTRAINT account_payment_term_line_payment_id_fkey FOREIGN KEY (payment_id) REFERENCES public.account_payment_term(id) ON DELETE CASCADE;


--
-- Name: account_payment_term_line account_payment_term_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment_term account_payment_term_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_payment account_payment_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_clarification account_peppol_clarification_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_clarification account_peppol_clarification_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_rejection_action_rel account_peppol_rejection_acti_account_peppol_clarification_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_action_rel
    ADD CONSTRAINT account_peppol_rejection_acti_account_peppol_clarification_fkey FOREIGN KEY (account_peppol_clarification_id) REFERENCES public.account_peppol_clarification(id) ON DELETE CASCADE;


--
-- Name: account_peppol_rejection_action_rel account_peppol_rejection_acti_account_peppol_rejection_wiz_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_action_rel
    ADD CONSTRAINT account_peppol_rejection_acti_account_peppol_rejection_wiz_fkey FOREIGN KEY (account_peppol_rejection_wizard_id) REFERENCES public.account_peppol_rejection_wizard(id) ON DELETE CASCADE;


--
-- Name: account_peppol_rejection_reason_rel account_peppol_rejection_reas_account_peppol_clarification_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_reason_rel
    ADD CONSTRAINT account_peppol_rejection_reas_account_peppol_clarification_fkey FOREIGN KEY (account_peppol_clarification_id) REFERENCES public.account_peppol_clarification(id) ON DELETE CASCADE;


--
-- Name: account_peppol_rejection_reason_rel account_peppol_rejection_reas_account_peppol_rejection_wiz_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_rejection_reason_rel
    ADD CONSTRAINT account_peppol_rejection_reas_account_peppol_rejection_wiz_fkey FOREIGN KEY (account_peppol_rejection_wizard_id) REFERENCES public.account_peppol_rejection_wizard(id) ON DELETE CASCADE;


--
-- Name: account_peppol_rejection_wizard account_peppol_rejection_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_rejection_wizard account_peppol_rejection_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_response account_peppol_response_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_response account_peppol_response_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_response account_peppol_response_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_service account_peppol_service_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_service_wizard account_peppol_service_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_service_wizard account_peppol_service_wizard_edi_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_service_wizard
    ADD CONSTRAINT account_peppol_service_wizard_edi_user_id_fkey FOREIGN KEY (edi_user_id) REFERENCES public.account_edi_proxy_client_user(id) ON DELETE SET NULL;


--
-- Name: account_peppol_service account_peppol_service_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_peppol_service
    ADD CONSTRAINT account_peppol_service_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.account_peppol_service_wizard(id) ON DELETE SET NULL;


--
-- Name: account_peppol_service_wizard account_peppol_service_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_peppol_service account_peppol_service_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model account_reconcile_model_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model
    ADD CONSTRAINT account_reconcile_model_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_reconcile_model account_reconcile_model_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_line_account_tax_rel account_reconcile_model_line__account_reconcile_model_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line_account_tax_rel
    ADD CONSTRAINT account_reconcile_model_line__account_reconcile_model_line_fkey FOREIGN KEY (account_reconcile_model_line_id) REFERENCES public.account_reconcile_model_line(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_line_account_tax_rel account_reconcile_model_line_account_tax_re_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line_account_tax_rel
    ADD CONSTRAINT account_reconcile_model_line_account_tax_re_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE RESTRICT;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_line account_reconcile_model_line_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_line
    ADD CONSTRAINT account_reconcile_model_line_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_line account_reconcile_model_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_partner_mapping
    ADD CONSTRAINT account_reconcile_model_partner_mapping_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_partner_mapping
    ADD CONSTRAINT account_reconcile_model_partner_mapping_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_partner_mapping account_reconcile_model_partner_mapping_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_reconcile_model_res_partner_category_rel account_reconcile_model_res_pa_account_reconcile_model_id_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_category_rel
    ADD CONSTRAINT account_reconcile_model_res_pa_account_reconcile_model_id_fkey1 FOREIGN KEY (account_reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_res_partner_rel account_reconcile_model_res_par_account_reconcile_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_rel
    ADD CONSTRAINT account_reconcile_model_res_par_account_reconcile_model_id_fkey FOREIGN KEY (account_reconcile_model_id) REFERENCES public.account_reconcile_model(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_res_partner_category_rel account_reconcile_model_res_partne_res_partner_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_category_rel
    ADD CONSTRAINT account_reconcile_model_res_partne_res_partner_category_id_fkey FOREIGN KEY (res_partner_category_id) REFERENCES public.res_partner_category(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model_res_partner_rel account_reconcile_model_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_reconcile_model_res_partner_rel
    ADD CONSTRAINT account_reconcile_model_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: account_reconcile_model account_reconcile_model_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_column account_report_column_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_column account_report_column_custom_audit_action_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_column
    ADD CONSTRAINT account_report_column_custom_audit_action_id_fkey FOREIGN KEY (custom_audit_action_id) REFERENCES public.ir_act_window(id) ON DELETE SET NULL;


--
-- Name: account_report_column account_report_column_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_column
    ADD CONSTRAINT account_report_column_report_id_fkey FOREIGN KEY (report_id) REFERENCES public.account_report(id) ON DELETE SET NULL;


--
-- Name: account_report_column account_report_column_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report account_report_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report account_report_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_expression account_report_expression_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_expression account_report_expression_report_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_expression
    ADD CONSTRAINT account_report_expression_report_line_id_fkey FOREIGN KEY (report_line_id) REFERENCES public.account_report_line(id) ON DELETE CASCADE;


--
-- Name: account_report_expression account_report_expression_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_external_value account_report_external_value_carryover_origin_report_line_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_carryover_origin_report_line_fkey FOREIGN KEY (carryover_origin_report_line_id) REFERENCES public.account_report_line(id) ON DELETE SET NULL;


--
-- Name: account_report_external_value account_report_external_value_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_report_external_value account_report_external_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_external_value account_report_external_value_foreign_vat_fiscal_position__fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_foreign_vat_fiscal_position__fkey FOREIGN KEY (foreign_vat_fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE SET NULL;


--
-- Name: account_report_external_value account_report_external_value_target_report_expression_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_external_value
    ADD CONSTRAINT account_report_external_value_target_report_expression_id_fkey FOREIGN KEY (target_report_expression_id) REFERENCES public.account_report_expression(id) ON DELETE CASCADE;


--
-- Name: account_report_external_value account_report_external_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_line account_report_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_line account_report_line_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report_line account_report_line_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_line
    ADD CONSTRAINT account_report_line_report_id_fkey FOREIGN KEY (report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_report_line account_report_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_report account_report_root_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report
    ADD CONSTRAINT account_report_root_report_id_fkey FOREIGN KEY (root_report_id) REFERENCES public.account_report(id) ON DELETE SET NULL;


--
-- Name: account_report_section_rel account_report_section_rel_main_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_section_rel
    ADD CONSTRAINT account_report_section_rel_main_report_id_fkey FOREIGN KEY (main_report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_report_section_rel account_report_section_rel_sub_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_report_section_rel
    ADD CONSTRAINT account_report_section_rel_sub_report_id_fkey FOREIGN KEY (sub_report_id) REFERENCES public.account_report(id) ON DELETE CASCADE;


--
-- Name: account_report account_report_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_resequence_wizard account_resequence_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_resequence_wizard account_resequence_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_secure_entries_wizard account_secure_entries_wizard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_secure_entries_wizard
    ADD CONSTRAINT account_secure_entries_wizard_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: account_secure_entries_wizard account_secure_entries_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_secure_entries_wizard account_secure_entries_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_setup_bank_manual_config account_setup_bank_manual_config_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_setup_bank_manual_config account_setup_bank_manual_config_res_partner_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_setup_bank_manual_config
    ADD CONSTRAINT account_setup_bank_manual_config_res_partner_bank_id_fkey FOREIGN KEY (res_partner_bank_id) REFERENCES public.res_partner_bank(id) ON DELETE CASCADE;


--
-- Name: account_setup_bank_manual_config account_setup_bank_manual_config_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax account_tax_cash_basis_transition_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax
    ADD CONSTRAINT account_tax_cash_basis_transition_account_id_fkey FOREIGN KEY (cash_basis_transition_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax account_tax_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax
    ADD CONSTRAINT account_tax_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_tax account_tax_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax
    ADD CONSTRAINT account_tax_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE RESTRICT;


--
-- Name: account_tax account_tax_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_filiation_rel account_tax_filiation_rel_child_tax_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_filiation_rel
    ADD CONSTRAINT account_tax_filiation_rel_child_tax_fkey FOREIGN KEY (child_tax) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_filiation_rel account_tax_filiation_rel_parent_tax_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_filiation_rel
    ADD CONSTRAINT account_tax_filiation_rel_parent_tax_fkey FOREIGN KEY (parent_tax) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_group account_tax_group_advance_tax_payment_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_advance_tax_payment_account_id_fkey FOREIGN KEY (advance_tax_payment_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax_group account_tax_group_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: account_tax_group account_tax_group_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_group account_tax_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_group account_tax_group_tax_payable_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_tax_payable_account_id_fkey FOREIGN KEY (tax_payable_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax_group account_tax_group_tax_receivable_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_group
    ADD CONSTRAINT account_tax_group_tax_receivable_account_id_fkey FOREIGN KEY (tax_receivable_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax_group account_tax_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_purchase_order_line_rel account_tax_purchase_order_line_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_purchase_order_line_rel
    ADD CONSTRAINT account_tax_purchase_order_line_rel_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_purchase_order_line_rel account_tax_purchase_order_line_rel_purchase_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_purchase_order_line_rel
    ADD CONSTRAINT account_tax_purchase_order_line_rel_purchase_order_line_id_fkey FOREIGN KEY (purchase_order_line_id) REFERENCES public.purchase_order_line(id) ON DELETE CASCADE;


--
-- Name: account_tax_repartition_line account_tax_repartition_line_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_repartition_line
    ADD CONSTRAINT account_tax_repartition_line_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: account_tax_repartition_line account_tax_repartition_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_repartition_line
    ADD CONSTRAINT account_tax_repartition_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: account_tax_repartition_line account_tax_repartition_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_repartition_line account_tax_repartition_line_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_repartition_line
    ADD CONSTRAINT account_tax_repartition_line_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_repartition_line account_tax_repartition_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: account_tax_sale_order_discount_rel account_tax_sale_order_discount_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_sale_order_discount_rel
    ADD CONSTRAINT account_tax_sale_order_discount_rel_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_sale_order_discount_rel account_tax_sale_order_discount_rel_sale_order_discount_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_sale_order_discount_rel
    ADD CONSTRAINT account_tax_sale_order_discount_rel_sale_order_discount_id_fkey FOREIGN KEY (sale_order_discount_id) REFERENCES public.sale_order_discount(id) ON DELETE CASCADE;


--
-- Name: account_tax_sale_order_line_rel account_tax_sale_order_line_rel_account_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_sale_order_line_rel
    ADD CONSTRAINT account_tax_sale_order_line_rel_account_tax_id_fkey FOREIGN KEY (account_tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: account_tax_sale_order_line_rel account_tax_sale_order_line_rel_sale_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax_sale_order_line_rel
    ADD CONSTRAINT account_tax_sale_order_line_rel_sale_order_line_id_fkey FOREIGN KEY (sale_order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: account_tax account_tax_tax_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.account_tax
    ADD CONSTRAINT account_tax_tax_group_id_fkey FOREIGN KEY (tax_group_id) REFERENCES public.account_tax_group(id) ON DELETE RESTRICT;


--
-- Name: account_tax account_tax_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: activity_attachment_rel activity_attachment_rel_activity_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.activity_attachment_rel
    ADD CONSTRAINT activity_attachment_rel_activity_id_fkey FOREIGN KEY (activity_id) REFERENCES public.mail_activity(id) ON DELETE CASCADE;


--
-- Name: activity_attachment_rel activity_attachment_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.activity_attachment_rel
    ADD CONSTRAINT activity_attachment_rel_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: auth_totp_device auth_totp_device_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.auth_totp_device
    ADD CONSTRAINT auth_totp_device_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: auth_totp_wizard auth_totp_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: auth_totp_wizard auth_totp_wizard_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.auth_totp_wizard
    ADD CONSTRAINT auth_totp_wizard_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: auth_totp_wizard auth_totp_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: badge_unlocked_definition_rel badge_unlocked_definition_rel_gamification_badge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.badge_unlocked_definition_rel
    ADD CONSTRAINT badge_unlocked_definition_rel_gamification_badge_id_fkey FOREIGN KEY (gamification_badge_id) REFERENCES public.gamification_badge(id) ON DELETE CASCADE;


--
-- Name: badge_unlocked_definition_rel badge_unlocked_definition_rel_gamification_goal_definition_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.badge_unlocked_definition_rel
    ADD CONSTRAINT badge_unlocked_definition_rel_gamification_goal_definition_fkey FOREIGN KEY (gamification_goal_definition_id) REFERENCES public.gamification_goal_definition(id) ON DELETE CASCADE;


--
-- Name: barcode_nomenclature barcode_nomenclature_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: barcode_nomenclature barcode_nomenclature_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: barcode_rule barcode_rule_associated_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.barcode_rule
    ADD CONSTRAINT barcode_rule_associated_uom_id_fkey FOREIGN KEY (associated_uom_id) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


--
-- Name: barcode_rule barcode_rule_barcode_nomenclature_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.barcode_rule
    ADD CONSTRAINT barcode_rule_barcode_nomenclature_id_fkey FOREIGN KEY (barcode_nomenclature_id) REFERENCES public.barcode_nomenclature(id) ON DELETE SET NULL;


--
-- Name: barcode_rule barcode_rule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: barcode_rule barcode_rule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_document_layout base_document_layout_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_document_layout
    ADD CONSTRAINT base_document_layout_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: base_document_layout base_document_layout_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_document_layout base_document_layout_report_layout_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_document_layout
    ADD CONSTRAINT base_document_layout_report_layout_id_fkey FOREIGN KEY (report_layout_id) REFERENCES public.report_layout(id) ON DELETE SET NULL;


--
-- Name: base_document_layout base_document_layout_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_enable_profiling_wizard base_enable_profiling_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_enable_profiling_wizard base_enable_profiling_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_import_import base_import_import_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_import_import base_import_import_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_import_mapping base_import_mapping_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_import_mapping base_import_mapping_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_import_module base_import_module_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_import_module base_import_module_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_language_export base_language_export_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_language_export base_language_export_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_language_export
    ADD CONSTRAINT base_language_export_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE SET NULL;


--
-- Name: base_language_export base_language_export_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_language_import base_language_import_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_language_import base_language_import_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_language_install base_language_install_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_language_install_website_rel base_language_install_website_rel_base_language_install_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_language_install_website_rel
    ADD CONSTRAINT base_language_install_website_rel_base_language_install_id_fkey FOREIGN KEY (base_language_install_id) REFERENCES public.base_language_install(id) ON DELETE CASCADE;


--
-- Name: base_language_install_website_rel base_language_install_website_rel_website_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_language_install_website_rel
    ADD CONSTRAINT base_language_install_website_rel_website_id_fkey FOREIGN KEY (website_id) REFERENCES public.website(id) ON DELETE CASCADE;


--
-- Name: base_language_install base_language_install_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_install_request base_module_install_request_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_install_request base_module_install_request_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_module_install_request
    ADD CONSTRAINT base_module_install_request_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: base_module_install_request base_module_install_request_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_module_install_request
    ADD CONSTRAINT base_module_install_request_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: base_module_install_request base_module_install_request_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_install_review base_module_install_review_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_install_review base_module_install_review_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_module_install_review
    ADD CONSTRAINT base_module_install_review_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: base_module_install_review base_module_install_review_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_uninstall base_module_uninstall_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_uninstall base_module_uninstall_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_module_uninstall
    ADD CONSTRAINT base_module_uninstall_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: base_module_uninstall base_module_uninstall_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_update base_module_update_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_update base_module_update_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_upgrade base_module_upgrade_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_module_upgrade base_module_upgrade_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_partner_merge_automatic_wizard_res_partner_rel base_partner_merge_automatic__base_partner_merge_automatic_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_partner_merge_automatic_wizard_res_partner_rel
    ADD CONSTRAINT base_partner_merge_automatic__base_partner_merge_automatic_fkey FOREIGN KEY (base_partner_merge_automatic_wizard_id) REFERENCES public.base_partner_merge_automatic_wizard(id) ON DELETE CASCADE;


--
-- Name: base_partner_merge_automatic_wizard base_partner_merge_automatic_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_partner_merge_automatic_wizard base_partner_merge_automatic_wizard_current_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_partner_merge_automatic_wizard
    ADD CONSTRAINT base_partner_merge_automatic_wizard_current_line_id_fkey FOREIGN KEY (current_line_id) REFERENCES public.base_partner_merge_line(id) ON DELETE SET NULL;


--
-- Name: base_partner_merge_automatic_wizard base_partner_merge_automatic_wizard_dst_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_partner_merge_automatic_wizard
    ADD CONSTRAINT base_partner_merge_automatic_wizard_dst_partner_id_fkey FOREIGN KEY (dst_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: base_partner_merge_automatic_wizard_res_partner_rel base_partner_merge_automatic_wizard_res_par_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_partner_merge_automatic_wizard_res_partner_rel
    ADD CONSTRAINT base_partner_merge_automatic_wizard_res_par_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: base_partner_merge_automatic_wizard base_partner_merge_automatic_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_partner_merge_line base_partner_merge_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: base_partner_merge_line base_partner_merge_line_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.base_partner_merge_line
    ADD CONSTRAINT base_partner_merge_line_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.base_partner_merge_automatic_wizard(id) ON DELETE SET NULL;


--
-- Name: base_partner_merge_line base_partner_merge_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bill_to_po_wizard bill_to_po_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bill_to_po_wizard bill_to_po_wizard_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.bill_to_po_wizard
    ADD CONSTRAINT bill_to_po_wizard_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: bill_to_po_wizard bill_to_po_wizard_purchase_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.bill_to_po_wizard
    ADD CONSTRAINT bill_to_po_wizard_purchase_order_id_fkey FOREIGN KEY (purchase_order_id) REFERENCES public.purchase_order(id) ON DELETE SET NULL;


--
-- Name: bill_to_po_wizard bill_to_po_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bus_bus bus_bus_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bus_bus bus_bus_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: bus_presence bus_presence_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.bus_presence
    ADD CONSTRAINT bus_presence_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES public.mail_guest(id) ON DELETE CASCADE;


--
-- Name: bus_presence bus_presence_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.bus_presence
    ADD CONSTRAINT bus_presence_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: calendar_alarm_calendar_event_rel calendar_alarm_calendar_event_rel_calendar_alarm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_alarm_calendar_event_rel
    ADD CONSTRAINT calendar_alarm_calendar_event_rel_calendar_alarm_id_fkey FOREIGN KEY (calendar_alarm_id) REFERENCES public.calendar_alarm(id) ON DELETE RESTRICT;


--
-- Name: calendar_alarm_calendar_event_rel calendar_alarm_calendar_event_rel_calendar_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_alarm_calendar_event_rel
    ADD CONSTRAINT calendar_alarm_calendar_event_rel_calendar_event_id_fkey FOREIGN KEY (calendar_event_id) REFERENCES public.calendar_event(id) ON DELETE CASCADE;


--
-- Name: calendar_alarm calendar_alarm_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_alarm calendar_alarm_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_alarm
    ADD CONSTRAINT calendar_alarm_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: calendar_alarm calendar_alarm_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_alarm
    ADD CONSTRAINT calendar_alarm_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE SET NULL;


--
-- Name: calendar_alarm calendar_alarm_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_attendee calendar_attendee_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_attendee calendar_attendee_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_attendee
    ADD CONSTRAINT calendar_attendee_event_id_fkey FOREIGN KEY (event_id) REFERENCES public.calendar_event(id) ON DELETE CASCADE;


--
-- Name: calendar_attendee calendar_attendee_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_attendee
    ADD CONSTRAINT calendar_attendee_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: calendar_attendee calendar_attendee_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event calendar_event_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event calendar_event_opportunity_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_event
    ADD CONSTRAINT calendar_event_opportunity_id_fkey FOREIGN KEY (opportunity_id) REFERENCES public.crm_lead(id) ON DELETE SET NULL;


--
-- Name: calendar_event calendar_event_recurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_event
    ADD CONSTRAINT calendar_event_recurrence_id_fkey FOREIGN KEY (recurrence_id) REFERENCES public.calendar_recurrence(id) ON DELETE SET NULL;


--
-- Name: calendar_event calendar_event_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_event
    ADD CONSTRAINT calendar_event_res_model_id_fkey FOREIGN KEY (res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: calendar_event_res_partner_rel calendar_event_res_partner_rel_calendar_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_event_res_partner_rel
    ADD CONSTRAINT calendar_event_res_partner_rel_calendar_event_id_fkey FOREIGN KEY (calendar_event_id) REFERENCES public.calendar_event(id) ON DELETE CASCADE;


--
-- Name: calendar_event_res_partner_rel calendar_event_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_event_res_partner_rel
    ADD CONSTRAINT calendar_event_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: calendar_event_type calendar_event_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event_type calendar_event_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_event calendar_event_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_event
    ADD CONSTRAINT calendar_event_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: calendar_event calendar_event_videocall_channel_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_event
    ADD CONSTRAINT calendar_event_videocall_channel_id_fkey FOREIGN KEY (videocall_channel_id) REFERENCES public.discuss_channel(id) ON DELETE SET NULL;


--
-- Name: calendar_event calendar_event_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_filters calendar_filters_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_filters calendar_filters_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_filters
    ADD CONSTRAINT calendar_filters_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: calendar_filters calendar_filters_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_filters
    ADD CONSTRAINT calendar_filters_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: calendar_filters calendar_filters_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_popover_delete_wizard calendar_popover_delete_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_popover_delete_wizard calendar_popover_delete_wizard_record_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_popover_delete_wizard
    ADD CONSTRAINT calendar_popover_delete_wizard_record_fkey FOREIGN KEY (record) REFERENCES public.calendar_event(id) ON DELETE SET NULL;


--
-- Name: calendar_popover_delete_wizard calendar_popover_delete_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_provider_config calendar_provider_config_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_provider_config calendar_provider_config_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_recurrence calendar_recurrence_base_event_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_recurrence
    ADD CONSTRAINT calendar_recurrence_base_event_id_fkey FOREIGN KEY (base_event_id) REFERENCES public.calendar_event(id) ON DELETE SET NULL;


--
-- Name: calendar_recurrence calendar_recurrence_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: calendar_recurrence calendar_recurrence_trigger_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.calendar_recurrence
    ADD CONSTRAINT calendar_recurrence_trigger_id_fkey FOREIGN KEY (trigger_id) REFERENCES public.ir_cron_trigger(id) ON DELETE SET NULL;


--
-- Name: calendar_recurrence calendar_recurrence_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_certificate certificate_certificate_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.certificate_certificate
    ADD CONSTRAINT certificate_certificate_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: certificate_certificate certificate_certificate_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_certificate certificate_certificate_private_key_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.certificate_certificate
    ADD CONSTRAINT certificate_certificate_private_key_id_fkey FOREIGN KEY (private_key_id) REFERENCES public.certificate_key(id) ON DELETE SET NULL;


--
-- Name: certificate_certificate certificate_certificate_public_key_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.certificate_certificate
    ADD CONSTRAINT certificate_certificate_public_key_id_fkey FOREIGN KEY (public_key_id) REFERENCES public.certificate_key(id) ON DELETE SET NULL;


--
-- Name: certificate_certificate certificate_certificate_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_key certificate_key_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.certificate_key
    ADD CONSTRAINT certificate_key_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: certificate_key certificate_key_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: certificate_key certificate_key_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: change_password_own change_password_own_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: change_password_own change_password_own_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
