Migrate to 6.0

This commit is contained in:
Sergio Morillo 2021-09-21 10:20:04 +02:00
parent d2bd2b3598
commit 3f71b4f9f3
3 changed files with 29 additions and 17 deletions

View File

@ -54,8 +54,8 @@ requires += []
tests_require = [
get_require_version('proteus'),
]
get_require_version('trytond_product_attribute')
]
series = '%s.%s' % (major_version, minor_version)
if minor_version % 2:
@ -113,4 +113,4 @@ setup(name='%s_%s' % (PREFIX, MODULE),
test_loader='trytond.test_loader:Loader',
tests_require=tests_require,
)
)

View File

@ -12,7 +12,7 @@ Imports::
Install stock_supply Module::
>>> config = activate_modules(['mass_editing', 'product_template_attribute'])
>>> config = activate_modules(['mass_editing', 'product_attribute'])
Create today::
@ -34,6 +34,12 @@ Create product attribute::
>>> product_attribute2.type_ = 'date'
>>> product_attribute2.save()
>>> ProductAttributeSet = Model.get('product.attribute.set')
>>> attribute_set = ProductAttributeSet()
>>> attribute_set.name = 'Set of attributes'
>>> attribute_set.attributes.extend([product_attribute, product_attribute2])
>>> attribute_set.save()
Create product::
>>> Template = Model.get('product.template')
@ -45,20 +51,26 @@ Create product::
>>> template.default_uom = unit
>>> template.type = 'goods'
>>> template.list_price = Decimal('10.0')
>>> template.template_attributes = {
>>> template.attribute_set = attribute_set
>>> template.save()
>>> product, = template.products
>>> product.attributes = {
... product_attribute.name: Decimal('5.0'),
... product_attribute2.name: today}
>>> template.save()
>>> product.save()
>>> template2 = Template()
>>> template2.name = 'Product 2'
>>> template2.default_uom = unit
>>> template2.type = 'goods'
>>> template2.list_price = Decimal('10.0')
>>> template2.template_attributes = {
>>> template2.attribute_set = attribute_set
>>> template2.save()
>>> product2, = template2.products
>>> product2.attributes = {
... product_attribute.name: Decimal('5.0'),
... product_attribute2.name: today}
>>> template2.save()
>>> product2.save()
Create mass editing::
@ -66,22 +78,22 @@ Create mass editing::
>>> ModelField = Model.get('ir.model.field')
>>> IrModel = Model.get('ir.model')
>>> model_template, = IrModel.find([
... ('model', '=', 'product.template')])
>>> model_product, = IrModel.find([
... ('model', '=', 'product.product')])
>>> field_attributes, = ModelField.find([
... ('module', '=', 'product_template_attribute'),
... ('model', '=', model_template),
... ('name', '=', 'template_attributes')])
... ('module', '=', 'product_attribute'),
... ('model', '=', model_product),
... ('name', '=', 'attributes')])
>>> mass_editing = MassEditing()
>>> mass_editing.model = model_template
>>> mass_editing.model = model_product
>>> mass_editing.model_fields.append(field_attributes)
>>> mass_editing.save()
>>> mass_editing.click('create_keyword')
wizard mass edigin::
>>> with config.set_context(active_model='product.template'):
... wizard = Wizard('mass.editing.wizard', [template, template2],
>>> with config.set_context(active_model='product.product'):
... wizard = Wizard('mass.editing.wizard', [product, product2],
... action={'id': mass_editing.keyword.action.id})

View File

@ -1,5 +1,5 @@
[tryton]
version=5.7.0
version=6.0.0
depends:
ir
res