forked from OCA/partner-contact
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] partner_identification: Add context override (OCA#373)
Allow for context override of validations using ``id_no_validate``
- Loading branch information
1 parent
86a1b20
commit 76c2e7b
Showing
4 changed files
with
31 additions
and
3 deletions.
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 |
---|---|---|
|
@@ -35,8 +35,15 @@ Name: | |
Code: | ||
Code, abbreviation or acronym of this ID type. For example, 'driver_license' | ||
Python validation code: | ||
Optional python code called to validate ID numbers of this ID type. | ||
Optional python code called to validate ID numbers of this ID type. This functionality can be | ||
overridden by setting ``id_no_validate`` to ``True`` in the context, such as: | ||
|
||
.. code-block:: python | ||
partner.with_context(id_no_validate=True).write({ | ||
'name': 'Bad Value', | ||
'category_id': self.env.ref('id_category_only_numerics').id, | ||
}) | ||
Usage | ||
===== | ||
|
@@ -97,6 +104,7 @@ Contributors | |
* Gerhard Könighofer <[email protected]> | ||
* Laurent Mignon <[email protected]> | ||
* Jairo Llopis <[email protected]> | ||
* Dave Lasley <[email protected]> | ||
|
||
Maintainer | ||
---------- | ||
|
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
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
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