diff --git a/sheet_dataframe_process/README.rst b/sheet_dataframe_process/README.rst index 725f6aea16..8fe6e0cc2b 100644 --- a/sheet_dataframe_process/README.rst +++ b/sheet_dataframe_process/README.rst @@ -10,9 +10,9 @@ Sheet Dataframe Process !! source digest: sha256:3fb8a401fe8c3d73e23b477915bbd9ff0b2bcb331711726a4fd5be280ad53d5d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png :target: https://odoo-community.org/page/development-status - :alt: Beta + :alt: Alpha .. |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 @@ -52,6 +52,11 @@ Why Polars ? - environment consideration - dynamic project +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + **Table of contents** .. contents:: diff --git a/sheet_dataframe_process/__manifest__.py b/sheet_dataframe_process/__manifest__.py index 0114dc48e2..ea2bd94104 100644 --- a/sheet_dataframe_process/__manifest__.py +++ b/sheet_dataframe_process/__manifest__.py @@ -5,6 +5,7 @@ "version": "18.0.1.0.0", "category": "Reporting", "license": "AGPL-3", + "development_status": "Alpha", "summary": "Allow to create a Polars dataframe from a sheet file and " "process it according to rules", "website": "https://github.com/OCA/reporting-engine", @@ -19,16 +20,15 @@ ] }, "data": [ + "data/action.xml", + "data/demo.xml", "security/ir.model.access.xml", "wizards/sheet_dataframe.xml", "views/file_config.xml", "views/file_field.xml", "views/file_partner_field.xml", - # "views/file_config_field.xml", "views/test_polars_file.xml", "views/menu.xml", - "data/action.xml", - "data/demo.xml", ], "installable": True, } diff --git a/sheet_dataframe_process/data/action.xml b/sheet_dataframe_process/data/action.xml index 3e49026e7e..a11c461d1a 100644 --- a/sheet_dataframe_process/data/action.xml +++ b/sheet_dataframe_process/data/action.xml @@ -2,15 +2,15 @@ - 📙 Mise à jour config + Update config code - env["file.config"]._refresh_conf() + env["file.config"]._refresh_conf_hook() - ⚙ Populate file polars example + 🐻‍❄️ Populate file polars example code diff --git a/sheet_dataframe_process/data/demo.xml b/sheet_dataframe_process/data/demo.xml index b83f720526..ca098832d1 100644 --- a/sheet_dataframe_process/data/demo.xml +++ b/sheet_dataframe_process/data/demo.xml @@ -2,6 +2,10 @@ + @@ -15,15 +19,4 @@ skip - - - - pays - - - - - Blabla - - diff --git a/sheet_dataframe_process/models/file_config.py b/sheet_dataframe_process/models/file_config.py index 0167b16e1d..14b424f5d3 100644 --- a/sheet_dataframe_process/models/file_config.py +++ b/sheet_dataframe_process/models/file_config.py @@ -1,10 +1,10 @@ -from odoo import fields, models +from odoo import Command, fields, models class FileConfig(models.Model): _name = "file.config" _inherit = "mail.thread" - _description = "Config import fournisseur" + _description = "File Configuration" _rec_name = "model_id" model_id = fields.Many2one( @@ -19,12 +19,33 @@ class FileConfig(models.Model): default="display", help="Some other behaviors can be implemented", ) - partner_ids = fields.Many2many(comodel_name="res.partner") - field_ids = fields.One2many(comodel_name="file.field", inverse_name="config_id") + partner_ids = fields.Many2many( + comodel_name="res.partner", domain="[('active', 'in', (True, False))]" + ) + field_ids = fields.One2many( + comodel_name="file.field", inverse_name="config_id", copy=True + ) field_match_ids = fields.One2many( - comodel_name="file.partner.field", inverse_name="config_id" + comodel_name="file.partner.field", inverse_name="config_id", copy=True ) def populate_match_lines(self): + # TODO use api depends instead of ui button self.ensure_one() - return NotImplemented + for partner in self.partner_ids: + fields_ = self.field_match_ids.filtered( + lambda s: s.partner_id == partner + ).mapped("field_id") + line_ids = self.field_ids.filtered( + lambda s: s.field_id not in fields_ + ).mapped("id") + self.field_match_ids = [ + Command.create({"partner_id": partner.id, "line_id": x}) + for x in line_ids + ] + self.field_match_ids.filtered( + lambda s: s.partner_id not in s.config_id.partner_ids + ).unlink() + + def _refresh_conf_hook(self): + "You use it to trigger specific behavior" diff --git a/sheet_dataframe_process/models/file_partner_field.py b/sheet_dataframe_process/models/file_partner_field.py index 1900aceb66..c1145747cb 100644 --- a/sheet_dataframe_process/models/file_partner_field.py +++ b/sheet_dataframe_process/models/file_partner_field.py @@ -11,6 +11,5 @@ class FilePartnerField(models.Model): ) partner_id = fields.Many2one( comodel_name="res.partner", - readonly=True, ) matching_column = fields.Char(help="Field name in spreadsheet") diff --git a/sheet_dataframe_process/static/description/index.html b/sheet_dataframe_process/static/description/index.html index 8a277c2174..e100d32c71 100644 --- a/sheet_dataframe_process/static/description/index.html +++ b/sheet_dataframe_process/static/description/index.html @@ -369,7 +369,7 @@

Sheet Dataframe Process

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:3fb8a401fe8c3d73e23b477915bbd9ff0b2bcb331711726a4fd5be280ad53d5d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

+

Alpha License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

Based on an imported spreadsheet like file, this module allows to create Polars dataframe and process them according to rules in order to:

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+

Table of contents