diff --git a/configuration.py b/configuration.py
index 57834d8584..2b54f4acf6 100644
--- a/configuration.py
+++ b/configuration.py
@@ -5,10 +5,11 @@ from trytond.model import ModelView, ModelSQL, ModelSingleton, fields
from trytond.model import MultiValueMixin, ValueMixin
from trytond.pool import Pool
from trytond.tools.multivalue import migrate_property
+from trytond.pyson import Id
party_sequence = fields.Many2One('ir.sequence', 'Party Sequence',
domain=[
- ('code', '=', 'party.party'),
+ ('sequence_type', '=', Id('party', 'sequence_type_party')),
],
help="Used to generate the party code.")
party_lang = fields.Many2One("ir.lang", 'Party Language',
diff --git a/party.py b/party.py
index c4cc40afe4..c05e8b71af 100644
--- a/party.py
+++ b/party.py
@@ -172,12 +172,11 @@ class Party(DeactivableMixin, ModelSQL, ModelView, MultiValueMixin):
@classmethod
def _new_code(cls, **pattern):
pool = Pool()
- Sequence = pool.get('ir.sequence')
Configuration = pool.get('party.configuration')
config = Configuration(1)
sequence = config.get_multivalue('party_sequence', **pattern)
if sequence:
- return Sequence.get_id(sequence.id)
+ return sequence.get()
@classmethod
def create(cls, vlist):
diff --git a/party.xml b/party.xml
index 585a6e74d3..0541342bfe 100644
--- a/party.xml
+++ b/party.xml
@@ -92,7 +92,6 @@ this repository contains the full copyright notices and license terms. -->
Party
- party.party
@@ -107,7 +106,7 @@ this repository contains the full copyright notices and license terms. -->
Party
- party.party
+