-- Name: product_removal product_removal_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_removal product_removal_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_replenish product_replenish_bom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_bom_id_fkey FOREIGN KEY (bom_id) REFERENCES public.mrp_bom(id) ON DELETE SET NULL;


--
-- Name: product_replenish product_replenish_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_replenish product_replenish_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_replenish product_replenish_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_replenish product_replenish_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_replenish product_replenish_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE CASCADE;


--
-- Name: product_replenish product_replenish_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE SET NULL;


--
-- Name: product_replenish product_replenish_supplier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_supplier_id_fkey FOREIGN KEY (supplier_id) REFERENCES public.product_supplierinfo(id) ON DELETE SET NULL;


--
-- Name: product_replenish product_replenish_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_replenish
    ADD CONSTRAINT product_replenish_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: product_replenish product_replenish_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_supplier_taxes_rel product_supplier_taxes_rel_prod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplier_taxes_rel
    ADD CONSTRAINT product_supplier_taxes_rel_prod_id_fkey FOREIGN KEY (prod_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_supplier_taxes_rel product_supplier_taxes_rel_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplier_taxes_rel
    ADD CONSTRAINT product_supplier_taxes_rel_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: product_supplierinfo product_supplierinfo_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_supplierinfo product_supplierinfo_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_supplierinfo product_supplierinfo_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_supplierinfo product_supplierinfo_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: product_supplierinfo product_supplierinfo_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: product_supplierinfo product_supplierinfo_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo
    ADD CONSTRAINT product_supplierinfo_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_supplierinfo_stock_replenishment_info_rel product_supplierinfo_stock_rep_stock_replenishment_info_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo_stock_replenishment_info_rel
    ADD CONSTRAINT product_supplierinfo_stock_rep_stock_replenishment_info_id_fkey FOREIGN KEY (stock_replenishment_info_id) REFERENCES public.stock_replenishment_info(id) ON DELETE CASCADE;


--
-- Name: product_supplierinfo_stock_replenishment_info_rel product_supplierinfo_stock_repleni_product_supplierinfo_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_supplierinfo_stock_replenishment_info_rel
    ADD CONSTRAINT product_supplierinfo_stock_repleni_product_supplierinfo_id_fkey FOREIGN KEY (product_supplierinfo_id) REFERENCES public.product_supplierinfo(id) ON DELETE CASCADE;


--
-- Name: product_supplierinfo product_supplierinfo_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_tag product_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_tag_product_product_rel product_tag_product_product_rel_product_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_tag_product_product_rel
    ADD CONSTRAINT product_tag_product_product_rel_product_product_id_fkey FOREIGN KEY (product_product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_tag_product_product_rel product_tag_product_product_rel_product_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_tag_product_product_rel
    ADD CONSTRAINT product_tag_product_product_rel_product_tag_id_fkey FOREIGN KEY (product_tag_id) REFERENCES public.product_tag(id) ON DELETE CASCADE;


--
-- Name: product_tag_product_template_rel product_tag_product_template_rel_product_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_tag_product_template_rel
    ADD CONSTRAINT product_tag_product_template_rel_product_tag_id_fkey FOREIGN KEY (product_tag_id) REFERENCES public.product_tag(id) ON DELETE CASCADE;


--
-- Name: product_tag_product_template_rel product_tag_product_template_rel_product_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_tag_product_template_rel
    ADD CONSTRAINT product_tag_product_template_rel_product_template_id_fkey FOREIGN KEY (product_template_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_tag product_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_taxes_rel product_taxes_rel_prod_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_taxes_rel
    ADD CONSTRAINT product_taxes_rel_prod_id_fkey FOREIGN KEY (prod_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_taxes_rel product_taxes_rel_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_taxes_rel
    ADD CONSTRAINT product_taxes_rel_tax_id_fkey FOREIGN KEY (tax_id) REFERENCES public.account_tax(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_exclusion product_template_attribute_ex_product_template_attribute_v_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_exclusion
    ADD CONSTRAINT product_template_attribute_ex_product_template_attribute_v_fkey FOREIGN KEY (product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_exclusion product_template_attribute_exclusion_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_template_attribute_exclusion product_template_attribute_exclusion_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_exclusion
    ADD CONSTRAINT product_template_attribute_exclusion_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_exclusion product_template_attribute_exclusion_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_template_attribute_line product_template_attribute_line_attribute_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_line
    ADD CONSTRAINT product_template_attribute_line_attribute_id_fkey FOREIGN KEY (attribute_id) REFERENCES public.product_attribute(id) ON DELETE RESTRICT;


--
-- Name: product_template_attribute_line product_template_attribute_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_template_attribute_line product_template_attribute_line_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_line
    ADD CONSTRAINT product_template_attribute_line_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_line product_template_attribute_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_template_attribute_value_purchase_order_line_rel product_template_attribute_v_product_template_attribute_v_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value_purchase_order_line_rel
    ADD CONSTRAINT product_template_attribute_v_product_template_attribute_v_fkey1 FOREIGN KEY (product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE RESTRICT;


--
-- Name: product_template_attribute_value_sale_order_line_rel product_template_attribute_va_product_template_attribute_v_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value_sale_order_line_rel
    ADD CONSTRAINT product_template_attribute_va_product_template_attribute_v_fkey FOREIGN KEY (product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE RESTRICT;


--
-- Name: product_template_attribute_value product_template_attribute_valu_product_attribute_value_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_valu_product_attribute_value_id_fkey FOREIGN KEY (product_attribute_value_id) REFERENCES public.product_attribute_value(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_value product_template_attribute_value_attribute_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_value_attribute_id_fkey FOREIGN KEY (attribute_id) REFERENCES public.product_attribute(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_value product_template_attribute_value_attribute_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_value_attribute_line_id_fkey FOREIGN KEY (attribute_line_id) REFERENCES public.product_template_attribute_line(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_value product_template_attribute_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_template_attribute_value product_template_attribute_value_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value
    ADD CONSTRAINT product_template_attribute_value_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE SET NULL;


--
-- Name: product_template_attribute_value_purchase_order_line_rel product_template_attribute_value_pu_purchase_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value_purchase_order_line_rel
    ADD CONSTRAINT product_template_attribute_value_pu_purchase_order_line_id_fkey FOREIGN KEY (purchase_order_line_id) REFERENCES public.purchase_order_line(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_value_sale_order_line_rel product_template_attribute_value_sale_o_sale_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template_attribute_value_sale_order_line_rel
    ADD CONSTRAINT product_template_attribute_value_sale_o_sale_order_line_id_fkey FOREIGN KEY (sale_order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: product_template_attribute_value product_template_attribute_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_template product_template_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_categ_id_fkey FOREIGN KEY (categ_id) REFERENCES public.product_category(id) ON DELETE RESTRICT;


--
-- Name: product_template product_template_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: product_template product_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_template product_template_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_uom_id_fkey FOREIGN KEY (uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: product_template product_template_uom_po_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_template
    ADD CONSTRAINT product_template_uom_po_id_fkey FOREIGN KEY (uom_po_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: product_template product_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: product_variant_combination product_variant_combination_product_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_variant_combination
    ADD CONSTRAINT product_variant_combination_product_product_id_fkey FOREIGN KEY (product_product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: product_variant_combination product_variant_combination_product_template_attribute_val_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.product_variant_combination
    ADD CONSTRAINT product_variant_combination_product_template_attribute_val_fkey FOREIGN KEY (product_template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE RESTRICT;


--
-- Name: project_collaborator project_collaborator_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_collaborator project_collaborator_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_collaborator
    ADD CONSTRAINT project_collaborator_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: project_collaborator project_collaborator_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_collaborator
    ADD CONSTRAINT project_collaborator_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE RESTRICT;


--
-- Name: project_collaborator project_collaborator_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_favorite_user_rel project_favorite_user_rel_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_favorite_user_rel
    ADD CONSTRAINT project_favorite_user_rel_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE CASCADE;


--
-- Name: project_favorite_user_rel project_favorite_user_rel_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_favorite_user_rel
    ADD CONSTRAINT project_favorite_user_rel_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: project_milestone project_milestone_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_milestone project_milestone_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_milestone
    ADD CONSTRAINT project_milestone_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE CASCADE;


--
-- Name: project_milestone project_milestone_sale_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_milestone
    ADD CONSTRAINT project_milestone_sale_line_id_fkey FOREIGN KEY (sale_line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: project_milestone project_milestone_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_project project_project_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_analytic_account(id) ON DELETE SET NULL;


--
-- Name: project_project project_project_alias_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_alias_id_fkey FOREIGN KEY (alias_id) REFERENCES public.mail_alias(id) ON DELETE RESTRICT;


--
-- Name: project_project project_project_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: project_project project_project_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_project project_project_last_update_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_last_update_id_fkey FOREIGN KEY (last_update_id) REFERENCES public.project_update(id) ON DELETE SET NULL;


--
-- Name: project_project project_project_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: project_project_project_tags_rel project_project_project_tags_rel_project_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_project_tags_rel
    ADD CONSTRAINT project_project_project_tags_rel_project_project_id_fkey FOREIGN KEY (project_project_id) REFERENCES public.project_project(id) ON DELETE CASCADE;


--
-- Name: project_project_project_tags_rel project_project_project_tags_rel_project_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_project_tags_rel
    ADD CONSTRAINT project_project_project_tags_rel_project_tags_id_fkey FOREIGN KEY (project_tags_id) REFERENCES public.project_tags(id) ON DELETE CASCADE;


--
-- Name: project_project_project_task_type_delete_wizard_rel project_project_project_task__project_task_type_delete_wiz_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_project_task_type_delete_wizard_rel
    ADD CONSTRAINT project_project_project_task__project_task_type_delete_wiz_fkey FOREIGN KEY (project_task_type_delete_wizard_id) REFERENCES public.project_task_type_delete_wizard(id) ON DELETE CASCADE;


--
-- Name: project_project_project_task_type_delete_wizard_rel project_project_project_task_type_delet_project_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_project_task_type_delete_wizard_rel
    ADD CONSTRAINT project_project_project_task_type_delet_project_project_id_fkey FOREIGN KEY (project_project_id) REFERENCES public.project_project(id) ON DELETE CASCADE;


--
-- Name: project_project project_project_reinvoiced_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_reinvoiced_sale_order_id_fkey FOREIGN KEY (reinvoiced_sale_order_id) REFERENCES public.sale_order(id) ON DELETE SET NULL;


--
-- Name: project_project project_project_sale_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_sale_line_id_fkey FOREIGN KEY (sale_line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: project_project_stage project_project_stage_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_stage
    ADD CONSTRAINT project_project_stage_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: project_project_stage project_project_stage_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_project_stage_delete_wizard project_project_stage_delete_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_project_stage_delete_wizard project_project_stage_delete_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_project project_project_stage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_stage_id_fkey FOREIGN KEY (stage_id) REFERENCES public.project_project_stage(id) ON DELETE RESTRICT;


--
-- Name: project_project_stage project_project_stage_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_stage
    ADD CONSTRAINT project_project_stage_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: project_project_stage_project_project_stage_delete_wizard_rel project_project_stage_project_pro_project_project_stage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_stage_project_project_stage_delete_wizard_rel
    ADD CONSTRAINT project_project_stage_project_pro_project_project_stage_id_fkey FOREIGN KEY (project_project_stage_id) REFERENCES public.project_project_stage(id) ON DELETE CASCADE;


--
-- Name: project_project_stage_project_project_stage_delete_wizard_rel project_project_stage_project_project_project_stage_delete_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_stage_project_project_stage_delete_wizard_rel
    ADD CONSTRAINT project_project_stage_project_project_project_stage_delete_fkey FOREIGN KEY (project_project_stage_delete_wizard_id) REFERENCES public.project_project_stage_delete_wizard(id) ON DELETE CASCADE;


--
-- Name: project_project_stage project_project_stage_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project_stage
    ADD CONSTRAINT project_project_stage_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE SET NULL;


--
-- Name: project_project_stage project_project_stage_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_project project_project_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_project
    ADD CONSTRAINT project_project_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_project project_project_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_share_collaborator_wizard project_share_collaborator_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_share_collaborator_wizard project_share_collaborator_wizard_parent_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_share_collaborator_wizard
    ADD CONSTRAINT project_share_collaborator_wizard_parent_wizard_id_fkey FOREIGN KEY (parent_wizard_id) REFERENCES public.project_share_wizard(id) ON DELETE SET NULL;


--
-- Name: project_share_collaborator_wizard project_share_collaborator_wizard_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_share_collaborator_wizard
    ADD CONSTRAINT project_share_collaborator_wizard_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: project_share_collaborator_wizard project_share_collaborator_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_share_wizard project_share_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_share_wizard_res_partner_rel project_share_wizard_res_partner_r_project_share_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_share_wizard_res_partner_rel
    ADD CONSTRAINT project_share_wizard_res_partner_r_project_share_wizard_id_fkey FOREIGN KEY (project_share_wizard_id) REFERENCES public.project_share_wizard(id) ON DELETE CASCADE;


--
-- Name: project_share_wizard_res_partner_rel project_share_wizard_res_partner_rel_res_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_share_wizard_res_partner_rel
    ADD CONSTRAINT project_share_wizard_res_partner_rel_res_partner_id_fkey FOREIGN KEY (res_partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: project_share_wizard project_share_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_tags project_tags_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_tags_project_task_rel project_tags_project_task_rel_project_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_tags_project_task_rel
    ADD CONSTRAINT project_tags_project_task_rel_project_tags_id_fkey FOREIGN KEY (project_tags_id) REFERENCES public.project_tags(id) ON DELETE CASCADE;


--
-- Name: project_tags_project_task_rel project_tags_project_task_rel_project_task_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_tags_project_task_rel
    ADD CONSTRAINT project_tags_project_task_rel_project_task_id_fkey FOREIGN KEY (project_task_id) REFERENCES public.project_task(id) ON DELETE CASCADE;


--
-- Name: project_tags project_tags_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_task project_task_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_task project_task_displayed_image_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_displayed_image_id_fkey FOREIGN KEY (displayed_image_id) REFERENCES public.ir_attachment(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_milestone_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_milestone_id_fkey FOREIGN KEY (milestone_id) REFERENCES public.project_milestone(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_task project_task_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE SET NULL;


--
-- Name: project_task_recurrence project_task_recurrence_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_task project_task_recurrence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_recurrence_id_fkey FOREIGN KEY (recurrence_id) REFERENCES public.project_task_recurrence(id) ON DELETE SET NULL;


--
-- Name: project_task_recurrence project_task_recurrence_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_task project_task_sale_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_sale_line_id_fkey FOREIGN KEY (sale_line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE SET NULL;


--
-- Name: project_task project_task_stage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task
    ADD CONSTRAINT project_task_stage_id_fkey FOREIGN KEY (stage_id) REFERENCES public.project_task_type(id) ON DELETE RESTRICT;


--
-- Name: project_task_type project_task_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_task_type_delete_wizard project_task_type_delete_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_task_type_delete_wizard project_task_type_delete_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_task_type project_task_type_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type
    ADD CONSTRAINT project_task_type_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: project_task_type_project_task_type_delete_wizard_rel project_task_type_project_tas_project_task_type_delete_wiz_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type_project_task_type_delete_wizard_rel
    ADD CONSTRAINT project_task_type_project_tas_project_task_type_delete_wiz_fkey FOREIGN KEY (project_task_type_delete_wizard_id) REFERENCES public.project_task_type_delete_wizard(id) ON DELETE CASCADE;


--
-- Name: project_task_type_project_task_type_delete_wizard_rel project_task_type_project_task_type_d_project_task_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type_project_task_type_delete_wizard_rel
    ADD CONSTRAINT project_task_type_project_task_type_d_project_task_type_id_fkey FOREIGN KEY (project_task_type_id) REFERENCES public.project_task_type(id) ON DELETE CASCADE;


--
-- Name: project_task_type project_task_type_rating_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type
    ADD CONSTRAINT project_task_type_rating_template_id_fkey FOREIGN KEY (rating_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: project_task_type_rel project_task_type_rel_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type_rel
    ADD CONSTRAINT project_task_type_rel_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE CASCADE;


--
-- Name: project_task_type_rel project_task_type_rel_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type_rel
    ADD CONSTRAINT project_task_type_rel_type_id_fkey FOREIGN KEY (type_id) REFERENCES public.project_task_type(id) ON DELETE CASCADE;


--
-- Name: project_task_type project_task_type_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type
    ADD CONSTRAINT project_task_type_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE SET NULL;


--
-- Name: project_task_type project_task_type_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_type
    ADD CONSTRAINT project_task_type_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: project_task_type project_task_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_task_user_rel project_task_user_rel_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_task_user_rel project_task_user_rel_stage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_user_rel
    ADD CONSTRAINT project_task_user_rel_stage_id_fkey FOREIGN KEY (stage_id) REFERENCES public.project_task_type(id) ON DELETE RESTRICT;


--
-- Name: project_task_user_rel project_task_user_rel_task_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_user_rel
    ADD CONSTRAINT project_task_user_rel_task_id_fkey FOREIGN KEY (task_id) REFERENCES public.project_task(id) ON DELETE CASCADE;


--
-- Name: project_task_user_rel project_task_user_rel_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_task_user_rel
    ADD CONSTRAINT project_task_user_rel_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: project_task_user_rel project_task_user_rel_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_task project_task_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_update project_update_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: project_update project_update_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_update
    ADD CONSTRAINT project_update_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE RESTRICT;


--
-- Name: project_update project_update_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.project_update
    ADD CONSTRAINT project_update_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: project_update project_update_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: purchase_order purchase_order_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: purchase_order purchase_order_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: purchase_order purchase_order_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: purchase_order purchase_order_dest_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_dest_address_id_fkey FOREIGN KEY (dest_address_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_fiscal_position_id_fkey FOREIGN KEY (fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_incoterm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_incoterm_id_fkey FOREIGN KEY (incoterm_id) REFERENCES public.account_incoterms(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: purchase_order_line purchase_order_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: purchase_order_line purchase_order_line_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_location_final_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_location_final_id_fkey FOREIGN KEY (location_final_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.purchase_order(id) ON DELETE CASCADE;


--
-- Name: purchase_order_line purchase_order_line_orderpoint_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_orderpoint_id_fkey FOREIGN KEY (orderpoint_id) REFERENCES public.stock_warehouse_orderpoint(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: purchase_order_line purchase_order_line_product_packaging_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_product_packaging_id_fkey FOREIGN KEY (product_packaging_id) REFERENCES public.product_packaging(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_product_uom_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_product_uom_fkey FOREIGN KEY (product_uom) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: purchase_order_line purchase_order_line_sale_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_sale_line_id_fkey FOREIGN KEY (sale_line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_line
    ADD CONSTRAINT purchase_order_line_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE SET NULL;


--
-- Name: purchase_order_line purchase_order_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: purchase_order purchase_order_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: purchase_order purchase_order_payment_term_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_payment_term_id_fkey FOREIGN KEY (payment_term_id) REFERENCES public.account_payment_term(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_picking_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_picking_type_id_fkey FOREIGN KEY (picking_type_id) REFERENCES public.stock_picking_type(id) ON DELETE RESTRICT;


--
-- Name: purchase_order purchase_order_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE SET NULL;


--
-- Name: purchase_order_stock_picking_rel purchase_order_stock_picking_rel_purchase_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_stock_picking_rel
    ADD CONSTRAINT purchase_order_stock_picking_rel_purchase_order_id_fkey FOREIGN KEY (purchase_order_id) REFERENCES public.purchase_order(id) ON DELETE CASCADE;


--
-- Name: purchase_order_stock_picking_rel purchase_order_stock_picking_rel_stock_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order_stock_picking_rel
    ADD CONSTRAINT purchase_order_stock_picking_rel_stock_picking_id_fkey FOREIGN KEY (stock_picking_id) REFERENCES public.stock_picking(id) ON DELETE CASCADE;


--
-- Name: purchase_order purchase_order_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.purchase_order
    ADD CONSTRAINT purchase_order_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: purchase_order purchase_order_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: quotation_document quotation_document_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: quotation_document quotation_document_ir_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.quotation_document
    ADD CONSTRAINT quotation_document_ir_attachment_id_fkey FOREIGN KEY (ir_attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: quotation_document_sale_order_rel quotation_document_sale_order_rel_quotation_document_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.quotation_document_sale_order_rel
    ADD CONSTRAINT quotation_document_sale_order_rel_quotation_document_id_fkey FOREIGN KEY (quotation_document_id) REFERENCES public.quotation_document(id) ON DELETE CASCADE;


--
-- Name: quotation_document_sale_order_rel quotation_document_sale_order_rel_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.quotation_document_sale_order_rel
    ADD CONSTRAINT quotation_document_sale_order_rel_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: quotation_document_sale_pdf_form_field_rel quotation_document_sale_pdf_form_fi_sale_pdf_form_field_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.quotation_document_sale_pdf_form_field_rel
    ADD CONSTRAINT quotation_document_sale_pdf_form_fi_sale_pdf_form_field_id_fkey FOREIGN KEY (sale_pdf_form_field_id) REFERENCES public.sale_pdf_form_field(id) ON DELETE CASCADE;


--
-- Name: quotation_document_sale_pdf_form_field_rel quotation_document_sale_pdf_form_fie_quotation_document_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.quotation_document_sale_pdf_form_field_rel
    ADD CONSTRAINT quotation_document_sale_pdf_form_fie_quotation_document_id_fkey FOREIGN KEY (quotation_document_id) REFERENCES public.quotation_document(id) ON DELETE CASCADE;


--
-- Name: quotation_document quotation_document_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: rating_rating rating_rating_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: rating_rating rating_rating_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: rating_rating rating_rating_parent_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_parent_res_model_id_fkey FOREIGN KEY (parent_res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: rating_rating rating_rating_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: rating_rating rating_rating_publisher_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_publisher_id_fkey FOREIGN KEY (publisher_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: rating_rating rating_rating_rated_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_rated_partner_id_fkey FOREIGN KEY (rated_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: rating_rating rating_rating_res_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rating_rating
    ADD CONSTRAINT rating_rating_res_model_id_fkey FOREIGN KEY (res_model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: rating_rating rating_rating_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: rel_badge_auth_users rel_badge_auth_users_gamification_badge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rel_badge_auth_users
    ADD CONSTRAINT rel_badge_auth_users_gamification_badge_id_fkey FOREIGN KEY (gamification_badge_id) REFERENCES public.gamification_badge(id) ON DELETE CASCADE;


--
-- Name: rel_badge_auth_users rel_badge_auth_users_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rel_badge_auth_users
    ADD CONSTRAINT rel_badge_auth_users_res_users_id_fkey FOREIGN KEY (res_users_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: rel_modules_langexport rel_modules_langexport_module_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rel_modules_langexport
    ADD CONSTRAINT rel_modules_langexport_module_id_fkey FOREIGN KEY (module_id) REFERENCES public.ir_module_module(id) ON DELETE CASCADE;


--
-- Name: rel_modules_langexport rel_modules_langexport_wiz_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rel_modules_langexport
    ADD CONSTRAINT rel_modules_langexport_wiz_id_fkey FOREIGN KEY (wiz_id) REFERENCES public.base_language_export(id) ON DELETE CASCADE;


--
-- Name: rel_server_actions rel_server_actions_action_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rel_server_actions
    ADD CONSTRAINT rel_server_actions_action_id_fkey FOREIGN KEY (action_id) REFERENCES public.ir_act_server(id) ON DELETE CASCADE;


--
-- Name: rel_server_actions rel_server_actions_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rel_server_actions
    ADD CONSTRAINT rel_server_actions_server_id_fkey FOREIGN KEY (server_id) REFERENCES public.ir_act_server(id) ON DELETE CASCADE;


--
-- Name: repair_order repair_order_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: repair_order repair_order_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: repair_order repair_order_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_location_dest_id_fkey FOREIGN KEY (location_dest_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: repair_order repair_order_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: repair_order repair_order_lot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_lot_id_fkey FOREIGN KEY (lot_id) REFERENCES public.stock_lot(id) ON DELETE SET NULL;


--
-- Name: repair_order repair_order_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: repair_order repair_order_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: repair_order repair_order_parts_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_parts_location_id_fkey FOREIGN KEY (parts_location_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: repair_order repair_order_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: repair_order repair_order_picking_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_picking_type_id_fkey FOREIGN KEY (picking_type_id) REFERENCES public.stock_picking_type(id) ON DELETE RESTRICT;


--
-- Name: repair_order repair_order_procurement_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_procurement_group_id_fkey FOREIGN KEY (procurement_group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: repair_order repair_order_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: repair_order repair_order_product_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_product_location_dest_id_fkey FOREIGN KEY (product_location_dest_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: repair_order repair_order_product_location_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_product_location_src_id_fkey FOREIGN KEY (product_location_src_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: repair_order repair_order_product_uom_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_product_uom_fkey FOREIGN KEY (product_uom) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


--
-- Name: repair_order repair_order_recycle_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_recycle_location_id_fkey FOREIGN KEY (recycle_location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: repair_order_repair_tags_rel repair_order_repair_tags_rel_repair_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order_repair_tags_rel
    ADD CONSTRAINT repair_order_repair_tags_rel_repair_order_id_fkey FOREIGN KEY (repair_order_id) REFERENCES public.repair_order(id) ON DELETE CASCADE;


--
-- Name: repair_order_repair_tags_rel repair_order_repair_tags_rel_repair_tags_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order_repair_tags_rel
    ADD CONSTRAINT repair_order_repair_tags_rel_repair_tags_id_fkey FOREIGN KEY (repair_tags_id) REFERENCES public.repair_tags(id) ON DELETE CASCADE;


--
-- Name: repair_order repair_order_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE SET NULL;


--
-- Name: repair_order repair_order_sale_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_sale_order_line_id_fkey FOREIGN KEY (sale_order_line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: repair_order repair_order_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.repair_order
    ADD CONSTRAINT repair_order_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: repair_order repair_order_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: repair_tags repair_tags_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: repair_tags repair_tags_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: report_layout report_layout_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: report_layout report_layout_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.report_layout
    ADD CONSTRAINT report_layout_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE RESTRICT;


--
-- Name: report_layout report_layout_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: report_paperformat report_paperformat_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: report_paperformat report_paperformat_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_bank res_bank_country_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_bank
    ADD CONSTRAINT res_bank_country_fkey FOREIGN KEY (country) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: res_bank res_bank_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_bank res_bank_state_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_bank
    ADD CONSTRAINT res_bank_state_fkey FOREIGN KEY (state) REFERENCES public.res_country_state(id) ON DELETE SET NULL;


--
-- Name: res_bank res_bank_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_company res_company_account_cash_basis_base_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_cash_basis_base_account_id_fkey FOREIGN KEY (account_cash_basis_base_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_default_pos_receivable_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_default_pos_receivable_account_id_fkey FOREIGN KEY (account_default_pos_receivable_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_discount_expense_allocation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_discount_expense_allocation_id_fkey FOREIGN KEY (account_discount_expense_allocation_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_discount_income_allocation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_discount_income_allocation_id_fkey FOREIGN KEY (account_discount_income_allocation_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_fiscal_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_fiscal_country_id_fkey FOREIGN KEY (account_fiscal_country_id) REFERENCES public.res_country(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_journal_early_pay_discount_gain_accoun_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_journal_early_pay_discount_gain_accoun_fkey FOREIGN KEY (account_journal_early_pay_discount_gain_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_journal_early_pay_discount_loss_accoun_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_journal_early_pay_discount_loss_accoun_fkey FOREIGN KEY (account_journal_early_pay_discount_loss_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_journal_suspense_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_journal_suspense_account_id_fkey FOREIGN KEY (account_journal_suspense_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_opening_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_opening_move_id_fkey FOREIGN KEY (account_opening_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_production_wip_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_production_wip_account_id_fkey FOREIGN KEY (account_production_wip_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_production_wip_overhead_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_production_wip_overhead_account_id_fkey FOREIGN KEY (account_production_wip_overhead_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_purchase_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_purchase_tax_id_fkey FOREIGN KEY (account_purchase_tax_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_account_sale_tax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_account_sale_tax_id_fkey FOREIGN KEY (account_sale_tax_id) REFERENCES public.account_tax(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_alias_domain_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_alias_domain_id_fkey FOREIGN KEY (alias_domain_id) REFERENCES public.mail_alias_domain(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_automatic_entry_default_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_automatic_entry_default_journal_id_fkey FOREIGN KEY (automatic_entry_default_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_batch_payment_sequence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_batch_payment_sequence_id_fkey FOREIGN KEY (batch_payment_sequence_id) REFERENCES public.ir_sequence(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_company res_company_currency_exchange_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_currency_exchange_journal_id_fkey FOREIGN KEY (currency_exchange_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_company res_company_default_cash_difference_expense_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_default_cash_difference_expense_account_id_fkey FOREIGN KEY (default_cash_difference_expense_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_default_cash_difference_income_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_default_cash_difference_income_account_id_fkey FOREIGN KEY (default_cash_difference_income_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_expense_accrual_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_expense_accrual_account_id_fkey FOREIGN KEY (expense_accrual_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_expense_currency_exchange_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_expense_currency_exchange_account_id_fkey FOREIGN KEY (expense_currency_exchange_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_external_report_layout_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_external_report_layout_id_fkey FOREIGN KEY (external_report_layout_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_income_currency_exchange_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_income_currency_exchange_account_id_fkey FOREIGN KEY (income_currency_exchange_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_incoterm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_incoterm_id_fkey FOREIGN KEY (incoterm_id) REFERENCES public.account_incoterms(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_internal_transit_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_internal_transit_location_id_fkey FOREIGN KEY (internal_transit_location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: res_company res_company_nomenclature_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_nomenclature_id_fkey FOREIGN KEY (nomenclature_id) REFERENCES public.barcode_nomenclature(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_paperformat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_paperformat_id_fkey FOREIGN KEY (paperformat_id) REFERENCES public.report_paperformat(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: res_company res_company_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: res_company res_company_peppol_purchase_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_peppol_purchase_journal_id_fkey FOREIGN KEY (peppol_purchase_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_resource_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_resource_calendar_id_fkey FOREIGN KEY (resource_calendar_id) REFERENCES public.resource_calendar(id) ON DELETE RESTRICT;


--
-- Name: res_company res_company_revenue_accrual_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_revenue_accrual_account_id_fkey FOREIGN KEY (revenue_accrual_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_sale_discount_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_sale_discount_product_id_fkey FOREIGN KEY (sale_discount_product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_stock_mail_confirmation_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_stock_mail_confirmation_template_id_fkey FOREIGN KEY (stock_mail_confirmation_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_stock_sms_confirmation_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_stock_sms_confirmation_template_id_fkey FOREIGN KEY (stock_sms_confirmation_template_id) REFERENCES public.sms_template(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_tax_cash_basis_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_tax_cash_basis_journal_id_fkey FOREIGN KEY (tax_cash_basis_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: res_company res_company_transfer_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company
    ADD CONSTRAINT res_company_transfer_account_id_fkey FOREIGN KEY (transfer_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: res_company_users_rel res_company_users_rel_cid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company_users_rel
    ADD CONSTRAINT res_company_users_rel_cid_fkey FOREIGN KEY (cid) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: res_company_users_rel res_company_users_rel_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_company_users_rel
    ADD CONSTRAINT res_company_users_rel_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_company res_company_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_config res_config_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_config_settings res_config_settings_auth_signup_template_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_auth_signup_template_user_id_fkey FOREIGN KEY (auth_signup_template_user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: res_config_settings res_config_settings_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_config_settings res_config_settings_digest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_digest_id_fkey FOREIGN KEY (digest_id) REFERENCES public.digest_digest(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_invoice_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_config_settings
    ADD CONSTRAINT res_config_settings_invoice_mail_template_id_fkey FOREIGN KEY (invoice_mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: res_config_settings res_config_settings_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_config res_config_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_country res_country_address_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country
    ADD CONSTRAINT res_country_address_view_id_fkey FOREIGN KEY (address_view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: res_country res_country_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_country res_country_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_country_group res_country_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_country_group_pricelist_rel res_country_group_pricelist_rel_pricelist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_group_pricelist_rel
    ADD CONSTRAINT res_country_group_pricelist_rel_pricelist_id_fkey FOREIGN KEY (pricelist_id) REFERENCES public.product_pricelist(id) ON DELETE CASCADE;


--
-- Name: res_country_group_pricelist_rel res_country_group_pricelist_rel_res_country_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_group_pricelist_rel
    ADD CONSTRAINT res_country_group_pricelist_rel_res_country_group_id_fkey FOREIGN KEY (res_country_group_id) REFERENCES public.res_country_group(id) ON DELETE CASCADE;


--
-- Name: res_country_group res_country_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_country_res_country_group_rel res_country_res_country_group_rel_res_country_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_res_country_group_rel
    ADD CONSTRAINT res_country_res_country_group_rel_res_country_group_id_fkey FOREIGN KEY (res_country_group_id) REFERENCES public.res_country_group(id) ON DELETE CASCADE;


--
-- Name: res_country_res_country_group_rel res_country_res_country_group_rel_res_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_res_country_group_rel
    ADD CONSTRAINT res_country_res_country_group_rel_res_country_id_fkey FOREIGN KEY (res_country_id) REFERENCES public.res_country(id) ON DELETE CASCADE;


--
-- Name: res_country_state res_country_state_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_country_state
    ADD CONSTRAINT res_country_state_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE RESTRICT;


--
-- Name: res_country_state res_country_state_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_country_state res_country_state_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_country res_country_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_currency res_currency_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_currency_rate res_currency_rate_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_currency_rate
    ADD CONSTRAINT res_currency_rate_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: res_currency_rate res_currency_rate_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_currency_rate res_currency_rate_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_currency_rate
    ADD CONSTRAINT res_currency_rate_currency_id_fkey FOREIGN KEY (currency_id) REFERENCES public.res_currency(id) ON DELETE CASCADE;


--
-- Name: res_currency_rate res_currency_rate_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_currency res_currency_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_device_log res_device_log_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_device_log res_device_log_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_device_log
    ADD CONSTRAINT res_device_log_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_device_log res_device_log_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_groups res_groups_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups
    ADD CONSTRAINT res_groups_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.ir_module_category(id) ON DELETE SET NULL;


--
-- Name: res_groups res_groups_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_groups_implied_rel res_groups_implied_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_implied_rel
    ADD CONSTRAINT res_groups_implied_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_implied_rel res_groups_implied_rel_hid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_implied_rel
    ADD CONSTRAINT res_groups_implied_rel_hid_fkey FOREIGN KEY (hid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_report_rel res_groups_report_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_report_rel
    ADD CONSTRAINT res_groups_report_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_report_rel res_groups_report_rel_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_report_rel
    ADD CONSTRAINT res_groups_report_rel_uid_fkey FOREIGN KEY (uid) REFERENCES public.ir_act_report_xml(id) ON DELETE CASCADE;


--
-- Name: res_groups_spreadsheet_dashboard_rel res_groups_spreadsheet_dashboard__spreadsheet_dashboard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_spreadsheet_dashboard_rel
    ADD CONSTRAINT res_groups_spreadsheet_dashboard__spreadsheet_dashboard_id_fkey FOREIGN KEY (spreadsheet_dashboard_id) REFERENCES public.spreadsheet_dashboard(id) ON DELETE CASCADE;


--
-- Name: res_groups_spreadsheet_dashboard_rel res_groups_spreadsheet_dashboard_rel_res_groups_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_spreadsheet_dashboard_rel
    ADD CONSTRAINT res_groups_spreadsheet_dashboard_rel_res_groups_id_fkey FOREIGN KEY (res_groups_id) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_users_rel res_groups_users_rel_gid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_users_rel
    ADD CONSTRAINT res_groups_users_rel_gid_fkey FOREIGN KEY (gid) REFERENCES public.res_groups(id) ON DELETE CASCADE;


--
-- Name: res_groups_users_rel res_groups_users_rel_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_groups_users_rel
    ADD CONSTRAINT res_groups_users_rel_uid_fkey FOREIGN KEY (uid) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_groups res_groups_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_lang res_lang_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_lang_install_rel res_lang_install_rel_lang_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_lang_install_rel
    ADD CONSTRAINT res_lang_install_rel_lang_id_fkey FOREIGN KEY (lang_id) REFERENCES public.res_lang(id) ON DELETE CASCADE;


--
-- Name: res_lang_install_rel res_lang_install_rel_language_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_lang_install_rel
    ADD CONSTRAINT res_lang_install_rel_language_wizard_id_fkey FOREIGN KEY (language_wizard_id) REFERENCES public.base_language_install(id) ON DELETE CASCADE;


--
-- Name: res_lang res_lang_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner_autocomplete_sync res_partner_autocomplete_sync_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner_autocomplete_sync res_partner_autocomplete_sync_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_autocomplete_sync
    ADD CONSTRAINT res_partner_autocomplete_sync_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_partner_autocomplete_sync res_partner_autocomplete_sync_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner_bank res_partner_bank_bank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_bank_id_fkey FOREIGN KEY (bank_id) REFERENCES public.res_bank(id) ON DELETE SET NULL;


--
-- Name: res_partner_bank res_partner_bank_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: res_partner_bank res_partner_bank_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner_bank res_partner_bank_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner_bank res_partner_bank_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_bank
    ADD CONSTRAINT res_partner_bank_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_partner_bank res_partner_bank_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner res_partner_buyer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_buyer_id_fkey FOREIGN KEY (buyer_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner_category res_partner_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner_category res_partner_category_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner_category res_partner_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner res_partner_commercial_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_commercial_partner_id_fkey FOREIGN KEY (commercial_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_country_id_fkey FOREIGN KEY (country_id) REFERENCES public.res_country(id) ON DELETE RESTRICT;


--
-- Name: res_partner res_partner_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner_industry res_partner_industry_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner res_partner_industry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_industry_id_fkey FOREIGN KEY (industry_id) REFERENCES public.res_partner_industry(id) ON DELETE SET NULL;


--
-- Name: res_partner_industry res_partner_industry_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner res_partner_invoice_template_pdf_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_invoice_template_pdf_report_id_fkey FOREIGN KEY (invoice_template_pdf_report_id) REFERENCES public.ir_act_report_xml(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_parent_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner_res_partner_category_rel res_partner_res_partner_category_rel_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_res_partner_category_rel
    ADD CONSTRAINT res_partner_res_partner_category_rel_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.res_partner_category(id) ON DELETE CASCADE;


--
-- Name: res_partner_res_partner_category_rel res_partner_res_partner_category_rel_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner_res_partner_category_rel
    ADD CONSTRAINT res_partner_res_partner_category_rel_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_partner res_partner_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_state_id_fkey FOREIGN KEY (state_id) REFERENCES public.res_country_state(id) ON DELETE RESTRICT;


--
-- Name: res_partner_title res_partner_title_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner res_partner_title_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_title_fkey FOREIGN KEY (title) REFERENCES public.res_partner_title(id) ON DELETE SET NULL;


--
-- Name: res_partner_title res_partner_title_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_partner res_partner_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_partner
    ADD CONSTRAINT res_partner_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_partner res_partner_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users_apikeys_description res_users_apikeys_description_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users_apikeys_description res_users_apikeys_description_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users_apikeys res_users_apikeys_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_apikeys
    ADD CONSTRAINT res_users_apikeys_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_users res_users_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: res_users res_users_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users_deletion res_users_deletion_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users_deletion res_users_deletion_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_deletion
    ADD CONSTRAINT res_users_deletion_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: res_users_deletion res_users_deletion_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users_identitycheck res_users_identitycheck_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users_identitycheck res_users_identitycheck_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users_log res_users_log_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users_log res_users_log_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users res_users_next_rank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_next_rank_id_fkey FOREIGN KEY (next_rank_id) REFERENCES public.gamification_karma_rank(id) ON DELETE SET NULL;


--
-- Name: res_users res_users_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: res_users res_users_rank_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_rank_id_fkey FOREIGN KEY (rank_id) REFERENCES public.gamification_karma_rank(id) ON DELETE SET NULL;


--
-- Name: res_users res_users_sale_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users
    ADD CONSTRAINT res_users_sale_team_id_fkey FOREIGN KEY (sale_team_id) REFERENCES public.crm_team(id) ON DELETE SET NULL;


--
-- Name: res_users_settings res_users_settings_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users_settings res_users_settings_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_settings
    ADD CONSTRAINT res_users_settings_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users_settings_volumes res_users_settings_volumes_guest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_settings_volumes
    ADD CONSTRAINT res_users_settings_volumes_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_settings_volumes
    ADD CONSTRAINT res_users_settings_volumes_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE CASCADE;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_user_setting_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_settings_volumes
    ADD CONSTRAINT res_users_settings_volumes_user_setting_id_fkey FOREIGN KEY (user_setting_id) REFERENCES public.res_users_settings(id) ON DELETE CASCADE;


--
-- Name: res_users_settings_volumes res_users_settings_volumes_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users_settings res_users_settings_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: res_users_web_tour_tour_rel res_users_web_tour_tour_rel_res_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_web_tour_tour_rel
    ADD CONSTRAINT res_users_web_tour_tour_rel_res_users_id_fkey FOREIGN KEY (res_users_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: res_users_web_tour_tour_rel res_users_web_tour_tour_rel_web_tour_tour_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.res_users_web_tour_tour_rel
    ADD CONSTRAINT res_users_web_tour_tour_rel_web_tour_tour_id_fkey FOREIGN KEY (web_tour_tour_id) REFERENCES public.web_tour_tour(id) ON DELETE CASCADE;


--
-- Name: res_users res_users_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: reset_view_arch_wizard reset_view_arch_wizard_compare_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.reset_view_arch_wizard
    ADD CONSTRAINT reset_view_arch_wizard_compare_view_id_fkey FOREIGN KEY (compare_view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: reset_view_arch_wizard reset_view_arch_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: reset_view_arch_wizard reset_view_arch_wizard_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.reset_view_arch_wizard
    ADD CONSTRAINT reset_view_arch_wizard_view_id_fkey FOREIGN KEY (view_id) REFERENCES public.ir_ui_view(id) ON DELETE SET NULL;


--
-- Name: reset_view_arch_wizard reset_view_arch_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: resource_calendar_attendance resource_calendar_attendance_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_attendance
    ADD CONSTRAINT resource_calendar_attendance_calendar_id_fkey FOREIGN KEY (calendar_id) REFERENCES public.resource_calendar(id) ON DELETE CASCADE;


--
-- Name: resource_calendar_attendance resource_calendar_attendance_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: resource_calendar_attendance resource_calendar_attendance_resource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_attendance
    ADD CONSTRAINT resource_calendar_attendance_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES public.resource_resource(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_attendance resource_calendar_attendance_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: resource_calendar resource_calendar_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar
    ADD CONSTRAINT resource_calendar_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: resource_calendar resource_calendar_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: resource_calendar_leaves resource_calendar_leaves_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_leaves
    ADD CONSTRAINT resource_calendar_leaves_calendar_id_fkey FOREIGN KEY (calendar_id) REFERENCES public.resource_calendar(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_leaves resource_calendar_leaves_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_leaves
    ADD CONSTRAINT resource_calendar_leaves_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_leaves resource_calendar_leaves_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: resource_calendar_leaves resource_calendar_leaves_resource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_calendar_leaves
    ADD CONSTRAINT resource_calendar_leaves_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES public.resource_resource(id) ON DELETE SET NULL;


--
-- Name: resource_calendar_leaves resource_calendar_leaves_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: resource_calendar resource_calendar_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: resource_resource resource_resource_calendar_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_resource
    ADD CONSTRAINT resource_resource_calendar_id_fkey FOREIGN KEY (calendar_id) REFERENCES public.resource_calendar(id) ON DELETE SET NULL;


--
-- Name: resource_resource resource_resource_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_resource
    ADD CONSTRAINT resource_resource_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: resource_resource resource_resource_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: resource_resource resource_resource_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.resource_resource
    ADD CONSTRAINT resource_resource_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: resource_resource resource_resource_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: rule_group_rel rule_group_rel_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rule_group_rel
    ADD CONSTRAINT rule_group_rel_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.res_groups(id) ON DELETE RESTRICT;


--
-- Name: rule_group_rel rule_group_rel_rule_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.rule_group_rel
    ADD CONSTRAINT rule_group_rel_rule_group_id_fkey FOREIGN KEY (rule_group_id) REFERENCES public.ir_rule(id) ON DELETE CASCADE;


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_advance_payment_inv
    ADD CONSTRAINT sale_advance_payment_inv_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_advance_payment_inv_sale_order_rel sale_advance_payment_inv_sale__sale_advance_payment_inv_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_advance_payment_inv_sale_order_rel
    ADD CONSTRAINT sale_advance_payment_inv_sale__sale_advance_payment_inv_id_fkey FOREIGN KEY (sale_advance_payment_inv_id) REFERENCES public.sale_advance_payment_inv(id) ON DELETE CASCADE;


--
-- Name: sale_advance_payment_inv_sale_order_rel sale_advance_payment_inv_sale_order_rel_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_advance_payment_inv_sale_order_rel
    ADD CONSTRAINT sale_advance_payment_inv_sale_order_rel_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_advance_payment_inv sale_advance_payment_inv_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_mass_cancel_orders sale_mass_cancel_orders_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_mass_cancel_orders sale_mass_cancel_orders_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order sale_order_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_campaign(id) ON DELETE SET NULL;


--
-- Name: sale_order_cancel sale_order_cancel_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_cancel
    ADD CONSTRAINT sale_order_cancel_author_id_fkey FOREIGN KEY (author_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: sale_order_cancel sale_order_cancel_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_cancel sale_order_cancel_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_cancel
    ADD CONSTRAINT sale_order_cancel_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_cancel sale_order_cancel_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_cancel sale_order_cancel_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order sale_order_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order sale_order_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_discount sale_order_discount_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_discount sale_order_discount_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_discount
    ADD CONSTRAINT sale_order_discount_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_discount sale_order_discount_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order sale_order_fiscal_position_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_fiscal_position_id_fkey FOREIGN KEY (fiscal_position_id) REFERENCES public.account_fiscal_position(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_incoterm_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_incoterm_fkey FOREIGN KEY (incoterm) REFERENCES public.account_incoterms(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_journal_id_fkey FOREIGN KEY (journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_combo_item_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_combo_item_id_fkey FOREIGN KEY (combo_item_id) REFERENCES public.product_combo_item(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_line sale_order_line_currency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_line_invoice_rel sale_order_line_invoice_rel_invoice_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line_invoice_rel
    ADD CONSTRAINT sale_order_line_invoice_rel_invoice_line_id_fkey FOREIGN KEY (invoice_line_id) REFERENCES public.account_move_line(id) ON DELETE CASCADE;


--
-- Name: sale_order_line_invoice_rel sale_order_line_invoice_rel_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line_invoice_rel
    ADD CONSTRAINT sale_order_line_invoice_rel_order_line_id_fkey FOREIGN KEY (order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: sale_order_line sale_order_line_linked_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_linked_line_id_fkey FOREIGN KEY (linked_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: sale_order_line sale_order_line_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_line sale_order_line_order_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_order_partner_id_fkey FOREIGN KEY (order_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: sale_order_line_product_document_rel sale_order_line_product_document_rel_product_document_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line_product_document_rel
    ADD CONSTRAINT sale_order_line_product_document_rel_product_document_id_fkey FOREIGN KEY (product_document_id) REFERENCES public.product_document(id) ON DELETE CASCADE;


--
-- Name: sale_order_line_product_document_rel sale_order_line_product_document_rel_sale_order_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line_product_document_rel
    ADD CONSTRAINT sale_order_line_product_document_rel_sale_order_line_id_fkey FOREIGN KEY (sale_order_line_id) REFERENCES public.sale_order_line(id) ON DELETE CASCADE;


--
-- Name: sale_order_line sale_order_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: sale_order_line sale_order_line_product_packaging_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_product_packaging_id_fkey FOREIGN KEY (product_packaging_id) REFERENCES public.product_packaging(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_product_uom_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_product_uom_fkey FOREIGN KEY (product_uom) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: sale_order_line sale_order_line_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE RESTRICT;


--
-- Name: sale_order_line sale_order_line_salesman_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_salesman_id_fkey FOREIGN KEY (salesman_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_task_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_task_id_fkey FOREIGN KEY (task_id) REFERENCES public.project_task(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_line
    ADD CONSTRAINT sale_order_line_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: sale_order_line sale_order_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_mass_cancel_wizard_rel sale_order_mass_cancel_wizard_r_sale_mass_cancel_orders_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_mass_cancel_wizard_rel
    ADD CONSTRAINT sale_order_mass_cancel_wizard_r_sale_mass_cancel_orders_id_fkey FOREIGN KEY (sale_mass_cancel_orders_id) REFERENCES public.sale_mass_cancel_orders(id) ON DELETE CASCADE;


--
-- Name: sale_order_mass_cancel_wizard_rel sale_order_mass_cancel_wizard_rel_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_mass_cancel_wizard_rel
    ADD CONSTRAINT sale_order_mass_cancel_wizard_rel_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order sale_order_medium_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_medium_id_fkey FOREIGN KEY (medium_id) REFERENCES public.utm_medium(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_opportunity_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_opportunity_id_fkey FOREIGN KEY (opportunity_id) REFERENCES public.crm_lead(id) ON DELETE SET NULL;


--
-- Name: sale_order_option sale_order_option_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_option sale_order_option_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_line_id_fkey FOREIGN KEY (line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: sale_order_option sale_order_option_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_option sale_order_option_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: sale_order_option sale_order_option_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_option
    ADD CONSTRAINT sale_order_option_uom_id_fkey FOREIGN KEY (uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: sale_order_option sale_order_option_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order sale_order_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_partner_invoice_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_partner_invoice_id_fkey FOREIGN KEY (partner_invoice_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_partner_shipping_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_partner_shipping_id_fkey FOREIGN KEY (partner_shipping_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: sale_order sale_order_payment_term_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_payment_term_id_fkey FOREIGN KEY (payment_term_id) REFERENCES public.account_payment_term(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_pending_email_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_pending_email_template_id_fkey FOREIGN KEY (pending_email_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_pricelist_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_pricelist_id_fkey FOREIGN KEY (pricelist_id) REFERENCES public.product_pricelist(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_procurement_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_procurement_group_id_fkey FOREIGN KEY (procurement_group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_source_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_source_id_fkey FOREIGN KEY (source_id) REFERENCES public.utm_source(id) ON DELETE SET NULL;


--
-- Name: sale_order_tag_rel sale_order_tag_rel_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_tag_rel
    ADD CONSTRAINT sale_order_tag_rel_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_tag_rel sale_order_tag_rel_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_tag_rel
    ADD CONSTRAINT sale_order_tag_rel_tag_id_fkey FOREIGN KEY (tag_id) REFERENCES public.crm_tag(id) ON DELETE CASCADE;


--
-- Name: sale_order sale_order_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_team_id_fkey FOREIGN KEY (team_id) REFERENCES public.crm_team(id) ON DELETE SET NULL;


--
-- Name: sale_order_template sale_order_template_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template
    ADD CONSTRAINT sale_order_template_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_order_template sale_order_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_template_line sale_order_template_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_line sale_order_template_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_template_line sale_order_template_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_line sale_order_template_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_line sale_order_template_line_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_line
    ADD CONSTRAINT sale_order_template_line_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE CASCADE;


--
-- Name: sale_order_template_line sale_order_template_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_template sale_order_template_mail_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template
    ADD CONSTRAINT sale_order_template_mail_template_id_fkey FOREIGN KEY (mail_template_id) REFERENCES public.mail_template(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_option sale_order_template_option_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: sale_order_template_option sale_order_template_option_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_template_option sale_order_template_option_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: sale_order_template_option sale_order_template_option_sale_order_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_sale_order_template_id_fkey FOREIGN KEY (sale_order_template_id) REFERENCES public.sale_order_template(id) ON DELETE CASCADE;


--
-- Name: sale_order_template_option sale_order_template_option_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_template_option
    ADD CONSTRAINT sale_order_template_option_uom_id_fkey FOREIGN KEY (uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: sale_order_template_option sale_order_template_option_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_template sale_order_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_order_transaction_rel sale_order_transaction_rel_sale_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_transaction_rel
    ADD CONSTRAINT sale_order_transaction_rel_sale_order_id_fkey FOREIGN KEY (sale_order_id) REFERENCES public.sale_order(id) ON DELETE CASCADE;


--
-- Name: sale_order_transaction_rel sale_order_transaction_rel_transaction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order_transaction_rel
    ADD CONSTRAINT sale_order_transaction_rel_transaction_id_fkey FOREIGN KEY (transaction_id) REFERENCES public.payment_transaction(id) ON DELETE CASCADE;


--
-- Name: sale_order sale_order_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sale_order
    ADD CONSTRAINT sale_order_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: sale_order sale_order_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_payment_provider_onboarding_wizard sale_payment_provider_onboarding_wizard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_payment_provider_onboarding_wizard sale_payment_provider_onboarding_wizard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_pdf_form_field sale_pdf_form_field_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sale_pdf_form_field sale_pdf_form_field_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: scheduled_message_attachment_rel scheduled_message_attachment_rel_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.scheduled_message_attachment_rel
    ADD CONSTRAINT scheduled_message_attachment_rel_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: scheduled_message_attachment_rel scheduled_message_attachment_rel_scheduled_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.scheduled_message_attachment_rel
    ADD CONSTRAINT scheduled_message_attachment_rel_scheduled_message_id_fkey FOREIGN KEY (scheduled_message_id) REFERENCES public.mail_scheduled_message(id) ON DELETE CASCADE;


--
-- Name: sms_account_code sms_account_code_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_account_code
    ADD CONSTRAINT sms_account_code_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.iap_account(id) ON DELETE CASCADE;


--
-- Name: sms_account_code sms_account_code_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_account_code sms_account_code_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_account_phone sms_account_phone_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_account_phone
    ADD CONSTRAINT sms_account_phone_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.iap_account(id) ON DELETE CASCADE;


--
-- Name: sms_account_phone sms_account_phone_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_account_phone sms_account_phone_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_account_sender sms_account_sender_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_account_sender
    ADD CONSTRAINT sms_account_sender_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.iap_account(id) ON DELETE CASCADE;


--
-- Name: sms_account_sender sms_account_sender_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_account_sender sms_account_sender_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_composer sms_composer_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_composer sms_composer_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_composer
    ADD CONSTRAINT sms_composer_template_id_fkey FOREIGN KEY (template_id) REFERENCES public.sms_template(id) ON DELETE SET NULL;


--
-- Name: sms_composer sms_composer_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_resend sms_resend_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_resend sms_resend_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_resend
    ADD CONSTRAINT sms_resend_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE CASCADE;


--
-- Name: sms_resend_recipient sms_resend_recipient_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_resend_recipient sms_resend_recipient_notification_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_resend_recipient
    ADD CONSTRAINT sms_resend_recipient_notification_id_fkey FOREIGN KEY (notification_id) REFERENCES public.mail_notification(id) ON DELETE CASCADE;


--
-- Name: sms_resend_recipient sms_resend_recipient_sms_resend_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_resend_recipient
    ADD CONSTRAINT sms_resend_recipient_sms_resend_id_fkey FOREIGN KEY (sms_resend_id) REFERENCES public.sms_resend(id) ON DELETE RESTRICT;


--
-- Name: sms_resend_recipient sms_resend_recipient_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_resend sms_resend_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_sms sms_sms_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_sms sms_sms_mail_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_sms
    ADD CONSTRAINT sms_sms_mail_message_id_fkey FOREIGN KEY (mail_message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: sms_sms sms_sms_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_sms
    ADD CONSTRAINT sms_sms_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: sms_sms sms_sms_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_template sms_template_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_template sms_template_model_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template
    ADD CONSTRAINT sms_template_model_id_fkey FOREIGN KEY (model_id) REFERENCES public.ir_model(id) ON DELETE CASCADE;


--
-- Name: sms_template_preview sms_template_preview_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_template_preview sms_template_preview_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template_preview
    ADD CONSTRAINT sms_template_preview_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE CASCADE;


--
-- Name: sms_template_preview sms_template_preview_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_template_reset sms_template_reset_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_template_reset sms_template_reset_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_template sms_template_sidebar_action_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template
    ADD CONSTRAINT sms_template_sidebar_action_id_fkey FOREIGN KEY (sidebar_action_id) REFERENCES public.ir_act_window(id) ON DELETE SET NULL;


--
-- Name: sms_template_sms_template_reset_rel sms_template_sms_template_reset_rel_sms_template_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template_sms_template_reset_rel
    ADD CONSTRAINT sms_template_sms_template_reset_rel_sms_template_id_fkey FOREIGN KEY (sms_template_id) REFERENCES public.sms_template(id) ON DELETE CASCADE;


--
-- Name: sms_template_sms_template_reset_rel sms_template_sms_template_reset_rel_sms_template_reset_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_template_sms_template_reset_rel
    ADD CONSTRAINT sms_template_sms_template_reset_rel_sms_template_reset_id_fkey FOREIGN KEY (sms_template_reset_id) REFERENCES public.sms_template_reset(id) ON DELETE CASCADE;


--
-- Name: sms_template sms_template_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_tracker sms_tracker_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: sms_tracker sms_tracker_mail_notification_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.sms_tracker
    ADD CONSTRAINT sms_tracker_mail_notification_id_fkey FOREIGN KEY (mail_notification_id) REFERENCES public.mail_notification(id) ON DELETE CASCADE;


--
-- Name: sms_tracker sms_tracker_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: snailmail_letter snailmail_letter_attachment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_attachment_id_fkey FOREIGN KEY (attachment_id) REFERENCES public.ir_attachment(id) ON DELETE CASCADE;


--
-- Name: snailmail_letter snailmail_letter_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: snailmail_letter snailmail_letter_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: snailmail_letter snailmail_letter_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: snailmail_letter_format_error snailmail_letter_format_error_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: snailmail_letter_format_error snailmail_letter_format_error_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter_format_error
    ADD CONSTRAINT snailmail_letter_format_error_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_format_error snailmail_letter_format_error_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: snailmail_letter snailmail_letter_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.mail_message(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_missing_required_fields snailmail_letter_missing_required_fields_country_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: snailmail_letter_missing_required_fields snailmail_letter_missing_required_fields_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: snailmail_letter_missing_required_fields snailmail_letter_missing_required_fields_letter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter_missing_required_fields
    ADD CONSTRAINT snailmail_letter_missing_required_fields_letter_id_fkey FOREIGN KEY (letter_id) REFERENCES public.snailmail_letter(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_missing_required_fields snailmail_letter_missing_required_fields_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter_missing_required_fields
    ADD CONSTRAINT snailmail_letter_missing_required_fields_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_missing_required_fields snailmail_letter_missing_required_fields_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter_missing_required_fields
    ADD CONSTRAINT snailmail_letter_missing_required_fields_state_id_fkey FOREIGN KEY (state_id) REFERENCES public.res_country_state(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter_missing_required_fields snailmail_letter_missing_required_fields_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: snailmail_letter snailmail_letter_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE RESTRICT;


--
-- Name: snailmail_letter snailmail_letter_report_template_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_report_template_fkey FOREIGN KEY (report_template) REFERENCES public.ir_act_report_xml(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_state_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_state_id_fkey FOREIGN KEY (state_id) REFERENCES public.res_country_state(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.snailmail_letter
    ADD CONSTRAINT snailmail_letter_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: snailmail_letter snailmail_letter_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: spreadsheet_dashboard spreadsheet_dashboard_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.spreadsheet_dashboard
    ADD CONSTRAINT spreadsheet_dashboard_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: spreadsheet_dashboard spreadsheet_dashboard_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: spreadsheet_dashboard spreadsheet_dashboard_dashboard_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.spreadsheet_dashboard
    ADD CONSTRAINT spreadsheet_dashboard_dashboard_group_id_fkey FOREIGN KEY (dashboard_group_id) REFERENCES public.spreadsheet_dashboard_group(id) ON DELETE RESTRICT;


--
-- Name: spreadsheet_dashboard_group spreadsheet_dashboard_group_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: spreadsheet_dashboard_group spreadsheet_dashboard_group_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: spreadsheet_dashboard_share spreadsheet_dashboard_share_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: spreadsheet_dashboard_share spreadsheet_dashboard_share_dashboard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.spreadsheet_dashboard_share
    ADD CONSTRAINT spreadsheet_dashboard_share_dashboard_id_fkey FOREIGN KEY (dashboard_id) REFERENCES public.spreadsheet_dashboard(id) ON DELETE CASCADE;


--
-- Name: spreadsheet_dashboard_share spreadsheet_dashboard_share_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: spreadsheet_dashboard spreadsheet_dashboard_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_backorder_confirmation stock_backorder_confirmation_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_backorder_confirmation_line stock_backorder_confirmation_lin_backorder_confirmation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_backorder_confirmation_line
    ADD CONSTRAINT stock_backorder_confirmation_lin_backorder_confirmation_id_fkey FOREIGN KEY (backorder_confirmation_id) REFERENCES public.stock_backorder_confirmation(id) ON DELETE SET NULL;


--
-- Name: stock_backorder_confirmation_line stock_backorder_confirmation_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_backorder_confirmation_line stock_backorder_confirmation_line_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_backorder_confirmation_line
    ADD CONSTRAINT stock_backorder_confirmation_line_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_backorder_confirmation_line stock_backorder_confirmation_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_backorder_confirmation stock_backorder_confirmation_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_change_product_qty stock_change_product_qty_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_change_product_qty stock_change_product_qty_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_change_product_qty
    ADD CONSTRAINT stock_change_product_qty_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_change_product_qty stock_change_product_qty_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_change_product_qty
    ADD CONSTRAINT stock_change_product_qty_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: stock_change_product_qty stock_change_product_qty_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_conflict_quant_rel stock_conflict_quant_rel_stock_inventory_conflict_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_conflict_quant_rel
    ADD CONSTRAINT stock_conflict_quant_rel_stock_inventory_conflict_id_fkey FOREIGN KEY (stock_inventory_conflict_id) REFERENCES public.stock_inventory_conflict(id) ON DELETE CASCADE;


--
-- Name: stock_conflict_quant_rel stock_conflict_quant_rel_stock_quant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_conflict_quant_rel
    ADD CONSTRAINT stock_conflict_quant_rel_stock_quant_id_fkey FOREIGN KEY (stock_quant_id) REFERENCES public.stock_quant(id) ON DELETE CASCADE;


--
-- Name: stock_inventory_adjustment_name_stock_quant_rel stock_inventory_adjustment_na_stock_inventory_adjustment_n_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_adjustment_name_stock_quant_rel
    ADD CONSTRAINT stock_inventory_adjustment_na_stock_inventory_adjustment_n_fkey FOREIGN KEY (stock_inventory_adjustment_name_id) REFERENCES public.stock_inventory_adjustment_name(id) ON DELETE CASCADE;


--
-- Name: stock_inventory_adjustment_name stock_inventory_adjustment_name_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_inventory_adjustment_name_stock_quant_rel stock_inventory_adjustment_name_stock_quant_stock_quant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_adjustment_name_stock_quant_rel
    ADD CONSTRAINT stock_inventory_adjustment_name_stock_quant_stock_quant_id_fkey FOREIGN KEY (stock_quant_id) REFERENCES public.stock_quant(id) ON DELETE CASCADE;


--
-- Name: stock_inventory_adjustment_name stock_inventory_adjustment_name_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_inventory_conflict stock_inventory_conflict_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_inventory_conflict_stock_quant_rel stock_inventory_conflict_stock_quant_rel_stock_quant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_conflict_stock_quant_rel
    ADD CONSTRAINT stock_inventory_conflict_stock_quant_rel_stock_quant_id_fkey FOREIGN KEY (stock_quant_id) REFERENCES public.stock_quant(id) ON DELETE CASCADE;


--
-- Name: stock_inventory_conflict_stock_quant_rel stock_inventory_conflict_stock_stock_inventory_conflict_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_conflict_stock_quant_rel
    ADD CONSTRAINT stock_inventory_conflict_stock_stock_inventory_conflict_id_fkey FOREIGN KEY (stock_inventory_conflict_id) REFERENCES public.stock_inventory_conflict(id) ON DELETE CASCADE;


--
-- Name: stock_inventory_conflict stock_inventory_conflict_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_inventory_warning stock_inventory_warning_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_inventory_warning_stock_quant_rel stock_inventory_warning_stock_q_stock_inventory_warning_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_warning_stock_quant_rel
    ADD CONSTRAINT stock_inventory_warning_stock_q_stock_inventory_warning_id_fkey FOREIGN KEY (stock_inventory_warning_id) REFERENCES public.stock_inventory_warning(id) ON DELETE CASCADE;


--
-- Name: stock_inventory_warning_stock_quant_rel stock_inventory_warning_stock_quant_rel_stock_quant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_inventory_warning_stock_quant_rel
    ADD CONSTRAINT stock_inventory_warning_stock_quant_rel_stock_quant_id_fkey FOREIGN KEY (stock_quant_id) REFERENCES public.stock_quant(id) ON DELETE CASCADE;


--
-- Name: stock_inventory_warning stock_inventory_warning_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_location stock_location_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_location stock_location_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_removal_strategy_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_removal_strategy_id_fkey FOREIGN KEY (removal_strategy_id) REFERENCES public.product_removal(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_storage_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_storage_category_id_fkey FOREIGN KEY (storage_category_id) REFERENCES public.stock_storage_category(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_valuation_in_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_valuation_in_account_id_fkey FOREIGN KEY (valuation_in_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_valuation_out_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_valuation_out_account_id_fkey FOREIGN KEY (valuation_out_account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_location
    ADD CONSTRAINT stock_location_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: stock_location stock_location_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_lot stock_lot_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_lot
    ADD CONSTRAINT stock_lot_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_lot stock_lot_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_lot stock_lot_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_lot
    ADD CONSTRAINT stock_lot_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_lot stock_lot_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_lot
    ADD CONSTRAINT stock_lot_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: stock_lot stock_lot_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_lot
    ADD CONSTRAINT stock_lot_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE SET NULL;


--
-- Name: stock_lot stock_lot_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_move stock_move_bom_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_bom_line_id_fkey FOREIGN KEY (bom_line_id) REFERENCES public.mrp_bom_line(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_byproduct_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_byproduct_id_fkey FOREIGN KEY (byproduct_id) REFERENCES public.mrp_bom_byproduct(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_move stock_move_consume_unbuild_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_consume_unbuild_id_fkey FOREIGN KEY (consume_unbuild_id) REFERENCES public.mrp_unbuild(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_move stock_move_created_production_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_created_production_id_fkey FOREIGN KEY (created_production_id) REFERENCES public.mrp_production(id) ON DELETE SET NULL;


--
-- Name: stock_move_created_purchase_line_rel stock_move_created_purchase_line__created_purchase_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_created_purchase_line_rel
    ADD CONSTRAINT stock_move_created_purchase_line__created_purchase_line_id_fkey FOREIGN KEY (created_purchase_line_id) REFERENCES public.purchase_order_line(id) ON DELETE CASCADE;


--
-- Name: stock_move_created_purchase_line_rel stock_move_created_purchase_line_rel_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_created_purchase_line_rel
    ADD CONSTRAINT stock_move_created_purchase_line_rel_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.stock_move(id) ON DELETE CASCADE;


--
-- Name: stock_move stock_move_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_move_line_consume_rel stock_move_line_consume_rel_consume_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line_consume_rel
    ADD CONSTRAINT stock_move_line_consume_rel_consume_line_id_fkey FOREIGN KEY (consume_line_id) REFERENCES public.stock_move_line(id) ON DELETE CASCADE;


--
-- Name: stock_move_line_consume_rel stock_move_line_consume_rel_produce_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line_consume_rel
    ADD CONSTRAINT stock_move_line_consume_rel_produce_line_id_fkey FOREIGN KEY (produce_line_id) REFERENCES public.stock_move_line(id) ON DELETE CASCADE;


--
-- Name: stock_move_line stock_move_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_move_line stock_move_line_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_location_dest_id_fkey FOREIGN KEY (location_dest_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_move_line stock_move_line_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_move_line stock_move_line_lot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_lot_id_fkey FOREIGN KEY (lot_id) REFERENCES public.stock_lot(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_owner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_package_id_fkey FOREIGN KEY (package_id) REFERENCES public.stock_quant_package(id) ON DELETE RESTRICT;


--
-- Name: stock_move_line stock_move_line_package_level_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_package_level_id_fkey FOREIGN KEY (package_level_id) REFERENCES public.stock_package_level(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_move_line stock_move_line_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: stock_move_line stock_move_line_production_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_production_id_fkey FOREIGN KEY (production_id) REFERENCES public.mrp_production(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_result_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_result_package_id_fkey FOREIGN KEY (result_package_id) REFERENCES public.stock_quant_package(id) ON DELETE RESTRICT;


--
-- Name: stock_move_line stock_move_line_workorder_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_line
    ADD CONSTRAINT stock_move_line_workorder_id_fkey FOREIGN KEY (workorder_id) REFERENCES public.mrp_workorder(id) ON DELETE SET NULL;


--
-- Name: stock_move_line stock_move_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_move stock_move_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_location_dest_id_fkey FOREIGN KEY (location_dest_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_move stock_move_location_final_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_location_final_id_fkey FOREIGN KEY (location_final_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_move_move_rel stock_move_move_rel_move_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_move_rel
    ADD CONSTRAINT stock_move_move_rel_move_dest_id_fkey FOREIGN KEY (move_dest_id) REFERENCES public.stock_move(id) ON DELETE CASCADE;


--
-- Name: stock_move_move_rel stock_move_move_rel_move_orig_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move_move_rel
    ADD CONSTRAINT stock_move_move_rel_move_orig_id_fkey FOREIGN KEY (move_orig_id) REFERENCES public.stock_move(id) ON DELETE CASCADE;


--
-- Name: stock_move stock_move_operation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_operation_id_fkey FOREIGN KEY (operation_id) REFERENCES public.mrp_routing_workcenter(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_order_finished_lot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_order_finished_lot_id_fkey FOREIGN KEY (order_finished_lot_id) REFERENCES public.stock_lot(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_orderpoint_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_orderpoint_id_fkey FOREIGN KEY (orderpoint_id) REFERENCES public.stock_warehouse_orderpoint(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_origin_returned_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_origin_returned_move_id_fkey FOREIGN KEY (origin_returned_move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_package_level_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_package_level_id_fkey FOREIGN KEY (package_level_id) REFERENCES public.stock_package_level(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_picking_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_picking_type_id_fkey FOREIGN KEY (picking_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: stock_move stock_move_product_packaging_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_product_packaging_id_fkey FOREIGN KEY (product_packaging_id) REFERENCES public.product_packaging(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_product_uom_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_product_uom_fkey FOREIGN KEY (product_uom) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: stock_move stock_move_production_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_production_id_fkey FOREIGN KEY (production_id) REFERENCES public.mrp_production(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_purchase_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_purchase_line_id_fkey FOREIGN KEY (purchase_line_id) REFERENCES public.purchase_order_line(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_raw_material_production_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_raw_material_production_id_fkey FOREIGN KEY (raw_material_production_id) REFERENCES public.mrp_production(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_repair_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_repair_id_fkey FOREIGN KEY (repair_id) REFERENCES public.repair_order(id) ON DELETE CASCADE;


--
-- Name: stock_move stock_move_restrict_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_restrict_partner_id_fkey FOREIGN KEY (restrict_partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_rule_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_rule_id_fkey FOREIGN KEY (rule_id) REFERENCES public.stock_rule(id) ON DELETE RESTRICT;


--
-- Name: stock_move stock_move_sale_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_sale_line_id_fkey FOREIGN KEY (sale_line_id) REFERENCES public.sale_order_line(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_scrap_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_scrap_id_fkey FOREIGN KEY (scrap_id) REFERENCES public.stock_scrap(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_unbuild_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_unbuild_id_fkey FOREIGN KEY (unbuild_id) REFERENCES public.mrp_unbuild(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_workorder_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_move
    ADD CONSTRAINT stock_move_workorder_id_fkey FOREIGN KEY (workorder_id) REFERENCES public.mrp_workorder(id) ON DELETE SET NULL;


--
-- Name: stock_move stock_move_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_orderpoint_snooze stock_orderpoint_snooze_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_orderpoint_snooze_stock_warehouse_orderpoint_rel stock_orderpoint_snooze_stock_stock_warehouse_orderpoint_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_orderpoint_snooze_stock_warehouse_orderpoint_rel
    ADD CONSTRAINT stock_orderpoint_snooze_stock_stock_warehouse_orderpoint_i_fkey FOREIGN KEY (stock_warehouse_orderpoint_id) REFERENCES public.stock_warehouse_orderpoint(id) ON DELETE CASCADE;


--
-- Name: stock_orderpoint_snooze_stock_warehouse_orderpoint_rel stock_orderpoint_snooze_stock_w_stock_orderpoint_snooze_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_orderpoint_snooze_stock_warehouse_orderpoint_rel
    ADD CONSTRAINT stock_orderpoint_snooze_stock_w_stock_orderpoint_snooze_id_fkey FOREIGN KEY (stock_orderpoint_snooze_id) REFERENCES public.stock_orderpoint_snooze(id) ON DELETE CASCADE;


--
-- Name: stock_orderpoint_snooze stock_orderpoint_snooze_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_package_destination stock_package_destination_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_package_destination stock_package_destination_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_destination
    ADD CONSTRAINT stock_package_destination_location_dest_id_fkey FOREIGN KEY (location_dest_id) REFERENCES public.stock_location(id) ON DELETE CASCADE;


--
-- Name: stock_package_destination stock_package_destination_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_destination
    ADD CONSTRAINT stock_package_destination_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE CASCADE;


--
-- Name: stock_package_destination stock_package_destination_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_package_level stock_package_level_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_level
    ADD CONSTRAINT stock_package_level_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_package_level stock_package_level_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_package_level stock_package_level_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_level
    ADD CONSTRAINT stock_package_level_location_dest_id_fkey FOREIGN KEY (location_dest_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_package_level stock_package_level_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_level
    ADD CONSTRAINT stock_package_level_package_id_fkey FOREIGN KEY (package_id) REFERENCES public.stock_quant_package(id) ON DELETE RESTRICT;


--
-- Name: stock_package_level stock_package_level_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_level
    ADD CONSTRAINT stock_package_level_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_package_level stock_package_level_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_package_type stock_package_type_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_type
    ADD CONSTRAINT stock_package_type_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_package_type stock_package_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_package_type_stock_putaway_rule_rel stock_package_type_stock_putaway_rul_stock_package_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_type_stock_putaway_rule_rel
    ADD CONSTRAINT stock_package_type_stock_putaway_rul_stock_package_type_id_fkey FOREIGN KEY (stock_package_type_id) REFERENCES public.stock_package_type(id) ON DELETE CASCADE;


--
-- Name: stock_package_type_stock_putaway_rule_rel stock_package_type_stock_putaway_rul_stock_putaway_rule_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_package_type_stock_putaway_rule_rel
    ADD CONSTRAINT stock_package_type_stock_putaway_rul_stock_putaway_rule_id_fkey FOREIGN KEY (stock_putaway_rule_id) REFERENCES public.stock_putaway_rule(id) ON DELETE CASCADE;


--
-- Name: stock_package_type stock_package_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_picking stock_picking_backorder_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_backorder_id_fkey FOREIGN KEY (backorder_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_picking_backorder_rel stock_picking_backorder_rel_stock_backorder_confirmation_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_backorder_rel
    ADD CONSTRAINT stock_picking_backorder_rel_stock_backorder_confirmation_i_fkey FOREIGN KEY (stock_backorder_confirmation_id) REFERENCES public.stock_backorder_confirmation(id) ON DELETE CASCADE;


--
-- Name: stock_picking_backorder_rel stock_picking_backorder_rel_stock_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_backorder_rel
    ADD CONSTRAINT stock_picking_backorder_rel_stock_picking_id_fkey FOREIGN KEY (stock_picking_id) REFERENCES public.stock_picking(id) ON DELETE CASCADE;


--
-- Name: stock_picking stock_picking_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_picking stock_picking_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_location_dest_id_fkey FOREIGN KEY (location_dest_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_picking stock_picking_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_picking stock_picking_owner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_picking_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_picking_type_id_fkey FOREIGN KEY (picking_type_id) REFERENCES public.stock_picking_type(id) ON DELETE RESTRICT;


--
-- Name: stock_picking stock_picking_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project_project(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_return_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_return_id_fkey FOREIGN KEY (return_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_sale_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_sale_id_fkey FOREIGN KEY (sale_id) REFERENCES public.sale_order(id) ON DELETE SET NULL;


--
-- Name: stock_picking_sms_rel stock_picking_sms_rel_confirm_stock_sms_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_sms_rel
    ADD CONSTRAINT stock_picking_sms_rel_confirm_stock_sms_id_fkey FOREIGN KEY (confirm_stock_sms_id) REFERENCES public.confirm_stock_sms(id) ON DELETE CASCADE;


--
-- Name: stock_picking_sms_rel stock_picking_sms_rel_stock_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_sms_rel
    ADD CONSTRAINT stock_picking_sms_rel_stock_picking_id_fkey FOREIGN KEY (stock_picking_id) REFERENCES public.stock_picking(id) ON DELETE CASCADE;


--
-- Name: stock_picking_type stock_picking_type_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_picking_type stock_picking_type_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_picking_type stock_picking_type_default_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_default_location_dest_id_fkey FOREIGN KEY (default_location_dest_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_picking_type stock_picking_type_default_location_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_default_location_src_id_fkey FOREIGN KEY (default_location_src_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_picking_type stock_picking_type_default_product_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_default_product_location_dest_id_fkey FOREIGN KEY (default_product_location_dest_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_picking_type stock_picking_type_default_product_location_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_default_product_location_src_id_fkey FOREIGN KEY (default_product_location_src_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_picking_type stock_picking_type_default_recycle_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_default_recycle_location_dest_id_fkey FOREIGN KEY (default_recycle_location_dest_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_picking_type stock_picking_type_default_remove_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_default_remove_location_dest_id_fkey FOREIGN KEY (default_remove_location_dest_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_picking_type stock_picking_type_return_picking_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_return_picking_type_id_fkey FOREIGN KEY (return_picking_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_picking_type stock_picking_type_sequence_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_sequence_id_fkey FOREIGN KEY (sequence_id) REFERENCES public.ir_sequence(id) ON DELETE SET NULL;


--
-- Name: stock_picking_type stock_picking_type_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking_type
    ADD CONSTRAINT stock_picking_type_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: stock_picking_type stock_picking_type_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_picking stock_picking_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_picking
    ADD CONSTRAINT stock_picking_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_picking stock_picking_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_putaway_rule stock_putaway_rule_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.product_category(id) ON DELETE CASCADE;


--
-- Name: stock_putaway_rule stock_putaway_rule_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_putaway_rule stock_putaway_rule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_putaway_rule stock_putaway_rule_location_in_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_location_in_id_fkey FOREIGN KEY (location_in_id) REFERENCES public.stock_location(id) ON DELETE CASCADE;


--
-- Name: stock_putaway_rule stock_putaway_rule_location_out_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_location_out_id_fkey FOREIGN KEY (location_out_id) REFERENCES public.stock_location(id) ON DELETE CASCADE;


--
-- Name: stock_putaway_rule stock_putaway_rule_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_putaway_rule stock_putaway_rule_storage_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_putaway_rule
    ADD CONSTRAINT stock_putaway_rule_storage_category_id_fkey FOREIGN KEY (storage_category_id) REFERENCES public.stock_storage_category(id) ON DELETE CASCADE;


--
-- Name: stock_putaway_rule stock_putaway_rule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_quant stock_quant_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_quant stock_quant_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_quant stock_quant_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_quant stock_quant_lot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_lot_id_fkey FOREIGN KEY (lot_id) REFERENCES public.stock_lot(id) ON DELETE RESTRICT;


--
-- Name: stock_quant stock_quant_owner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_quant_package stock_quant_package_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_package
    ADD CONSTRAINT stock_quant_package_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_quant_package stock_quant_package_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_quant stock_quant_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_package_id_fkey FOREIGN KEY (package_id) REFERENCES public.stock_quant_package(id) ON DELETE RESTRICT;


--
-- Name: stock_quant_package stock_quant_package_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_package
    ADD CONSTRAINT stock_quant_package_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_quant_package stock_quant_package_package_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_package
    ADD CONSTRAINT stock_quant_package_package_type_id_fkey FOREIGN KEY (package_type_id) REFERENCES public.stock_package_type(id) ON DELETE SET NULL;


--
-- Name: stock_quant_package stock_quant_package_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_quant stock_quant_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: stock_quant_relocate stock_quant_relocate_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_quant_relocate stock_quant_relocate_dest_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_relocate
    ADD CONSTRAINT stock_quant_relocate_dest_location_id_fkey FOREIGN KEY (dest_location_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_quant_relocate stock_quant_relocate_dest_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_relocate
    ADD CONSTRAINT stock_quant_relocate_dest_package_id_fkey FOREIGN KEY (dest_package_id) REFERENCES public.stock_quant_package(id) ON DELETE SET NULL;


--
-- Name: stock_quant_relocate stock_quant_relocate_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_quant_stock_quant_relocate_rel stock_quant_stock_quant_relocate_r_stock_quant_relocate_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_stock_quant_relocate_rel
    ADD CONSTRAINT stock_quant_stock_quant_relocate_r_stock_quant_relocate_id_fkey FOREIGN KEY (stock_quant_relocate_id) REFERENCES public.stock_quant_relocate(id) ON DELETE CASCADE;


--
-- Name: stock_quant_stock_quant_relocate_rel stock_quant_stock_quant_relocate_rel_stock_quant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_stock_quant_relocate_rel
    ADD CONSTRAINT stock_quant_stock_quant_relocate_rel_stock_quant_id_fkey FOREIGN KEY (stock_quant_id) REFERENCES public.stock_quant(id) ON DELETE CASCADE;


--
-- Name: stock_quant_stock_request_count_rel stock_quant_stock_request_count_rel_stock_quant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_stock_request_count_rel
    ADD CONSTRAINT stock_quant_stock_request_count_rel_stock_quant_id_fkey FOREIGN KEY (stock_quant_id) REFERENCES public.stock_quant(id) ON DELETE CASCADE;


--
-- Name: stock_quant_stock_request_count_rel stock_quant_stock_request_count_rel_stock_request_count_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_stock_request_count_rel
    ADD CONSTRAINT stock_quant_stock_request_count_rel_stock_request_count_id_fkey FOREIGN KEY (stock_request_count_id) REFERENCES public.stock_request_count(id) ON DELETE CASCADE;


--
-- Name: stock_quant_stock_track_confirmation_rel stock_quant_stock_track_confir_stock_track_confirmation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_stock_track_confirmation_rel
    ADD CONSTRAINT stock_quant_stock_track_confir_stock_track_confirmation_id_fkey FOREIGN KEY (stock_track_confirmation_id) REFERENCES public.stock_track_confirmation(id) ON DELETE CASCADE;


--
-- Name: stock_quant_stock_track_confirmation_rel stock_quant_stock_track_confirmation_rel_stock_quant_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant_stock_track_confirmation_rel
    ADD CONSTRAINT stock_quant_stock_track_confirmation_rel_stock_quant_id_fkey FOREIGN KEY (stock_quant_id) REFERENCES public.stock_quant(id) ON DELETE CASCADE;


--
-- Name: stock_quant stock_quant_storage_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_storage_category_id_fkey FOREIGN KEY (storage_category_id) REFERENCES public.stock_storage_category(id) ON DELETE SET NULL;


--
-- Name: stock_quant stock_quant_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_quant
    ADD CONSTRAINT stock_quant_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_quant stock_quant_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_quantity_history stock_quantity_history_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_quantity_history stock_quantity_history_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_replenishment_info stock_replenishment_info_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_replenishment_info stock_replenishment_info_orderpoint_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_replenishment_info
    ADD CONSTRAINT stock_replenishment_info_orderpoint_id_fkey FOREIGN KEY (orderpoint_id) REFERENCES public.stock_warehouse_orderpoint(id) ON DELETE SET NULL;


--
-- Name: stock_replenishment_info stock_replenishment_info_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_replenishment_option stock_replenishment_option_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_replenishment_option stock_replenishment_option_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_replenishment_option
    ADD CONSTRAINT stock_replenishment_option_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: stock_replenishment_option stock_replenishment_option_replenishment_info_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_replenishment_option
    ADD CONSTRAINT stock_replenishment_option_replenishment_info_id_fkey FOREIGN KEY (replenishment_info_id) REFERENCES public.stock_replenishment_info(id) ON DELETE SET NULL;


--
-- Name: stock_replenishment_option stock_replenishment_option_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_replenishment_option
    ADD CONSTRAINT stock_replenishment_option_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE SET NULL;


--
-- Name: stock_replenishment_option stock_replenishment_option_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_request_count stock_request_count_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_request_count stock_request_count_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_request_count
    ADD CONSTRAINT stock_request_count_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE SET NULL;


--
-- Name: stock_request_count stock_request_count_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_return_picking stock_return_picking_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_return_picking_line stock_return_picking_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_return_picking_line stock_return_picking_line_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking_line
    ADD CONSTRAINT stock_return_picking_line_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: stock_return_picking_line stock_return_picking_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking_line
    ADD CONSTRAINT stock_return_picking_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_return_picking_line stock_return_picking_line_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking_line
    ADD CONSTRAINT stock_return_picking_line_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.stock_return_picking(id) ON DELETE SET NULL;


--
-- Name: stock_return_picking_line stock_return_picking_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_return_picking stock_return_picking_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_return_picking
    ADD CONSTRAINT stock_return_picking_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_return_picking stock_return_picking_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_route_categ stock_route_categ_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_categ
    ADD CONSTRAINT stock_route_categ_categ_id_fkey FOREIGN KEY (categ_id) REFERENCES public.product_category(id) ON DELETE CASCADE;


--
-- Name: stock_route_categ stock_route_categ_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_categ
    ADD CONSTRAINT stock_route_categ_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_route stock_route_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route
    ADD CONSTRAINT stock_route_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_route stock_route_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_route_move stock_route_move_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_move
    ADD CONSTRAINT stock_route_move_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.stock_move(id) ON DELETE CASCADE;


--
-- Name: stock_route_move stock_route_move_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_move
    ADD CONSTRAINT stock_route_move_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_route_packaging stock_route_packaging_packaging_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_packaging
    ADD CONSTRAINT stock_route_packaging_packaging_id_fkey FOREIGN KEY (packaging_id) REFERENCES public.product_packaging(id) ON DELETE CASCADE;


--
-- Name: stock_route_packaging stock_route_packaging_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_packaging
    ADD CONSTRAINT stock_route_packaging_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_route_product stock_route_product_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_product
    ADD CONSTRAINT stock_route_product_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: stock_route_product stock_route_product_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_product
    ADD CONSTRAINT stock_route_product_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_route_stock_rules_report_rel stock_route_stock_rules_report_rel_stock_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_stock_rules_report_rel
    ADD CONSTRAINT stock_route_stock_rules_report_rel_stock_route_id_fkey FOREIGN KEY (stock_route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_route_stock_rules_report_rel stock_route_stock_rules_report_rel_stock_rules_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_stock_rules_report_rel
    ADD CONSTRAINT stock_route_stock_rules_report_rel_stock_rules_report_id_fkey FOREIGN KEY (stock_rules_report_id) REFERENCES public.stock_rules_report(id) ON DELETE CASCADE;


--
-- Name: stock_route stock_route_supplied_wh_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route
    ADD CONSTRAINT stock_route_supplied_wh_id_fkey FOREIGN KEY (supplied_wh_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: stock_route stock_route_supplier_wh_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route
    ADD CONSTRAINT stock_route_supplier_wh_id_fkey FOREIGN KEY (supplier_wh_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: stock_route_warehouse stock_route_warehouse_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_warehouse
    ADD CONSTRAINT stock_route_warehouse_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_route_warehouse stock_route_warehouse_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_route_warehouse
    ADD CONSTRAINT stock_route_warehouse_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: stock_route stock_route_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_rule stock_rule_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_rule stock_rule_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_location_dest_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_location_dest_id_fkey FOREIGN KEY (location_dest_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_rule stock_rule_location_src_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_location_src_id_fkey FOREIGN KEY (location_src_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_partner_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_partner_address_id_fkey FOREIGN KEY (partner_address_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_picking_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_picking_type_id_fkey FOREIGN KEY (picking_type_id) REFERENCES public.stock_picking_type(id) ON DELETE RESTRICT;


--
-- Name: stock_rule stock_rule_propagate_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_propagate_warehouse_id_fkey FOREIGN KEY (propagate_warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE CASCADE;


--
-- Name: stock_rule stock_rule_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rule
    ADD CONSTRAINT stock_rule_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE SET NULL;


--
-- Name: stock_rule stock_rule_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_rules_report stock_rules_report_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_rules_report stock_rules_report_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rules_report
    ADD CONSTRAINT stock_rules_report_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_rules_report stock_rules_report_product_tmpl_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rules_report
    ADD CONSTRAINT stock_rules_report_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES public.product_template(id) ON DELETE CASCADE;


--
-- Name: stock_rules_report_stock_warehouse_rel stock_rules_report_stock_warehouse_r_stock_rules_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rules_report_stock_warehouse_rel
    ADD CONSTRAINT stock_rules_report_stock_warehouse_r_stock_rules_report_id_fkey FOREIGN KEY (stock_rules_report_id) REFERENCES public.stock_rules_report(id) ON DELETE CASCADE;


--
-- Name: stock_rules_report_stock_warehouse_rel stock_rules_report_stock_warehouse_rel_stock_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_rules_report_stock_warehouse_rel
    ADD CONSTRAINT stock_rules_report_stock_warehouse_rel_stock_warehouse_id_fkey FOREIGN KEY (stock_warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: stock_rules_report stock_rules_report_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_scrap stock_scrap_bom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_bom_id_fkey FOREIGN KEY (bom_id) REFERENCES public.mrp_bom(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_scrap stock_scrap_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_scrap stock_scrap_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_scrap stock_scrap_lot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_lot_id_fkey FOREIGN KEY (lot_id) REFERENCES public.stock_lot(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_owner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_package_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_package_id_fkey FOREIGN KEY (package_id) REFERENCES public.stock_quant_package(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_picking_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_picking_id_fkey FOREIGN KEY (picking_id) REFERENCES public.stock_picking(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: stock_scrap stock_scrap_product_uom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_product_uom_id_fkey FOREIGN KEY (product_uom_id) REFERENCES public.uom_uom(id) ON DELETE RESTRICT;


--
-- Name: stock_scrap stock_scrap_production_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_production_id_fkey FOREIGN KEY (production_id) REFERENCES public.mrp_production(id) ON DELETE SET NULL;


--
-- Name: stock_scrap_reason_tag stock_scrap_reason_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_scrap_reason_tag stock_scrap_reason_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_scrap stock_scrap_scrap_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_scrap_location_id_fkey FOREIGN KEY (scrap_location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_scrap_stock_scrap_reason_tag_rel stock_scrap_stock_scrap_reason_t_stock_scrap_reason_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap_stock_scrap_reason_tag_rel
    ADD CONSTRAINT stock_scrap_stock_scrap_reason_t_stock_scrap_reason_tag_id_fkey FOREIGN KEY (stock_scrap_reason_tag_id) REFERENCES public.stock_scrap_reason_tag(id) ON DELETE CASCADE;


--
-- Name: stock_scrap_stock_scrap_reason_tag_rel stock_scrap_stock_scrap_reason_tag_rel_stock_scrap_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap_stock_scrap_reason_tag_rel
    ADD CONSTRAINT stock_scrap_stock_scrap_reason_tag_rel_stock_scrap_id_fkey FOREIGN KEY (stock_scrap_id) REFERENCES public.stock_scrap(id) ON DELETE CASCADE;


--
-- Name: stock_scrap stock_scrap_workorder_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_scrap
    ADD CONSTRAINT stock_scrap_workorder_id_fkey FOREIGN KEY (workorder_id) REFERENCES public.mrp_workorder(id) ON DELETE SET NULL;


--
-- Name: stock_scrap stock_scrap_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_storage_category_capacity stock_storage_category_capacity_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_storage_category_capacity stock_storage_category_capacity_package_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_storage_category_capacity
    ADD CONSTRAINT stock_storage_category_capacity_package_type_id_fkey FOREIGN KEY (package_type_id) REFERENCES public.stock_package_type(id) ON DELETE CASCADE;


--
-- Name: stock_storage_category_capacity stock_storage_category_capacity_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_storage_category_capacity
    ADD CONSTRAINT stock_storage_category_capacity_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_storage_category_capacity stock_storage_category_capacity_storage_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_storage_category_capacity
    ADD CONSTRAINT stock_storage_category_capacity_storage_category_id_fkey FOREIGN KEY (storage_category_id) REFERENCES public.stock_storage_category(id) ON DELETE CASCADE;


--
-- Name: stock_storage_category_capacity stock_storage_category_capacity_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_storage_category stock_storage_category_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_storage_category
    ADD CONSTRAINT stock_storage_category_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: stock_storage_category stock_storage_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_storage_category stock_storage_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_traceability_report stock_traceability_report_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_traceability_report stock_traceability_report_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_track_confirmation stock_track_confirmation_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_track_confirmation stock_track_confirmation_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_track_line stock_track_line_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_track_line stock_track_line_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_track_line
    ADD CONSTRAINT stock_track_line_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE SET NULL;


--
-- Name: stock_track_line stock_track_line_wizard_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_track_line
    ADD CONSTRAINT stock_track_line_wizard_id_fkey FOREIGN KEY (wizard_id) REFERENCES public.stock_track_confirmation(id) ON DELETE SET NULL;


--
-- Name: stock_track_line stock_track_line_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_valuation_layer stock_valuation_layer_account_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_account_move_id_fkey FOREIGN KEY (account_move_id) REFERENCES public.account_move(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer stock_valuation_layer_account_move_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_account_move_line_id_fkey FOREIGN KEY (account_move_line_id) REFERENCES public.account_move_line(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer stock_valuation_layer_categ_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_categ_id_fkey FOREIGN KEY (categ_id) REFERENCES public.product_category(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer stock_valuation_layer_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_valuation_layer stock_valuation_layer_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_valuation_layer stock_valuation_layer_lot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_lot_id_fkey FOREIGN KEY (lot_id) REFERENCES public.stock_lot(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer stock_valuation_layer_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE RESTRICT;


--
-- Name: stock_valuation_layer_revaluation stock_valuation_layer_revaluation_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer_revaluation
    ADD CONSTRAINT stock_valuation_layer_revaluation_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.account_account(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer_revaluation stock_valuation_layer_revaluation_account_journal_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer_revaluation
    ADD CONSTRAINT stock_valuation_layer_revaluation_account_journal_id_fkey FOREIGN KEY (account_journal_id) REFERENCES public.account_journal(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer_revaluation stock_valuation_layer_revaluation_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer_revaluation
    ADD CONSTRAINT stock_valuation_layer_revaluation_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE CASCADE;


--
-- Name: stock_valuation_layer_revaluation stock_valuation_layer_revaluation_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_valuation_layer_revaluation stock_valuation_layer_revaluation_lot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer_revaluation
    ADD CONSTRAINT stock_valuation_layer_revaluation_lot_id_fkey FOREIGN KEY (lot_id) REFERENCES public.stock_lot(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer_revaluation stock_valuation_layer_revaluation_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer_revaluation
    ADD CONSTRAINT stock_valuation_layer_revaluation_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_valuation_layer_revaluation stock_valuation_layer_revaluation_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_valuation_layer stock_valuation_layer_stock_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_stock_move_id_fkey FOREIGN KEY (stock_move_id) REFERENCES public.stock_move(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer_stock_valuation_layer_revaluation_rel stock_valuation_layer_stock_v_stock_valuation_layer_revalu_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer_stock_valuation_layer_revaluation_rel
    ADD CONSTRAINT stock_valuation_layer_stock_v_stock_valuation_layer_revalu_fkey FOREIGN KEY (stock_valuation_layer_revaluation_id) REFERENCES public.stock_valuation_layer_revaluation(id) ON DELETE CASCADE;


--
-- Name: stock_valuation_layer_stock_valuation_layer_revaluation_rel stock_valuation_layer_stock_valua_stock_valuation_layer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer_stock_valuation_layer_revaluation_rel
    ADD CONSTRAINT stock_valuation_layer_stock_valua_stock_valuation_layer_id_fkey FOREIGN KEY (stock_valuation_layer_id) REFERENCES public.stock_valuation_layer(id) ON DELETE CASCADE;


--
-- Name: stock_valuation_layer stock_valuation_layer_stock_valuation_layer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_valuation_layer
    ADD CONSTRAINT stock_valuation_layer_stock_valuation_layer_id_fkey FOREIGN KEY (stock_valuation_layer_id) REFERENCES public.stock_valuation_layer(id) ON DELETE SET NULL;


--
-- Name: stock_valuation_layer stock_valuation_layer_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_warehouse stock_warehouse_buy_pull_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_buy_pull_id_fkey FOREIGN KEY (buy_pull_id) REFERENCES public.stock_rule(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse stock_warehouse_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_warehouse stock_warehouse_crossdock_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_crossdock_route_id_fkey FOREIGN KEY (crossdock_route_id) REFERENCES public.stock_route(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse stock_warehouse_delivery_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_delivery_route_id_fkey FOREIGN KEY (delivery_route_id) REFERENCES public.stock_route(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse stock_warehouse_in_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_in_type_id_fkey FOREIGN KEY (in_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_int_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_int_type_id_fkey FOREIGN KEY (int_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_lot_stock_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_lot_stock_id_fkey FOREIGN KEY (lot_stock_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse stock_warehouse_manu_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_manu_type_id_fkey FOREIGN KEY (manu_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_manufacture_mto_pull_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_manufacture_mto_pull_id_fkey FOREIGN KEY (manufacture_mto_pull_id) REFERENCES public.stock_rule(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_manufacture_pull_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_manufacture_pull_id_fkey FOREIGN KEY (manufacture_pull_id) REFERENCES public.stock_rule(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_mto_pull_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_mto_pull_id_fkey FOREIGN KEY (mto_pull_id) REFERENCES public.stock_rule(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_bom_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_bom_id_fkey FOREIGN KEY (bom_id) REFERENCES public.mrp_bom(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.procurement_group(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE CASCADE;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_product_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_product_category_id_fkey FOREIGN KEY (product_category_id) REFERENCES public.product_category(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_product_supplier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_product_supplier_id_fkey FOREIGN KEY (product_supplier_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.stock_route(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_supplier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_supplier_id_fkey FOREIGN KEY (supplier_id) REFERENCES public.product_supplierinfo(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_vendor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_vendor_id_fkey FOREIGN KEY (vendor_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse_orderpoint
    ADD CONSTRAINT stock_warehouse_orderpoint_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: stock_warehouse_orderpoint stock_warehouse_orderpoint_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_warehouse stock_warehouse_out_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_out_type_id_fkey FOREIGN KEY (out_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_pack_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_pack_type_id_fkey FOREIGN KEY (pack_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public.res_partner(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_pbm_loc_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_pbm_loc_id_fkey FOREIGN KEY (pbm_loc_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_pbm_mto_pull_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_pbm_mto_pull_id_fkey FOREIGN KEY (pbm_mto_pull_id) REFERENCES public.stock_rule(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_pbm_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_pbm_route_id_fkey FOREIGN KEY (pbm_route_id) REFERENCES public.stock_route(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse stock_warehouse_pbm_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_pbm_type_id_fkey FOREIGN KEY (pbm_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_pick_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_pick_type_id_fkey FOREIGN KEY (pick_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_qc_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_qc_type_id_fkey FOREIGN KEY (qc_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_reception_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_reception_route_id_fkey FOREIGN KEY (reception_route_id) REFERENCES public.stock_route(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse stock_warehouse_repair_mto_pull_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_repair_mto_pull_id_fkey FOREIGN KEY (repair_mto_pull_id) REFERENCES public.stock_rule(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_repair_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_repair_type_id_fkey FOREIGN KEY (repair_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_sam_loc_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_sam_loc_id_fkey FOREIGN KEY (sam_loc_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_sam_rule_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_sam_rule_id_fkey FOREIGN KEY (sam_rule_id) REFERENCES public.stock_rule(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_sam_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_sam_type_id_fkey FOREIGN KEY (sam_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_store_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_store_type_id_fkey FOREIGN KEY (store_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_view_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_view_location_id_fkey FOREIGN KEY (view_location_id) REFERENCES public.stock_location(id) ON DELETE RESTRICT;


--
-- Name: stock_warehouse stock_warehouse_wh_input_stock_loc_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_wh_input_stock_loc_id_fkey FOREIGN KEY (wh_input_stock_loc_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_wh_output_stock_loc_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_wh_output_stock_loc_id_fkey FOREIGN KEY (wh_output_stock_loc_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_wh_pack_stock_loc_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_wh_pack_stock_loc_id_fkey FOREIGN KEY (wh_pack_stock_loc_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_wh_qc_stock_loc_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_wh_qc_stock_loc_id_fkey FOREIGN KEY (wh_qc_stock_loc_id) REFERENCES public.stock_location(id) ON DELETE SET NULL;


--
-- Name: stock_warehouse stock_warehouse_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_warehouse stock_warehouse_xdock_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warehouse
    ADD CONSTRAINT stock_warehouse_xdock_type_id_fkey FOREIGN KEY (xdock_type_id) REFERENCES public.stock_picking_type(id) ON DELETE SET NULL;


--
-- Name: stock_warn_insufficient_qty_repair stock_warn_insufficient_qty_repair_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_warn_insufficient_qty_repair stock_warn_insufficient_qty_repair_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_repair
    ADD CONSTRAINT stock_warn_insufficient_qty_repair_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE CASCADE;


--
-- Name: stock_warn_insufficient_qty_repair stock_warn_insufficient_qty_repair_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_repair
    ADD CONSTRAINT stock_warn_insufficient_qty_repair_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_warn_insufficient_qty_repair stock_warn_insufficient_qty_repair_repair_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_repair
    ADD CONSTRAINT stock_warn_insufficient_qty_repair_repair_id_fkey FOREIGN KEY (repair_id) REFERENCES public.repair_order(id) ON DELETE SET NULL;


--
-- Name: stock_warn_insufficient_qty_repair stock_warn_insufficient_qty_repair_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_warn_insufficient_qty_scrap stock_warn_insufficient_qty_scrap_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_warn_insufficient_qty_scrap stock_warn_insufficient_qty_scrap_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_scrap
    ADD CONSTRAINT stock_warn_insufficient_qty_scrap_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE CASCADE;


--
-- Name: stock_warn_insufficient_qty_scrap stock_warn_insufficient_qty_scrap_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_scrap
    ADD CONSTRAINT stock_warn_insufficient_qty_scrap_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_warn_insufficient_qty_scrap stock_warn_insufficient_qty_scrap_scrap_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_scrap
    ADD CONSTRAINT stock_warn_insufficient_qty_scrap_scrap_id_fkey FOREIGN KEY (scrap_id) REFERENCES public.stock_scrap(id) ON DELETE SET NULL;


--
-- Name: stock_warn_insufficient_qty_scrap stock_warn_insufficient_qty_scrap_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_warn_insufficient_qty_unbuild stock_warn_insufficient_qty_unbuild_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_warn_insufficient_qty_unbuild stock_warn_insufficient_qty_unbuild_location_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_unbuild
    ADD CONSTRAINT stock_warn_insufficient_qty_unbuild_location_id_fkey FOREIGN KEY (location_id) REFERENCES public.stock_location(id) ON DELETE CASCADE;


--
-- Name: stock_warn_insufficient_qty_unbuild stock_warn_insufficient_qty_unbuild_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_unbuild
    ADD CONSTRAINT stock_warn_insufficient_qty_unbuild_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.product_product(id) ON DELETE CASCADE;


--
-- Name: stock_warn_insufficient_qty_unbuild stock_warn_insufficient_qty_unbuild_unbuild_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_warn_insufficient_qty_unbuild
    ADD CONSTRAINT stock_warn_insufficient_qty_unbuild_unbuild_id_fkey FOREIGN KEY (unbuild_id) REFERENCES public.mrp_unbuild(id) ON DELETE SET NULL;


--
-- Name: stock_warn_insufficient_qty_unbuild stock_warn_insufficient_qty_unbuild_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: stock_wh_resupply_table stock_wh_resupply_table_supplied_wh_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_wh_resupply_table
    ADD CONSTRAINT stock_wh_resupply_table_supplied_wh_id_fkey FOREIGN KEY (supplied_wh_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: stock_wh_resupply_table stock_wh_resupply_table_supplier_wh_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.stock_wh_resupply_table
    ADD CONSTRAINT stock_wh_resupply_table_supplier_wh_id_fkey FOREIGN KEY (supplier_wh_id) REFERENCES public.stock_warehouse(id) ON DELETE CASCADE;


--
-- Name: task_dependencies_rel task_dependencies_rel_depends_on_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.task_dependencies_rel
    ADD CONSTRAINT task_dependencies_rel_depends_on_id_fkey FOREIGN KEY (depends_on_id) REFERENCES public.project_task(id) ON DELETE CASCADE;


--
-- Name: task_dependencies_rel task_dependencies_rel_task_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.task_dependencies_rel
    ADD CONSTRAINT task_dependencies_rel_task_id_fkey FOREIGN KEY (task_id) REFERENCES public.project_task(id) ON DELETE CASCADE;


--
-- Name: team_favorite_user_rel team_favorite_user_rel_team_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.team_favorite_user_rel
    ADD CONSTRAINT team_favorite_user_rel_team_id_fkey FOREIGN KEY (team_id) REFERENCES public.crm_team(id) ON DELETE CASCADE;


--
-- Name: team_favorite_user_rel team_favorite_user_rel_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.team_favorite_user_rel
    ADD CONSTRAINT team_favorite_user_rel_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE CASCADE;


--
-- Name: template_attribute_value_mrp_production_rel template_attribute_value_mrp_p_template_attribute_value_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.template_attribute_value_mrp_production_rel
    ADD CONSTRAINT template_attribute_value_mrp_p_template_attribute_value_id_fkey FOREIGN KEY (template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE CASCADE;


--
-- Name: template_attribute_value_mrp_production_rel template_attribute_value_mrp_production_rel_production_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.template_attribute_value_mrp_production_rel
    ADD CONSTRAINT template_attribute_value_mrp_production_rel_production_id_fkey FOREIGN KEY (production_id) REFERENCES public.mrp_production(id) ON DELETE CASCADE;


--
-- Name: template_attribute_value_stock_move_rel template_attribute_value_stock_move_rel_move_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.template_attribute_value_stock_move_rel
    ADD CONSTRAINT template_attribute_value_stock_move_rel_move_id_fkey FOREIGN KEY (move_id) REFERENCES public.stock_move(id) ON DELETE CASCADE;


--
-- Name: template_attribute_value_stock_move_rel template_attribute_value_stock_template_attribute_value_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.template_attribute_value_stock_move_rel
    ADD CONSTRAINT template_attribute_value_stock_template_attribute_value_id_fkey FOREIGN KEY (template_attribute_value_id) REFERENCES public.product_template_attribute_value(id) ON DELETE CASCADE;


--
-- Name: uom_category uom_category_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: uom_category uom_category_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: uom_uom uom_uom_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.uom_uom
    ADD CONSTRAINT uom_uom_category_id_fkey FOREIGN KEY (category_id) REFERENCES public.uom_category(id) ON DELETE RESTRICT;


--
-- Name: uom_uom uom_uom_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: uom_uom uom_uom_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: update_product_attribute_value update_product_attribute_value_attribute_value_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.update_product_attribute_value
    ADD CONSTRAINT update_product_attribute_value_attribute_value_id_fkey FOREIGN KEY (attribute_value_id) REFERENCES public.product_attribute_value(id) ON DELETE CASCADE;


--
-- Name: update_product_attribute_value update_product_attribute_value_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: update_product_attribute_value update_product_attribute_value_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: utm_campaign utm_campaign_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_campaign
    ADD CONSTRAINT utm_campaign_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.res_company(id) ON DELETE SET NULL;


--
-- Name: utm_campaign utm_campaign_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: utm_campaign utm_campaign_stage_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_campaign
    ADD CONSTRAINT utm_campaign_stage_id_fkey FOREIGN KEY (stage_id) REFERENCES public.utm_stage(id) ON DELETE RESTRICT;


--
-- Name: utm_campaign utm_campaign_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_campaign
    ADD CONSTRAINT utm_campaign_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.res_users(id) ON DELETE RESTRICT;


--
-- Name: utm_campaign utm_campaign_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: utm_medium utm_medium_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: utm_medium utm_medium_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: utm_source utm_source_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: utm_source utm_source_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: utm_stage utm_stage_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: utm_stage utm_stage_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: utm_tag utm_tag_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: utm_tag_rel utm_tag_rel_campaign_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_tag_rel
    ADD CONSTRAINT utm_tag_rel_campaign_id_fkey FOREIGN KEY (campaign_id) REFERENCES public.utm_tag(id) ON DELETE CASCADE;


--
-- Name: utm_tag_rel utm_tag_rel_tag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.utm_tag_rel
    ADD CONSTRAINT utm_tag_rel_tag_id_fkey FOREIGN KEY (tag_id) REFERENCES public.utm_campaign(id) ON DELETE CASCADE;


--
-- Name: utm_tag utm_tag_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: validate_account_move validate_account_move_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: validate_account_move validate_account_move_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: web_editor_converter_test web_editor_converter_test_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: web_editor_converter_test web_editor_converter_test_many2one_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.web_editor_converter_test
    ADD CONSTRAINT web_editor_converter_test_many2one_fkey FOREIGN KEY (many2one) REFERENCES public.web_editor_converter_test_sub(id) ON DELETE SET NULL;


--
-- Name: web_editor_converter_test_sub web_editor_converter_test_sub_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: web_editor_converter_test_sub web_editor_converter_test_sub_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: web_editor_converter_test web_editor_converter_test_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: web_tour_tour web_tour_tour_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: web_tour_tour_step web_tour_tour_step_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: web_tour_tour_step web_tour_tour_step_tour_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.web_tour_tour_step
    ADD CONSTRAINT web_tour_tour_step_tour_id_fkey FOREIGN KEY (tour_id) REFERENCES public.web_tour_tour(id) ON DELETE CASCADE;


--
-- Name: web_tour_tour_step web_tour_tour_step_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: web_tour_tour web_tour_tour_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: wizard_ir_model_menu_create wizard_ir_model_menu_create_create_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: wizard_ir_model_menu_create wizard_ir_model_menu_create_menu_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

ALTER TABLE ONLY public.wizard_ir_model_menu_create
    ADD CONSTRAINT wizard_ir_model_menu_create_menu_id_fkey FOREIGN KEY (menu_id) REFERENCES public.ir_ui_menu(id) ON DELETE CASCADE;


--
-- Name: wizard_ir_model_menu_create wizard_ir_model_menu_create_write_uid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: odoo
--

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


--
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: pg_database_owner
--

REVOKE USAGE ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO PUBLIC;


--
--

\unrestrict O9fZdGpoziWptAiX4c6V43UUl8rxZqLqZXl6e3izF1f2cetNX6kuPXdA6yYd08s

