Skip to content

Commit

Permalink
Merge pull request #2452 from ruohola/fix-order-line-too-short-sku
Browse files Browse the repository at this point in the history
Core: Make `OrderLine.sku` `max_length` match that of `Product.sku`
  • Loading branch information
ruohola committed Mar 31, 2021
2 parents aa573df + 1a518de commit 7bb8055
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,10 @@ List all changes after the last release here (newer on top). Each change on a se

- Admin: change so TaxClassEditView is a FormPartView

### Fixed

- Core: Fix error that occurred when creating an order with a product which SKU was longer than 48 characters.

## [2.6.0] - 2021-03-29

### Changed
Expand Down
18 changes: 18 additions & 0 deletions shuup/core/migrations/0085_longer_order_line_sku.py
@@ -0,0 +1,18 @@
# Generated by Django 2.2.17 on 2021-03-31 08:49

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('shuup', '0084_tracking_url'),
]

operations = [
migrations.AlterField(
model_name='orderline',
name='sku',
field=models.CharField(blank=True, max_length=128, verbose_name='line SKU'),
),
]
2 changes: 1 addition & 1 deletion shuup/core/models/_order_lines.py
Expand Up @@ -96,7 +96,7 @@ class AbstractOrderLine(MoneyPropped, models.Model, Priceful):
)
ordering = models.IntegerField(default=0, verbose_name=_("ordering"))
type = EnumIntegerField(OrderLineType, default=OrderLineType.PRODUCT, verbose_name=_("line type"))
sku = models.CharField(max_length=48, blank=True, verbose_name=_("line SKU"))
sku = models.CharField(max_length=128, blank=True, verbose_name=_("line SKU"))
text = models.CharField(max_length=256, verbose_name=_("line text"))
accounting_identifier = models.CharField(max_length=32, blank=True, verbose_name=_("accounting identifier"))
require_verification = models.BooleanField(default=False, verbose_name=_("require verification"))
Expand Down

0 comments on commit 7bb8055

Please sign in to comment.