Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][ADD] bc3_importer #35

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions bc3_importer/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
==================
BC3 files importer
==================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7daee495c7ca99f6178a9535d2bee76b39dd8ee4d83d4515714c7614a99abaf9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fvertical--construction-lightgray.png?logo=github
:target: https://github.com/OCA/vertical-construction/tree/14.0/bc3_importer
:alt: OCA/vertical-construction
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/vertical-construction-14-0/vertical-construction-14-0-bc3_importer
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/vertical-construction&target_branch=14.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Importer of quotations in bc3 format.


**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/vertical-construction/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/vertical-construction/issues/new?body=module:%20bc3_importer%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Binhex

Contributors
~~~~~~~~~~~~

* `Binhex <https://binhex.cloud>`_:

* Zuzanna Elzbieta Szalaty Szalaty <[email protected]>


Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/vertical-construction <https://github.com/OCA/vertical-construction/tree/14.0/bc3_importer>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions bc3_importer/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizard
22 changes: 22 additions & 0 deletions bc3_importer/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "BC3 files importer",
"author": "Binhex, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/vertical-construction",
"category": "BC3",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"depends": ["project", "sale_management"],
"data": [
"security/bc3_file_security.xml",
"security/ir.model.access.csv",
"wizard/bc3_import_wizard_views.xml",
"views/bc3_version_views.xml",
"data/bc3_version_data.xml",
"views/sale_order_views.xml",
"data/uom_data.xml",
"data/product_data.xml",
],
"external_dependencies": {
"python": ["iteration_utilities", "chardet"],
},
}
259 changes: 259 additions & 0 deletions bc3_importer/data/bc3_version_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="bc3_version_2020_v2" model="bc3.version">
<field name="name">FIEBDC-3-2020v2</field>
</record>
<!-- Version Register-->
<record id="bc3_rule_v_1" model="bc3.version.register.rule">
<field name="sequence">1</field>
<field name="field_id" ref="bc3_importer.field_sale_order__bc3_file_property" />
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order" />
</record>
<record id="bc3_rule_v_2" model="bc3.version.register.rule">
<field name="sequence">2</field>
<field
name="field_id"
ref="bc3_importer.field_sale_order__bc3_version_format"
/>
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order" />
</record>
<record id="bc3_rule_v_3" model="bc3.version.register.rule">
<field name="sequence">3</field>
<field name="field_id" ref="bc3_importer.field_sale_order__bc3_version_date" />
<field name="is_child">True</field>
<field name="model_id" ref="sale.model_sale_order" />
</record>
<record id="bc3_rule_v_4" model="bc3.version.register.rule">
<field name="sequence">4</field>
<field name="field_id" ref="bc3_importer.field_sale_order__bc3_program" />
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order" />
</record>
<record id="bc3_rule_v_5" model="bc3.version.register.rule">
<field name="sequence">5</field>
<field name="field_id" ref="bc3_importer.field_sale_order__bc3_header" />
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order" />
</record>
<record id="bc3_rule_v_6" model="bc3.version.register.rule">
<field name="sequence">6</field>
<field
name="field_id"
ref="bc3_importer.field_sale_order__bc3_identifying_label"
/>
<field name="is_child">True</field>
<field name="model_id" ref="sale.model_sale_order" />
</record>
<record id="bc3_rule_v_7" model="bc3.version.register.rule">
<field name="sequence">7</field>
<field name="field_id" ref="bc3_importer.field_sale_order__bc3_character_set" />
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order" />
</record>
<record id="bc3_rule_v_8" model="bc3.version.register.rule">
<field name="sequence">8</field>
<field name="field_id" ref="bc3_importer.field_sale_order__bc3_comment" />
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order" />
</record>
<record id="bc3_rule_v_9" model="bc3.version.register.rule">
<field name="sequence">9</field>
<field
name="field_id"
ref="bc3_importer.field_sale_order__bc3_information_type"
/>
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order" />
</record>
<record id="bc3_rule_v_10" model="bc3.version.register.rule">
<field name="sequence">10</field>
<field
name="field_id"
ref="bc3_importer.field_sale_order__bc3_certification_number"
/>
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order" />
</record>
<record id="bc3_rule_v_11" model="bc3.version.register.rule">
<field name="sequence">11</field>
<field
name="field_id"
ref="bc3_importer.field_sale_order__bc3_certification_date"
/>
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order" />
</record>
<record id="bc3_rule_v_12" model="bc3.version.register.rule">
<field name="sequence">12</field>
<field name="field_id" ref="bc3_importer.field_sale_order__bc3_base_url" />
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order" />
</record>
<record id="bc3_register_v" model="bc3.version.register">
<field name="name">v</field>
<field
name="description"
>~V | [ PROPIEDAD_ARCHIVO ] | VERSION_FORMATO [ \ DDMMAAAA ] | [
PROGRAMA_EMISION ] | [ CABECERA ] \ { ROTULO_IDENTIFICACION \ } | [
JUEGO_CARACTERES ] | [ COMENTARIO ] | [ TIPO INFORMACIÓN ] | [ NÚMERO
CERTIFICACIÓN ] | [ FECHA CERTIFICACIÓN ] | [ URL_BASE ] |</field>
<field name="version_id" ref="bc3_importer.bc3_version_2020_v2" />
<field name="model_id" ref="sale.model_sale_order" />
<field
name="rule_ids"
eval="[(6,0,[ref('bc3_importer.bc3_rule_v_1'),ref('bc3_importer.bc3_rule_v_2'),ref('bc3_importer.bc3_rule_v_3'),ref('bc3_importer.bc3_rule_v_4'),ref('bc3_importer.bc3_rule_v_5'),ref('bc3_importer.bc3_rule_v_6'),ref('bc3_importer.bc3_rule_v_7'),ref('bc3_importer.bc3_rule_v_8'),ref('bc3_importer.bc3_rule_v_9'),ref('bc3_importer.bc3_rule_v_10'),ref('bc3_importer.bc3_rule_v_11'),ref('bc3_importer.bc3_rule_v_12')])]"
/>
</record>
<!-- Concept Register-->
<record id="bc3_rule_c_1" model="bc3.version.register.rule">
<field name="sequence">1</field>
<field name="field_id" ref="bc3_importer.field_sale_order_line__bc3_code" />
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order_line" />
</record>
<record id="bc3_rule_c_2" model="bc3.version.register.rule">
<field name="sequence">2</field>
<field name="field_id" ref="bc3_importer.field_sale_order_line__bc3_code" />
<field name="is_child">True</field>
<field name="model_id" ref="sale.model_sale_order_line" />
</record>
<record id="bc3_rule_c_3" model="bc3.version.register.rule">
<field name="sequence">3</field>
<field name="field_id" ref="sale.field_sale_order_line__product_uom" />
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order_line" />
</record>
<record id="bc3_rule_c_4" model="bc3.version.register.rule">
<field name="sequence">4</field>
<field name="field_id" ref="sale.field_sale_order_line__product_template_id" />
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order_line" />
</record>
<record id="bc3_rule_c_5" model="bc3.version.register.rule">
<field name="sequence">5</field>
<field name="field_id" ref="sale.field_sale_order_line__price_unit" />
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order_line" />
</record>
<record id="bc3_rule_c_6" model="bc3.version.register.rule">
<field name="sequence">6</field>
<field name="is_child">False</field>
</record>
<record id="bc3_rule_c_7" model="bc3.version.register.rule">
<field name="sequence">7</field>
<field name="field_id" ref="product.field_product_template__categ_id" />
<field name="is_child">False</field>
<field name="model_id" ref="product.model_product_template" />
</record>
<record id="bc3_register_c" model="bc3.version.register">
<field name="name">c</field>
<field
name="description"
>~C | CODIGO { \ CODIGO } | [ UNIDAD ] | [ RESUMEN ] | { PRECIO \ } | { FECHA \ } | [ TIPO ] |</field>
<field name="version_id" ref="bc3_importer.bc3_version_2020_v2" />
<field name="model_id" ref="sale.model_sale_order_line" />
<field
name="rule_ids"
eval="[(6,0,[ref('bc3_importer.bc3_rule_c_1'),ref('bc3_importer.bc3_rule_c_2'),ref('bc3_importer.bc3_rule_c_3'),ref('bc3_importer.bc3_rule_c_4'),ref('bc3_importer.bc3_rule_c_5'),ref('bc3_importer.bc3_rule_c_6'),ref('bc3_importer.bc3_rule_c_7')])]"
/>
</record>
<!-- Descomposition Register-->
<record id="bc3_rule_d_1" model="bc3.version.register.rule">
<field name="sequence">1</field>
<field name="field_id" ref="sale.field_sale_order_line__sequence" />
<field name="is_child">False</field>
</record>
<record id="bc3_rule_d_2" model="bc3.version.register.rule">
<field name="sequence">2</field>
<field name="field_id" ref="bc3_importer.field_sale_order_line__bc3_code" />
<field name="is_child">False</field>
<field name="model_id" ref="sale.model_sale_order_line" />
<field name="primary_key">True</field>
<field
name="field_ids"
eval="[(6,0,[ref('sale.field_sale_order_line__product_uom_qty'),ref('sale.field_sale_order_line__price_unit')])]"
/>
</record>
<record id="bc3_rule_d_4" model="bc3.version.register.rule">
<field name="sequence">3</field>
<field name="is_child">True</field>
<field name="field_id" ref="sale.field_sale_order_line__price_unit" />
<field name="model_id" ref="sale.model_sale_order_line" />
</record>
<record id="bc3_rule_d_3" model="bc3.version.register.rule">
<field name="sequence">4</field>
<field name="field_id" ref="sale.field_sale_order_line__product_uom_qty" />
<field name="is_child">True</field>
<field name="model_id" ref="sale.model_sale_order_line" />
</record>

