From 2167002dd7da3cde420da7fec550b30e49ac8417 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Tue, 23 Mar 2021 18:17:06 +0100 Subject: [PATCH] [MOV][FIX] *: place static files in their place of use Prepare the incoming documentation refactoring, ensuring the files used by a doc page are correcly moved together with the page, avoiding broken links during the reorganisation. Partial backport of https://github.com/odoo/documentation-user/commit/f7bedfce2ee782b42542f9d2f072f709e6ee80fb to ease forward-ports --- .../localizations}/files/certificate.cer | Bin .../localizations}/files/certificate.key | Bin accounting/localizations/mexico.rst | 6 ++--- ...d_party_application_product_categories.csv | 0 ...rnal_id_3rd_party_application_products.csv | 0 .../files}/database_import_test.sql | 0 .../base_import/files}/m2m_customers_tags.csv | 0 .../files}/o2m_customers_contacts.csv | 0 .../files}/o2m_purchase_order_lines.csv | 0 ...order_functional_error_line_cant_adpat.csv | 0 general/base_import/import_faq.rst | 23 +++++++++--------- .../files/vendor_pricelists_template.csv | 8 ++++++ purchase/purchases/master/import.rst | 3 +-- 13 files changed, 23 insertions(+), 17 deletions(-) rename {_static => accounting/localizations}/files/certificate.cer (100%) rename {_static => accounting/localizations}/files/certificate.key (100%) rename {_static/example_files => general/base_import/files}/External_id_3rd_party_application_product_categories.csv (100%) rename {_static/example_files => general/base_import/files}/External_id_3rd_party_application_products.csv (100%) rename {_static/example_files => general/base_import/files}/database_import_test.sql (100%) rename {_static/example_files => general/base_import/files}/m2m_customers_tags.csv (100%) rename {_static/example_files => general/base_import/files}/o2m_customers_contacts.csv (100%) rename {_static/example_files => general/base_import/files}/o2m_purchase_order_lines.csv (100%) rename {_static/example_files => general/base_import/files}/purchase.order_functional_error_line_cant_adpat.csv (100%) create mode 100644 purchase/purchases/master/files/vendor_pricelists_template.csv diff --git a/_static/files/certificate.cer b/accounting/localizations/files/certificate.cer similarity index 100% rename from _static/files/certificate.cer rename to accounting/localizations/files/certificate.cer diff --git a/_static/files/certificate.key b/accounting/localizations/files/certificate.key similarity index 100% rename from _static/files/certificate.key rename to accounting/localizations/files/certificate.key diff --git a/accounting/localizations/mexico.rst b/accounting/localizations/mexico.rst index 777783b38..db3b7f7e1 100644 --- a/accounting/localizations/mexico.rst +++ b/accounting/localizations/mexico.rst @@ -181,8 +181,8 @@ and then enter your PAC username and PAC password. Here is a SAT certificate you can use if you want to use the *Test Environment* for the Mexican Accounting Localization. - - `Certificate`_ - - `Certificate Key`_ + :download:` Certificate ` + :download:` Certificate Key ` - **Password:** 12345678a 7. Configure the tag in sales taxes @@ -661,5 +661,3 @@ FAQ .. _`given by the SAT`: http://sat.gob.mx/informacion_fiscal/factura_electronica/Documents/GuiaAnexo20DPA.pdf .. _`Anexo 24`: http://www.sat.gob.mx/fichas_tematicas/buzon_tributario/Documents/Anexo24_05012015.pdf .. _`official information here`: http://www.sat.gob.mx/fichas_tematicas/declaraciones_informativas/Paginas/declaracion_informativa_terceros.aspx -.. _`Certificate`: ../../_static/files/certificate.cer -.. _`Certificate Key`: ../../_static/files/certificate.key diff --git a/_static/example_files/External_id_3rd_party_application_product_categories.csv b/general/base_import/files/External_id_3rd_party_application_product_categories.csv similarity index 100% rename from _static/example_files/External_id_3rd_party_application_product_categories.csv rename to general/base_import/files/External_id_3rd_party_application_product_categories.csv diff --git a/_static/example_files/External_id_3rd_party_application_products.csv b/general/base_import/files/External_id_3rd_party_application_products.csv similarity index 100% rename from _static/example_files/External_id_3rd_party_application_products.csv rename to general/base_import/files/External_id_3rd_party_application_products.csv diff --git a/_static/example_files/database_import_test.sql b/general/base_import/files/database_import_test.sql similarity index 100% rename from _static/example_files/database_import_test.sql rename to general/base_import/files/database_import_test.sql diff --git a/_static/example_files/m2m_customers_tags.csv b/general/base_import/files/m2m_customers_tags.csv similarity index 100% rename from _static/example_files/m2m_customers_tags.csv rename to general/base_import/files/m2m_customers_tags.csv diff --git a/_static/example_files/o2m_customers_contacts.csv b/general/base_import/files/o2m_customers_contacts.csv similarity index 100% rename from _static/example_files/o2m_customers_contacts.csv rename to general/base_import/files/o2m_customers_contacts.csv diff --git a/_static/example_files/o2m_purchase_order_lines.csv b/general/base_import/files/o2m_purchase_order_lines.csv similarity index 100% rename from _static/example_files/o2m_purchase_order_lines.csv rename to general/base_import/files/o2m_purchase_order_lines.csv diff --git a/_static/example_files/purchase.order_functional_error_line_cant_adpat.csv b/general/base_import/files/purchase.order_functional_error_line_cant_adpat.csv similarity index 100% rename from _static/example_files/purchase.order_functional_error_line_cant_adpat.csv rename to general/base_import/files/purchase.order_functional_error_line_cant_adpat.csv diff --git a/general/base_import/import_faq.rst b/general/base_import/import_faq.rst index 8593d7ff7..d61e2478c 100644 --- a/general/base_import/import_faq.rst +++ b/general/base_import/import_faq.rst @@ -152,10 +152,11 @@ According to your need, you should use one of these 3 ways to reference records When you use External IDs, you can import CSV files with the "External ID" column to define the External ID of each record you import. Then, you will be able to make a reference to that record with columns like "Field/External ID". The following two CSV files give you an example for Products and their Categories. -`CSV file for categories <../../_static/example_files/External_id_3rd_party_application_product_categories.csv>`_. - -`CSV file for Products <../../_static/example_files/External_id_3rd_party_application_products.csv>`_. +:download:`CSV file for categories +`. +:download:`CSV file for Products +`. What can I do if I have multiple matches for a field? ----------------------------------------------------- @@ -171,8 +172,7 @@ How can I import a many2many relationship field (e.g. a customer that has multip The tags should be separated by a comma without any spacing. For example, if you want your customer to be linked to both tags 'Manufacturer' and 'Retailer' then you will encode "Manufacturer,Retailer" in the same column of your CSV file. -`CSV file for Manufacturer, Retailer <../../_static/example_files/m2m_customers_tags.csv>`_. - +:download:`CSV file for Manufacturer, Retailer ` How can I import a one2many relationship (e.g. several Order Lines of a Sales Order)? @@ -181,17 +181,15 @@ How can I import a one2many relationship (e.g. several Order Lines of a Sales Or If you want to import sales order having several order lines; for each order line, you need to reserve a specific row in the CSV file. The first order line will be imported on the same row as the information relative to order. Any additional lines will need an addtional row that does not have any information in the fields relative to the order. As an example, here is purchase.order_functional_error_line_cant_adpat.CSV file of some quotations you can import, based on demo data. -`File for some Quotations <../../_static/example_files/purchase.order_functional_error_line_cant_adpat.csv>`_. +:download:`File for some Quotations `. The following CSV file shows how to import purchase orders with their respective purchase order lines: -`Purchase orders with their respective purchase order lines <../../_static/example_files/o2m_purchase_order_lines.csv>`_. +:download:`Purchase orders with their respective purchase order lines `. The following CSV file shows how to import customers and their respective contacts: -`Customers and their respective contacts <../../_static/example_files/o2m_customers_contacts.csv>`_. - - +:download:`Customers and their respective contacts `. Can I import several times the same record? ------------------------------------------- @@ -216,7 +214,10 @@ If you need to import data from different tables, you will have to recreate rela To manage relations between tables, you can use the "External ID" facilities of Odoo. The "External ID" of a record is the unique identifier of this record in another application. This "External ID" must be unique accoss all the records of all objects, so it's a good practice to prefix this "External ID" with the name of the application or table. (like 'company_1', 'person_1' instead of '1') -As an example, suppose you have a SQL database with two tables you want to import: companies and persons. Each person belong to one company, so you will have to recreate the link between a person and the company he work for. (If you want to test this example, here is a dump of such a PostgreSQL database) +As an example, suppose you have a SQL database with two tables you want to import: companies and +persons. Each person belong to one company, so you will have to recreate the link between a person +and the company he work for. (If you want to test this example, here is a :download:`dump of such a +PostgreSQL database `) We will first export all companies and their "External ID". In PSQL, write the following command: diff --git a/purchase/purchases/master/files/vendor_pricelists_template.csv b/purchase/purchases/master/files/vendor_pricelists_template.csv new file mode 100644 index 000000000..dc8097faa --- /dev/null +++ b/purchase/purchases/master/files/vendor_pricelists_template.csv @@ -0,0 +1,8 @@ +Vendor,Product Template,Vendor Product Name,Vendor Product Code,Price,Minimal Quantity,Start Date,End Date,Delivery Lead Time +ASUSTeK,iMac,"Apple iMac 27""",ART439872,1299,5,,,2 +Camptocamp,iMac,"Apple iMac 27""",IT98764,1399,1,,,4 +ASUSTeK,"Switch, 24 ports",Bluetek Switch,ART439456,66,,,,4 +ASUSTeK,Datacard,LS DC02,ART672098,35,,,,5 +ASUSTeK,Laptop Customized,Asus ROG CS,ART439870,3300,,01/01/2018,12/31/2018,10 +ASUSTeK,"Mouse, Wireless",Logitech G950,ART859562,12.5,,,,3 +ASUSTeK,iPad Mini,Apple iPad Mini 32GB,ART547892,750,,01/01/2018,05/05/2018,3 \ No newline at end of file diff --git a/purchase/purchases/master/import.rst b/purchase/purchases/master/import.rst index 11ab9ac4c..f1e730d45 100644 --- a/purchase/purchases/master/import.rst +++ b/purchase/purchases/master/import.rst @@ -30,5 +30,4 @@ See below a template of the columns used. .. image:: media/import02.png :align: center -`Template -download `__ +:download:`Click here to download the template `