conv_bal
watcha.h@almacom.co.th 2015-03-25 17:26:18 +07:00
parent 24e9811f9d
commit 68cffef58b
4 changed files with 6 additions and 2 deletions

View File

@ -17,8 +17,10 @@ class Settings(Model):
branch_id=context['branch_id']
else:
user=get_model("base.user").browse(user_id)
if user.department_id:
branch_id=user.department_id.branch_id.id
elif user.branch_id:
branch_id=user.branch_id.id
print("branch_id ", branch_id, 'user_id ', user_id)
vals={}
for obj in self.browse(ids):
vals[obj.id]=obj.addresses and obj.addresses[0].id or None

View File

@ -1109,6 +1109,7 @@ class HDCase(Model):
'add_address2': add.address2 or '',
'add_province_name': add.province_id.name or '',
'add_district_name': add.district_id.name or '',
'add_subdistrict_name': add.subdistrict_id.name or '',
'add_city': add.city or '',
'add_postal_code': add.postal_code or '',
'add_phone': add.phone or '',

View File

@ -556,6 +556,7 @@ class Shop(Model):
'add_address2': add.address2 or '',
'add_province_name': add.province_id.name or '',
'add_district_name': add.district_id.name or '',
'add_subdistrict_name': add.subdistrict_id.name or '',
'add_city': add.city or '',
'add_postal_code': add.postal_code or '',
'add_phone': add.phone or '',