mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
Avoid UnicodeEncodeError. (#544)
* Fix wrong README format. * [FIX][base_import_match] Avoid UnicodeEncodeError. When the model or field you chose was translated and had some non-ascii character, you got an error like this: `UnicodeEncodeError: 'ascii' codec can't encode character u'\xed' in position 15: ordinal not in range(128)`. Now, using unicode strings, that won't happen again. * Do not require a hidden field. * Further unicode protection, add ondelete clause.
This commit is contained in:
@@ -29,18 +29,18 @@ After installing this module, the import logic will be changed to:
|
||||
- Discard the rules that require fields you are not importing.
|
||||
- Traverse the remaining rules one by one in order to find a match in the database.
|
||||
|
||||
- Skip the rule if it requires a special condition that is not
|
||||
satisfied.
|
||||
- If one match is found:
|
||||
- Skip the rule if it requires a special condition that is not
|
||||
satisfied.
|
||||
- If one match is found:
|
||||
|
||||
- Stop traversing the rest of valid rules.
|
||||
- **Update** that record.
|
||||
- If zero or multiple matches are found:
|
||||
- Stop traversing the rest of valid rules.
|
||||
- **Update** that record.
|
||||
- If zero or multiple matches are found:
|
||||
|
||||
- Continue with the next rule.
|
||||
- If all rules are exhausted and no single match is found:
|
||||
- Continue with the next rule.
|
||||
- If all rules are exhausted and no single match is found:
|
||||
|
||||
- **Create** a new record.
|
||||
- **Create** a new record.
|
||||
- If there are no match rules for your model:
|
||||
|
||||
- **Create** a new record.
|
||||
|
||||
Reference in New Issue
Block a user