<record id="bc3_rule_d_5" model="bc3.version.register.rule">
<field name="sequence">5</field>
<field name="is_child">False</field>
</record>
<record id="bc3_rule_d_6" model="bc3.version.register.rule">
<field name="sequence">6</field>
<field name="is_child">True</field>
</record>
<record id="bc3_rule_d_7" model="bc3.version.register.rule">
<field name="sequence">7</field>
<field name="is_child">True</field>
</record>
<record id="bc3_rule_d_8" model="bc3.version.register.rule">
<field name="sequence">8</field>
<field name="field_id" ref="sale.field_sale_order_line__discount" />
<field name="is_child">True</field>
<field name="model_id" ref="sale.model_sale_order_line" />
</record>
<record id="bc3_register_d" model="bc3.version.register">
<field name="name">d</field>
<field
name="description"
>~D | CODIGO_PADRE | &lt; CODIGO_HIJO \ [ FACTOR ] \ [ RENDIMIENTO ] \ &gt; | &lt; CODIGO_HIJO \ [ FACTOR ] \ [ RENDIMIENTO ] \ {CODIGO_PORCENTAJE ; } \ &gt; |</field>
<field name="version_id" ref="bc3_importer.bc3_version_2020_v2" />
<field name="model_id" ref="sale.model_sale_order_line" />
<field name="edit_existent">True</field>
<field
name="rule_ids"
eval="[(6,0,[ref('bc3_importer.bc3_rule_d_1'),ref('bc3_importer.bc3_rule_d_2'),ref('bc3_importer.bc3_rule_d_3'),ref('bc3_importer.bc3_rule_d_4'),ref('bc3_importer.bc3_rule_d_5'),ref('bc3_importer.bc3_rule_d_6'),ref('bc3_importer.bc3_rule_d_7'),ref('bc3_importer.bc3_rule_d_8')])]"
/>
</record>
<!-- Descomposition Register-->
<record id="bc3_rule_t_1" model="bc3.version.register.rule">
<field name="sequence">1</field>
<field name="field_id" ref="bc3_importer.field_sale_order_line__bc3_code" />
<field name="primary_key">True</field>
<field name="model_id" ref="sale.model_sale_order_line" />
</record>
<record id="bc3_rule_t_2" model="bc3.version.register.rule">
<field name="sequence">2</field>
<field name="field_id" ref="sale.field_sale_order_line__name" />
<field name="model_id" ref="sale.model_sale_order_line" />
</record>
<record id="bc3_register_t" model="bc3.version.register">
<field name="name">t</field>
<field name="description">~T | CODIGO_CONCEPTO | TEXTO_DESCRIPTIVO | </field>
<field name="version_id" ref="bc3_importer.bc3_version_2020_v2" />
<field name="model_id" ref="sale.model_sale_order_line" />
<field name="edit_existent">True</field>
<field
name="rule_ids"
eval="[(6,0,[ref('bc3_importer.bc3_rule_t_1'),ref('bc3_importer.bc3_rule_t_2')])]"
/>
</record>

<function name="get_regular_expression" model="bc3.version.register">
<value eval="[ref('bc3_importer.bc3_register_c')]" />
</function>
<function name="get_regular_expression" model="bc3.version.register">
<value eval="[ref('bc3_importer.bc3_register_d')]" />
</function>
<function name="get_regular_expression" model="bc3.version.register">
<value eval="[ref('bc3_importer.bc3_register_v')]" />
</function>
<function name="get_regular_expression" model="bc3.version.register">
<value eval="[ref('bc3_importer.bc3_register_t')]" />
</function>
</odoo>
Loading
Loading