forked from erp-dev/erp
feat: tasks for sync products and customers
This commit is contained in:
@@ -60,7 +60,7 @@ class UserProfileAdmin(AdminBase):
|
||||
|
||||
@admin.register(models.Merchant)
|
||||
class MerchantAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'type', 'email', 'mobile', 'auto_complete_stock_change')
|
||||
list_display = ('id', 'name', 'type', 'email', 'mobile', 'auto_complete_stock_change')
|
||||
search_fields = ('name', 'mobile')
|
||||
list_filter = ('type', 'auto_complete_stock_change')
|
||||
|
||||
|
||||
20
basic_info/migrations/0018_product_from_mdy.py
Normal file
20
basic_info/migrations/0018_product_from_mdy.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('basic_info', '0017_alter_customer_mobile'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='product',
|
||||
name='from_mdy',
|
||||
field=models.BooleanField(
|
||||
default=False,
|
||||
help_text='标记该产品是否通过明道云接口同步',
|
||||
verbose_name='是否来自明道云同步',
|
||||
),
|
||||
),
|
||||
]
|
||||
21
basic_info/migrations/0019_customer_mdy_fields.py
Normal file
21
basic_info/migrations/0019_customer_mdy_fields.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('basic_info', '0018_product_from_mdy'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='customer',
|
||||
name='mdy_uid',
|
||||
field=models.CharField(blank=True, help_text='对应明道云记录的唯一标识', max_length=100, null=True, unique=True, verbose_name='明道云UID'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='customer',
|
||||
name='from_mdy',
|
||||
field=models.BooleanField(default=False, help_text='标记该客户是否通过明道云接口同步', verbose_name='是否来自明道云同步'),
|
||||
),
|
||||
]
|
||||
@@ -261,6 +261,11 @@ class Product(ModelBase):
|
||||
null=True,
|
||||
verbose_name='公斤转换率',
|
||||
)
|
||||
from_mdy = models.BooleanField(
|
||||
default=False,
|
||||
verbose_name='是否来自明道云同步',
|
||||
help_text='标记该产品是否通过明道云接口同步',
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
@@ -318,6 +323,19 @@ class Customer(ModelBase):
|
||||
email = models.EmailField(blank=True, null=True, verbose_name='电子邮箱')
|
||||
contact = models.CharField(blank=True, null=True, verbose_name='联系人')
|
||||
description = models.TextField(blank=True, null=True, verbose_name='备注描述')
|
||||
mdy_uid = models.CharField(
|
||||
max_length=100,
|
||||
unique=True,
|
||||
null=True,
|
||||
blank=True,
|
||||
verbose_name='明道云UID',
|
||||
help_text='对应明道云记录的唯一标识',
|
||||
)
|
||||
from_mdy = models.BooleanField(
|
||||
default=False,
|
||||
verbose_name='是否来自明道云同步',
|
||||
help_text='标记该客户是否通过明道云接口同步',
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
Reference in New Issue
Block a user