diff --git a/partner_changeset/README.rst b/partner_changeset/README.rst index 1d45bef56..aa923088b 100644 --- a/partner_changeset/README.rst +++ b/partner_changeset/README.rst @@ -1,7 +1,15 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + ================== Partner Changesets ================== +This module extends the functionality of partners. It allows to create +changesets that must be validated when a partner is modified instead of direct +modifications. Rules allow to configure which field must be validated. + Configuration ============= @@ -51,26 +59,13 @@ Usage General case ------------ -The first step is to create the changeset rules, once that done, - -Addons wanting to create changeset with their own rules should pass the -following keys in the context when they write on the partner: -* ``__changeset_rules_source_model``: name of the model which asks for - the change -* ``__changeset_rules_source_id``: id of the record which asks for the - change - -Also, they should extend the selection in -``ChangesetFieldRule._domain_source_models`` to add their model (the -same that is passed in ``__changeset_rules_source_model``). - -The source is used for the application of the rules, it is also stored -on the changeset for information. +The first step is to create the changeset rules, once that done, writes on +partners will be created as changesets. Finding changesets ------------------ -A menu shows all the changesets in ``Sales > Configuration > Partner +A menu lists all the changesets in ``Sales > Configuration > Partner Changesets > Changesets``. However, it is more convenient to access them directly from the @@ -94,3 +89,70 @@ links for relations can be clicked on. A button on a changeset allows to apply or reject all the changes at once. + +Custom source rules in your addon +--------------------------------- + +Addons wanting to create changeset with their own rules should pass the +following keys in the context when they write on the partner: +* ``__changeset_rules_source_model``: name of the model which asks for + the change +* ``__changeset_rules_source_id``: id of the record which asks for the + change + +Also, they should extend the selection in +``ChangesetFieldRule._domain_source_models`` to add their model (the +same that is passed in ``__changeset_rules_source_model``). + +The source is used for the application of the rules, allowing to have a +different rule for a different source. It is also stored on the changeset for +information. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/134/8.0 + +Known issues / Roadmap +====================== + +* Only a subset of the type of fields is actually supported + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed `feedback +`_. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Guewen Baconnier + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/partner_changeset/__init__.py b/partner_changeset/__init__.py index cde864bae..a77a6fcbc 100644 --- a/partner_changeset/__init__.py +++ b/partner_changeset/__init__.py @@ -1,3 +1,4 @@ # -*- coding: utf-8 -*- +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models diff --git a/partner_changeset/__openerp__.py b/partner_changeset/__openerp__.py index 7aec25f5a..adad33240 100644 --- a/partner_changeset/__openerp__.py +++ b/partner_changeset/__openerp__.py @@ -1,27 +1,10 @@ # -*- coding: utf-8 -*- -# -# -# Authors: Guewen Baconnier -# Copyright 2015 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# +# © 2015 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). {'name': 'Partner Changesets', - 'version': '1.0', - 'author': 'Camptocamp', + 'version': '8.0.1.0.0', + 'author': 'Camptocamp, Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Sales Management', 'depends': ['base', @@ -36,7 +19,5 @@ ], 'demo': ['demo/changeset_field_rule.xml', ], - 'test': [], 'installable': True, - 'auto_install': False, } diff --git a/partner_changeset/models/__init__.py b/partner_changeset/models/__init__.py index bb2a129f9..4dadd37b9 100644 --- a/partner_changeset/models/__init__.py +++ b/partner_changeset/models/__init__.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +# © 2015 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import res_partner from . import res_partner_changeset diff --git a/partner_changeset/models/changeset_field_rule.py b/partner_changeset/models/changeset_field_rule.py index 6374a857a..3534c61c3 100644 --- a/partner_changeset/models/changeset_field_rule.py +++ b/partner_changeset/models/changeset_field_rule.py @@ -1,23 +1,6 @@ # -*- coding: utf-8 -*- -# -# -# Authors: Guewen Baconnier -# Copyright 2015 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# +# © 2015 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api from openerp.tools.cache import ormcache diff --git a/partner_changeset/models/res_partner.py b/partner_changeset/models/res_partner.py index db96b97b8..47227bd3e 100644 --- a/partner_changeset/models/res_partner.py +++ b/partner_changeset/models/res_partner.py @@ -1,23 +1,6 @@ # -*- coding: utf-8 -*- -# -# -# Authors: Guewen Baconnier -# Copyright 2015 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# +# © 2015 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api diff --git a/partner_changeset/models/res_partner_changeset.py b/partner_changeset/models/res_partner_changeset.py index 2b406a310..8b74005b0 100644 --- a/partner_changeset/models/res_partner_changeset.py +++ b/partner_changeset/models/res_partner_changeset.py @@ -1,23 +1,6 @@ # -*- coding: utf-8 -*- -# -# -# Authors: Guewen Baconnier -# Copyright 2015 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# +# © 2015 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from itertools import groupby from lxml import etree diff --git a/partner_changeset/static/description/icon.png b/partner_changeset/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/partner_changeset/static/description/icon.png differ diff --git a/partner_changeset/tests/common.py b/partner_changeset/tests/common.py index d03b5976e..9e0938659 100644 --- a/partner_changeset/tests/common.py +++ b/partner_changeset/tests/common.py @@ -1,23 +1,6 @@ # -*- coding: utf-8 -*- -# -# -# Authors: Guewen Baconnier -# Copyright 2015 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# +# © 2015 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). class ChangesetMixin(object): diff --git a/partner_changeset/tests/test_changeset_field_type.py b/partner_changeset/tests/test_changeset_field_type.py index 52b4821dc..89cb7c4f2 100644 --- a/partner_changeset/tests/test_changeset_field_type.py +++ b/partner_changeset/tests/test_changeset_field_type.py @@ -1,23 +1,6 @@ # -*- coding: utf-8 -*- -# -# -# Authors: Guewen Baconnier -# Copyright 2015 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# +# © 2015 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.tests import common from .common import ChangesetMixin diff --git a/partner_changeset/tests/test_changeset_flow.py b/partner_changeset/tests/test_changeset_flow.py index f97c0b130..f11d28896 100644 --- a/partner_changeset/tests/test_changeset_flow.py +++ b/partner_changeset/tests/test_changeset_flow.py @@ -1,23 +1,6 @@ # -*- coding: utf-8 -*- -# -# -# Authors: Guewen Baconnier -# Copyright 2015 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# +# © 2015 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from datetime import datetime, timedelta diff --git a/partner_changeset/tests/test_changeset_origin.py b/partner_changeset/tests/test_changeset_origin.py index a6841a43d..940b5ddcd 100644 --- a/partner_changeset/tests/test_changeset_origin.py +++ b/partner_changeset/tests/test_changeset_origin.py @@ -1,23 +1,6 @@ # -*- coding: utf-8 -*- -# -# -# Authors: Guewen Baconnier -# Copyright 2015 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# +# © 2015 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.tests import common from .common import ChangesetMixin