update patches

This commit is contained in:
?ngel ?lvarez 2013-10-23 17:37:16 +02:00
parent 4ee936bd47
commit 45dbe73635
3 changed files with 88 additions and 4 deletions

55
issue1201002_1.diff Normal file
View File

@ -0,0 +1,55 @@
Index: trytond/model/model.py
===================================================================
--- a/trytond/trytond/model/model.py
+++ b/trytond/trytond/model/model.py
@@ -318,6 +318,14 @@
and hasattr(cls._fields[field], 'field'):
res[field]['relation_field'] = copy.copy(
cls._fields[field].field)
+ if res[field]['type'] == 'many2one':
+ target = cls._fields[field].get_target()
+ for target_name, target_field in target._fields.iteritems():
+ if (target_field._type == 'one2many'
+ and target_field.model_name == cls.__name__
+ and target_field.field == field):
+ res[field]['relation_field'] = target_name
+ break
if res[field]['type'] in ('datetime', 'time'):
res[field]['format'] = copy.copy(cls._fields[field].format)
if res[field]['type'] == 'selection':
Index: trytond/modules/party/party.py
===================================================================
--- a/trytond/trytond/modules/party/party.py
+++ b/trytond/trytond/modules/party/party.py
@@ -162,6 +162,7 @@
config = Configuration(1)
values['code'] = Sequence.get_id(config.party_sequence.id)
values['code_length'] = len(values['code'])
+ values.setdefault('addresses', None)
return super(Party, cls).create(vlist)
@classmethod
Index: trytond/modules/product/product.py
===================================================================
--- a/trytond/trytond/modules/product/product.py
+++ b/trytond/trytond/modules/product/product.py
@@ -112,6 +112,13 @@
def search_default_uom_category(cls, name, clause):
return [('default_uom.category',) + tuple(clause[1:])]
+ @classmethod
+ def create(cls, vlist):
+ vlist = [v.copy() for v in vlist]
+ for values in vlist:
+ values.setdefault('products', None)
+ return super(Template, cls).create(vlist)
+
class Product(ModelSQL, ModelView):
"Product Variant"

31
issue1211002_1.diff Normal file
View File

@ -0,0 +1,31 @@
Index: tryton/gui/window/view_form/model/record.py
===================================================================
--- a/tryton/tryton/gui/window/view_form/model/record.py
+++ b/tryton/tryton/gui/window/view_form/model/record.py
@@ -415,6 +415,8 @@
for fieldname, value in val.items():
if fieldname not in self.group.fields:
continue
+ if fieldname == self.group.exclude_field:
+ continue
if isinstance(self.group.fields[fieldname], (fields.M2OField,
fields.ReferenceField)):
field_rec_name = fieldname + '.rec_name'
Index: tryton/gui/window/view_form/view/form_gtk/many2one.py
===================================================================
--- a/tryton/tryton/gui/window/view_form/view/form_gtk/many2one.py
+++ b/tryton/tryton/gui/window/view_form/view/form_gtk/many2one.py
@@ -195,7 +195,8 @@
context = self.field.context_get(self.record)
return Screen(self.get_model(), domain=domain, context=context,
mode=['form'], view_ids=self.attrs.get('view_ids', '').split(','),
- views_preload=self.attrs.get('views', {}), readonly=self._readonly)
+ views_preload=self.attrs.get('views', {}), readonly=self._readonly,
+ exclude_field=self.attrs.get('relation_field'))
def sig_new(self, *args):
model = self.get_model()

6
series
View File

@ -1,5 +1,3 @@
issue1211002_1.diff
issue1201002_1.diff
issue67_214.diff
issue001_party_event_python_sql
sale_discount.partch
stock_valued.diff
stock_valued_discount.patch