-
-
Notifications
You must be signed in to change notification settings - Fork 602
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
[16.0][MIG] pos_customer_required_fields: Migration to 16.0 #1249
Open
LaetitiaElabore
wants to merge
15
commits into
OCA:16.0
Choose a base branch
from
elabore-coop:16.0-mig-pos_customer_required_fields
base: 16.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9d8f86a
[ADD] pos_customer_required_fields
petrus-v e0262fd
add missing license and last callage return
petrus-v 9e20e84
styling
petrus-v 033022e
[FIX]remove custom group in view definition
petrus-v ff25cff
[UPD] Update pos_customer_required_fields.pot
oca-travis 58a958c
[UPD] README.rst
OCA-git-bot a323b66
[FIX] #777 pos_customer_required_fields
petrus-v 4e7a9ee
pos_customer_required_fields 12.0.1.0.1
OCA-git-bot a91ca13
Added translation using Weblate (Italian)
mymage a6a8965
Translated using Weblate (Italian)
mymage 763d43a
Translated using Weblate (Italian)
mymage 020761c
[UPD] README.rst
OCA-git-bot 8beb302
Update translation files
weblate 68288ca
[IMP] pos_customer_required_fields: apply pre-commit auto fixes
LaetitiaElabore 38c31ce
[MIG]pos_customer_required_fields: Migration to 16.0
LaetitiaElabore File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
======================================== | ||
Point Of Sale - Customer required fields | ||
======================================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:5e1195e22d1cb20ca6b0ced42d6ae852966f3e8817a742d5e9c193708fd1b3ef | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
.. |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%2Fpos-lightgray.png?logo=github | ||
:target: https://github.com/OCA/pos/tree/16.0/pos_customer_required_fields | ||
:alt: OCA/pos | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_customer_required_fields | ||
: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/pos&target_branch=16.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module enforce users to properly define customer fields | ||
created from point of sale or used in pos order. | ||
|
||
From PoS config you will be able to define required fields. | ||
|
||
Using this module without `pos_customer_required` module you are | ||
still able to create PoS order without customer. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
To define customer required field on PoS UI: | ||
|
||
#. Go to any PoS configuration *Point of Sale > Configuration > Point of Sale*. | ||
#. Edit Partner required fields. | ||
|
||
.. warning:: | ||
|
||
Make sure to choose only `res.partner`'s fields present on the PoS UI. | ||
|
||
Usage | ||
===== | ||
|
||
To create or edit partner from PoS | ||
|
||
#. Open PoS session | ||
#. Click on client button | ||
#. required filed are highlight (in green) | ||
|
||
.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_customer_required_fields/static/description/pos_edit_customer.png | ||
|
||
If you choose an existing partner with missing informations | ||
while validating the payment you will be ask to collect missing | ||
customer informations. | ||
|
||
.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_customer_required_fields/static/description/pos_customer_missing_fields.png | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/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/pos/issues/new?body=module:%20pos_customer_required_fields%0Aversion:%2016.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 | ||
~~~~~~~ | ||
|
||
* Pierre Verkest | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
`Moka Tourisme <https://www.mokatourisme.fr>`_ | ||
|
||
* Pierre Verkest <[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. | ||
|
||
.. |maintainer-petrus-v| image:: https://github.com/petrus-v.png?size=40px | ||
:target: https://github.com/petrus-v | ||
:alt: petrus-v | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-petrus-v| | ||
|
||
This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/16.0/pos_customer_required_fields>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright 2022 Moka Tourisme (https://www.mokatourisme.fr). | ||
# @author Pierre Verkest <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2022 Moka Tourisme (https://www.mokatourisme.fr). | ||
# @author Pierre Verkest <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Point Of Sale - Customer required fields", | ||
"summary": "Define customer required field used in PoS order.", | ||
"version": "16.0.1.0.0", | ||
"category": "Point of Sale", | ||
"author": "Pierre Verkest, Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/pos", | ||
"license": "AGPL-3", | ||
"maintainers": [ | ||
"petrus-v", | ||
], | ||
"depends": [ | ||
"point_of_sale", | ||
], | ||
"data": [ | ||
"views/view_pos_config.xml", | ||
], | ||
"assets": { | ||
"point_of_sale.assets": [ | ||
"pos_customer_required_fields/static/src/xml/PartnerDetailsEdit.xml", | ||
"pos_customer_required_fields/static/src/js/PartnerDetailsEdit.js", | ||
"pos_customer_required_fields/static/src/css/pos.css", | ||
] | ||
}, | ||
"demo": [], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * pos_customer_required_fields | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-10-01 11:34+0000\n" | ||
"PO-Revision-Date: 2024-10-01 11:34+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model,name:pos_customer_required_fields.model_res_config_settings | ||
msgid "Config Settings" | ||
msgstr "Paramètres de configuration" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model,name:pos_customer_required_fields.model_res_partner | ||
msgid "Contact" | ||
msgstr "" | ||
|
||
#. module: pos_customer_required_fields | ||
#. odoo-python | ||
#: code:addons/pos_customer_required_fields/models/res_partner.py:0 | ||
#, python-format | ||
msgid "Following required field(s) is/are not set: %s." | ||
msgstr "Le(s) champ(s) requis suivant n'est/ne sont pas renseigné(s) : %s." | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model.fields,help:pos_customer_required_fields.field_pos_config__res_partner_required_fields_ids | ||
#: model:ir.model.fields,help:pos_customer_required_fields.field_res_config_settings__pos_res_partner_required_fields_ids | ||
msgid "" | ||
"List of fields that are required while creating or updating a res partner " | ||
"from the point of sale." | ||
msgstr "" | ||
"Champs obligatoire lors de la création/modification d'un contact depuis le " | ||
"point de vente (choisir uniquement parmis les champs disponible dans " | ||
"l'interface)." | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model.fields,field_description:pos_customer_required_fields.field_pos_config__res_partner_required_fields_ids | ||
#: model:ir.model.fields,field_description:pos_customer_required_fields.field_res_config_settings__pos_res_partner_required_fields_ids | ||
#: model_terms:ir.ui.view,arch_db:pos_customer_required_fields.pos_config_view_form | ||
msgid "Partner required fields" | ||
msgstr "Contact (client): champs requis" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model.fields,field_description:pos_customer_required_fields.field_pos_config__res_partner_required_fields_names | ||
#: model:ir.model.fields,field_description:pos_customer_required_fields.field_res_config_settings__pos_res_partner_required_fields_names | ||
msgid "Partner required fields names" | ||
msgstr "Nom technique des champs requis" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model,name:pos_customer_required_fields.model_pos_config | ||
msgid "Point of Sale Configuration" | ||
msgstr "Paramétrage du point de vente" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model.fields,help:pos_customer_required_fields.field_pos_config__res_partner_required_fields_names | ||
#: model:ir.model.fields,help:pos_customer_required_fields.field_res_config_settings__pos_res_partner_required_fields_names | ||
msgid "Technical fields to avoid adding ir.model.fields in pos model" | ||
msgstr "Champ technique utilisé dans l'interface du point de vente" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model_terms:ir.ui.view,arch_db:pos_customer_required_fields.pos_config_view_form | ||
msgid "" | ||
"This ensure following fields are set in partner while\n" | ||
" creating from the pos order.\n" | ||
"\n" | ||
" Also if user pick an existing partner created in the\n" | ||
" backend without that field, user will be prompt to\n" | ||
" add that information." | ||
msgstr "" | ||
"Permet de verifier que l'ensemble des champs suivant sont définis sur les " | ||
"clients des commandes de point de vente ainsi qu'à l'édition ou création des" | ||
" clients depuis le point de vente." |
75 changes: 75 additions & 0 deletions
75
pos_customer_required_fields/i18n/pos_customer_required_fields.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * pos_customer_required_fields | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-10-09 09:24+0000\n" | ||
"PO-Revision-Date: 2024-10-09 09:24+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model,name:pos_customer_required_fields.model_res_config_settings | ||
msgid "Config Settings" | ||
msgstr "" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model,name:pos_customer_required_fields.model_res_partner | ||
msgid "Contact" | ||
msgstr "" | ||
|
||
#. module: pos_customer_required_fields | ||
#. odoo-python | ||
#: code:addons/pos_customer_required_fields/models/res_partner.py:0 | ||
#, python-format | ||
msgid "Following required field(s) is/are not set: %s." | ||
msgstr "" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model.fields,help:pos_customer_required_fields.field_pos_config__res_partner_required_fields_ids | ||
#: model:ir.model.fields,help:pos_customer_required_fields.field_res_config_settings__pos_res_partner_required_fields_ids | ||
msgid "" | ||
"List of fields that are required while creating or updating a res partner " | ||
"from the point of sale." | ||
msgstr "" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model.fields,field_description:pos_customer_required_fields.field_pos_config__res_partner_required_fields_ids | ||
#: model:ir.model.fields,field_description:pos_customer_required_fields.field_res_config_settings__pos_res_partner_required_fields_ids | ||
msgid "Partner required fields" | ||
msgstr "" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model.fields,field_description:pos_customer_required_fields.field_pos_config__res_partner_required_fields_names | ||
#: model:ir.model.fields,field_description:pos_customer_required_fields.field_res_config_settings__pos_res_partner_required_fields_names | ||
msgid "Partner required fields names" | ||
msgstr "" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model,name:pos_customer_required_fields.model_pos_config | ||
msgid "Point of Sale Configuration" | ||
msgstr "" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model:ir.model.fields,help:pos_customer_required_fields.field_pos_config__res_partner_required_fields_names | ||
#: model:ir.model.fields,help:pos_customer_required_fields.field_res_config_settings__pos_res_partner_required_fields_names | ||
msgid "Technical fields to avoid adding ir.model.fields in pos model" | ||
msgstr "" | ||
|
||
#. module: pos_customer_required_fields | ||
#: model_terms:ir.ui.view,arch_db:pos_customer_required_fields.pos_config_view_form | ||
msgid "" | ||
"This ensure following fields are set in partner while\n" | ||
" creating from the pos order.\n" | ||
"\n" | ||
" Also if user pick an existing partner created in the\n" | ||
" backend without that field, user will be prompt to\n" | ||
" add that information." | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from . import res_config_settings | ||
from . import pos_config | ||
from . import res_partner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2022 Moka Tourisme (https://www.mokatourisme.fr). | ||
# @author Pierre Verkest <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
from odoo import api, fields, models | ||
|
||
|
||
class PosConfig(models.Model): | ||
_inherit = "pos.config" | ||
|
||
res_partner_required_fields_ids = fields.Many2many( | ||
"ir.model.fields", | ||
string="Partner required fields", | ||
domain=[("model", "=", "res.partner")], | ||
help=( | ||
"List of fields that are required while creating " | ||
"or updating a res partner from the point of sale." | ||
), | ||
) | ||
res_partner_required_fields_names = fields.Char( | ||
string="Partner required fields names", | ||
compute="_compute_res_partner_required_fields_names", | ||
help="Technical fields to avoid adding ir.model.fields in pos model", | ||
) | ||
|
||
@api.depends("res_partner_required_fields_ids") | ||
def _compute_res_partner_required_fields_names(self): | ||
for config in self: | ||
config.res_partner_required_fields_names = ",".join( | ||
config.res_partner_required_fields_ids.mapped("name") | ||
) |
19 changes: 19 additions & 0 deletions
19
pos_customer_required_fields/models/res_config_settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2022 Moka Tourisme (https://www.mokatourisme.fr). | ||
# @author Pierre Verkest <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
pos_res_partner_required_fields_ids = fields.Many2many( | ||
related="pos_config_id.res_partner_required_fields_ids", | ||
string="Partner required fields", | ||
readonly=False, | ||
) | ||
pos_res_partner_required_fields_names = fields.Char( | ||
related="pos_config_id.res_partner_required_fields_names", | ||
string="Partner required fields names", | ||
readonly=False, | ||
) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This links are broken,
Beside that I tested the module and it work as expected !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @b0g for the review and the feedback. I’ll fix the broken links.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose the broken link is normal until the branch is not merged!