1
0
forked from erp-dev/erp

feat: stock module

This commit is contained in:
2025-11-04 18:04:27 +08:00
parent 9fde654e2f
commit d88bf367f8
27 changed files with 2238 additions and 561 deletions

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.2.7 on 2025-11-04 02:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('basic_info', '0015_remove_product_single_price_product_single_price_in_and_more'),
]
operations = [
migrations.AddField(
model_name='product',
name='unit',
field=models.IntegerField(choices=[(1, ''), (2, ''), (3, '公斤')], default=1, verbose_name='单位'),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.2.7 on 2025-11-04 05:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('basic_info', '0016_product_unit'),
]
operations = [
migrations.AddField(
model_name='product',
name='image',
field=models.ImageField(blank=True, null=True, upload_to='product_images/', verbose_name='产品图片'),
),
]

View File

@@ -117,8 +117,19 @@ class Product(ModelBase):
blank=True,
null=True,
)
unit = models.IntegerField(
choices=ProductUnitEnum.choices,
default=ProductUnitEnum.METER,
verbose_name='单位',
)
spec = models.CharField(max_length=100, blank=True, null=True, verbose_name='规格')
description = models.TextField(blank=True, null=True, verbose_name='备注描述')
image = models.ImageField(
upload_to='product_images/',
blank=True,
null=True,
verbose_name='产品图片',
)
transform_rate = models.DecimalField(
max_digits=10,
decimal_places=4,