[17.0][MIG] bc3_importer: Migration to 17.0#40
Conversation
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: vertical-construction-16.0/vertical-construction-16.0-bc3_importer Translate-URL: https://translation.odoo-community.org/projects/vertical-construction-16-0/vertical-construction-16-0-bc3_importer/
Currently translated at 100.0% (93 of 93 strings) Translation: vertical-construction-16.0/vertical-construction-16.0-bc3_importer Translate-URL: https://translation.odoo-community.org/projects/vertical-construction-16-0/vertical-construction-16-0-bc3_importer/it/
rrebollo
left a comment
There was a problem hiding this comment.
Code Review: Great work! The code looks good to me (LGTM). Thank you for your contribution! I've provided a few suggestions for your consideration—feel free to address them as you see fit.
The BC3 import process is quite complex and heavy, given the depth of parsing required for the BC3 format. In fact, it could be worth considering creating a dedicated Python library to encapsulate at least the parsing workflow. The addon could then leverage this library through a well-defined API, keeping the addon itself cleaner and more maintainable.
In addition, it would be valuable to:
- Add more tests for the addon to ensure reliability.
- Comment and explain the numerous methods and procedures within the addon.
The goal is to improve maintainability and sustainability, since even just reviewing the current addon is a complex and time-consuming task.
| if len(list(duplicates(register_name))) > 0: | ||
| raise ValidationError(_("Register name should unique")) |
There was a problem hiding this comment.
👍 for the duplicates function — I didn’t know about it! I’m intrigued though: wouldn’t a unique _sql_constraints on the register side (by version_id, name) achieve the same? I’m guessing you’re trying to avoid having the same register linked multiple times to a version.
| ): | ||
| temp_line["price_unit"] = sale_order_line.price_unit | ||
| if "name" in temp_line and sale_order_line.name: | ||
| temp_line["name"] = sale_order_line.name + "-" + temp_line["name"] |
There was a problem hiding this comment.
| temp_line["name"] = sale_order_line.name + "-" + temp_line["name"] | |
| temp_line["name"] = f"{{sale_order_line.name}}-{{temp_line['name']}}" |
| line["price_unit"] = sale_order_line.price_unit | ||
| if "name" in line and sale_order_line.name: | ||
| if sale_order_line.name not in line["name"]: | ||
| line["name"] = sale_order_line.name + "- " + line["name"] |
There was a problem hiding this comment.
| line["name"] = sale_order_line.name + "- " + line["name"] | |
| line["name"] = f"{{sale_order_line.name}}-{{line['name']}}" |
| elif line_type == 0 and "#" in parsed_line[0][0]: | ||
| line["display_type"] = "line_section" | ||
| i -= 1 | ||
| line["name"] = "[" + line["bc3_code"] + "] " + product_name |
There was a problem hiding this comment.
| line["name"] = "[" + line["bc3_code"] + "] " + product_name | |
| line["name"] = f"[{{line['bc3_code']}}] {{product_name}}" |
| @@ -0,0 +1 @@ | |||
| Importer of quotations in bc3 format. | |||
There was a problem hiding this comment.
| Importer of quotations in bc3 format. | |
| ## BC3 Quotation Importer | |
| This addon provides the ability to **import quotations in BC3 format** directly into Odoo, streamlining the workflow for construction projects. | |
| ### About BC3 | |
| BC3 is a **standardized file format** widely used in the Spanish construction industry to exchange data between budgeting, estimation, and project-management software. | |
| - **Extension:** `.bc3` | |
| - **Structure:** Text-based, following the **FIEBDC-3 specification** | |
| - **Purpose:** Encodes **bills of quantities**, **unit prices**, and **project cost breakdowns** | |
| - **Use Case:** Facilitates importing/exporting **budgets and quotations** between tools like Presto, Arquímedes, Menfis, and now Odoo | |
| With this addon, BC3 files can be directly mapped into **Odoo quotations**, reducing manual entry and ensuring data consistency across systems. |
@BinhexTeam