Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
董杰
/
my_addons
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 018e0b7f
由
董杰
编写于
2021-08-03 10:06:13 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
erp项目最近修改
1 个父辈
e9244759
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
25 个修改的文件
包含
200 行增加
和
77 行删除
acct_account/views/acc_account_asset_view.xml
acct_base/models/acc_partner.py
acct_base/models/acc_tools.py
acct_base/views/acc_product_view.xml
acct_purchase/models/acc_mrp_bom.py
acct_purchase/models/acc_purchase.py
acct_purchase/models/before_purchase.py
acct_purchase/views/acc_purchase_report_view.xml
acct_purchase/views/acc_purchase_view.xml
acct_sale/models/acc_crm_lead.py
acct_sale/models/acc_sale.py
acct_sale/report/acc_quotation_report_view.xml
acct_sale/report/acc_quotation_report_view1.xml
acct_sale/report/acc_quotation_report_view2.xml
acct_sale/report/acc_quotation_report_view3.xml
acct_sale/report/accall_quotation_report_view.xml
acct_sale/report/accen_quotation_report_view.xml
acct_sale/views/acc_crm_lead_view.xml
acct_sale/views/acc_sale_view.xml
acct_stock/models/acc_stock_move.py
acct_stock/report/accstock_report_views.xml
acct_stock/views/acc_stock_move_view.xml
acct_stock/views/excipients_product_view.xml
acct_stock/wizard/__init__.py
acct_stock/wizard/choose_move.py
acct_account/views/acc_account_asset_view.xml
查看文件 @
018e0b7
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<field
name=
"asset_sequence"
/>
<field
name=
"asset_sequence"
/>
<field
name=
"acc_asset_code"
/>
<field
name=
"acc_asset_code"
/>
<field
name=
"user_id"
/>
<field
name=
"user_id"
/>
<
!-- <field name="acc_type"/> --
>
<
field
name=
"acc_type"
/
>
<!-- <field name="minus_amount"/>
<!-- <field name="minus_amount"/>
<field name="invoice_acc_total"/>
<field name="invoice_acc_total"/>
<field name="invoice_state"/> -->
<field name="invoice_state"/> -->
...
...
acct_base/models/acc_partner.py
查看文件 @
018e0b7
...
@@ -26,6 +26,7 @@ class res_partner_acc(models.Model):
...
@@ -26,6 +26,7 @@ class res_partner_acc(models.Model):
quality_level
=
fields
.
Selection
([(
'0'
,
'一般'
),
(
'1'
,
'低'
),
(
'2'
,
'高'
),
(
'3'
,
'非常高'
)],
'质量评级'
,
default
=
'0'
)
quality_level
=
fields
.
Selection
([(
'0'
,
'一般'
),
(
'1'
,
'低'
),
(
'2'
,
'高'
),
(
'3'
,
'非常高'
)],
'质量评级'
,
default
=
'0'
)
price_level
=
fields
.
Selection
([(
'0'
,
'一般'
),
(
'1'
,
'低'
),
(
'2'
,
'高'
),
(
'3'
,
'非常高'
)],
'价格评级'
,
default
=
'0'
)
price_level
=
fields
.
Selection
([(
'0'
,
'一般'
),
(
'1'
,
'低'
),
(
'2'
,
'高'
),
(
'3'
,
'非常高'
)],
'价格评级'
,
default
=
'0'
)
acc_image
=
fields
.
Binary
(
"营业执照"
,
attachment
=
True
)
acc_image
=
fields
.
Binary
(
"营业执照"
,
attachment
=
True
)
customer_type
=
fields
.
Selection
([(
'jinxiao'
,
'经销商'
),
(
'daili'
,
'代理商'
),
(
'zuizhong'
,
'最终用户'
)],
'类型'
,
default
=
'jinxiao'
)
# @api.model
# @api.model
# def create(self,vals):
# def create(self,vals):
...
...
acct_base/models/acc_tools.py
查看文件 @
018e0b7
...
@@ -33,13 +33,14 @@ class AccTools(models.Model):
...
@@ -33,13 +33,14 @@ class AccTools(models.Model):
@smtpaddr:smtp服务地址,可以在邮箱看,比如163邮箱为smtp.163.com
@smtpaddr:smtp服务地址,可以在邮箱看,比如163邮箱为smtp.163.com
@password:发信人的邮箱密码
@password:发信人的邮箱密码
'''
'''
fromaddr
=
"notreply@acctronics.cn"
# fromaddr = "notreply@acctronics.cn"
fromaddr
=
"notreply@neotel.tech"
smtpaddr
=
"smtp.exmail.qq.com"
smtpaddr
=
"smtp.exmail.qq.com"
# toaddrs = ['jie.dong@acctronics.cn']
# toaddrs = ['jie.dong@acctronics.cn']
toaddrs
=
toaddrs
toaddrs
=
toaddrs
# subject = "最新消息"
# subject = "最新消息"
subject
=
subjects
subject
=
subjects
password
=
"Acc@0
707
"
password
=
"Acc@0
113
"
# msg = "测试"
# msg = "测试"
msg
=
message
msg
=
message
mail_msg
=
MIMEMultipart
()
mail_msg
=
MIMEMultipart
()
...
@@ -58,8 +59,8 @@ class AccTools(models.Model):
...
@@ -58,8 +59,8 @@ class AccTools(models.Model):
s
.
quit
()
s
.
quit
()
_logger
.
info
(
"邮件发送成功"
)
_logger
.
info
(
"邮件发送成功"
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
"Error: unable to send email"
)
#
print ("Error: unable to send email")
_logger
.
info
(
"邮件发送失败
"
)
_logger
.
info
(
"邮件发送失败
,错误信息:{}"
.
format
(
e
)
)
def
get_users
(
self
,
group_name
):
def
get_users
(
self
,
group_name
):
commerce_group
=
self
.
env
[
'res.groups'
]
.
search
([(
'name'
,
'='
,
group_name
)])
commerce_group
=
self
.
env
[
'res.groups'
]
.
search
([(
'name'
,
'='
,
group_name
)])
...
...
acct_base/views/acc_product_view.xml
查看文件 @
018e0b7
...
@@ -149,6 +149,7 @@
...
@@ -149,6 +149,7 @@
<field
name=
"inherit_id"
ref=
"base.view_partner_form"
/>
<field
name=
"inherit_id"
ref=
"base.view_partner_form"
/>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//field[@name='lang']"
position=
"after"
>
<xpath
expr=
"//field[@name='lang']"
position=
"after"
>
<field
name=
"customer_type"
/>
<field
name=
"charge_person"
/>
<field
name=
"charge_person"
/>
<field
name=
"traffic_level"
widget=
"priority"
/>
<field
name=
"traffic_level"
widget=
"priority"
/>
<field
name=
"quality_level"
widget=
"priority"
/>
<field
name=
"quality_level"
widget=
"priority"
/>
...
...
acct_purchase/models/acc_mrp_bom.py
查看文件 @
018e0b7
...
@@ -51,7 +51,7 @@ class AccMrpBom(models.Model):
...
@@ -51,7 +51,7 @@ class AccMrpBom(models.Model):
# group_name = '商务部员工'
# group_name = '商务部员工'
# create_user_id = self._uid
# create_user_id = self._uid
# luna.zhang@neotel-technology.com
# luna.zhang@neotel-technology.com
toaddrs
=
[
'
coco.ma@neotel-technology.com
'
,
'jie.dong@neotel-technology.com'
,
'yi.wang@neotel-technology.com'
,
'cissy.shen@neotel-technology.com'
]
toaddrs
=
[
'
xue.zhang@neotel.tech
'
,
'jie.dong@neotel-technology.com'
,
'yi.wang@neotel-technology.com'
,
'cissy.shen@neotel-technology.com'
]
# toaddrs = ['jie.dong@neotel-technology.com']
# toaddrs = ['jie.dong@neotel-technology.com']
subjects
=
"物料清单{}{}已创建"
.
format
(
res
.
product_tmpl_id
.
name
,
res
.
code
)
subjects
=
"物料清单{}{}已创建"
.
format
(
res
.
product_tmpl_id
.
name
,
res
.
code
)
message
=
"物料清单{}{}已创建请及时查看"
.
format
(
res
.
product_tmpl_id
.
name
,
res
.
code
)
message
=
"物料清单{}{}已创建请及时查看"
.
format
(
res
.
product_tmpl_id
.
name
,
res
.
code
)
...
...
acct_purchase/models/acc_purchase.py
查看文件 @
018e0b7
...
@@ -169,6 +169,7 @@ class CFTemplateCategory(models.Model):
...
@@ -169,6 +169,7 @@ class CFTemplateCategory(models.Model):
# toaddrs = []
# toaddrs = []
# toaddrs.append(self.manage_user.login)
# toaddrs.append(self.manage_user.login)
toaddrs
=
[
'cissy.shen@neotel-technology.com'
]
toaddrs
=
[
'cissy.shen@neotel-technology.com'
]
# toaddrs = ['fiona.wu@neotel-technology.com']
# toaddrs = ['jie.dong@acctronics.cn']
# toaddrs = ['jie.dong@acctronics.cn']
subjects
=
"采购单{}需要您审批,请及时处理"
.
format
(
self
.
name
)
subjects
=
"采购单{}需要您审批,请及时处理"
.
format
(
self
.
name
)
message
=
"采购单{}<br><br>标题:{}<br><br>供应商:{}<br><br>支付条款:{}<br><br>总价:{}<br><br><br>需要您审批,请及时处理<br><br><br>谢谢"
.
format
(
self
.
name
,
self
.
title
,
self
.
partner_id
.
name
,
self
.
payment_rule
,
self
.
amount_total
)
message
=
"采购单{}<br><br>标题:{}<br><br>供应商:{}<br><br>支付条款:{}<br><br>总价:{}<br><br><br>需要您审批,请及时处理<br><br><br>谢谢"
.
format
(
self
.
name
,
self
.
title
,
self
.
partner_id
.
name
,
self
.
payment_rule
,
self
.
amount_total
)
...
@@ -377,19 +378,17 @@ class CFTemplateCategory(models.Model):
...
@@ -377,19 +378,17 @@ class CFTemplateCategory(models.Model):
@api.multi
@api.multi
def
write
(
self
,
vals
):
def
write
(
self
,
vals
):
# if self.purchase_type == 'office':
# self.check_office_price(vals)
if
vals
.
get
(
'minus_amount'
):
if
vals
.
get
(
'minus_amount'
):
amount
=
self
.
amount_untaxed
+
self
.
amount_tax
-
vals
.
get
(
'minus_amount'
,
0
)
amount
=
self
.
amount_untaxed
+
self
.
amount_tax
-
vals
.
get
(
'minus_amount'
,
0
)
vals
.
update
({
vals
.
update
({
"amount_total"
:
amount
"amount_total"
:
amount
})
})
if
vals
.
get
(
'discount_rate'
):
#
if vals.get('discount_rate'):
rate_amount
=
self
.
amount_untaxed
*
vals
.
get
(
'discount_rate'
)
/
100
#
rate_amount = self.amount_untaxed * vals.get('discount_rate')/100
amount
=
self
.
amount_untaxed
+
self
.
amount_tax
-
rate_amount
#
amount = self.amount_untaxed + self.amount_tax - rate_amount
vals
.
update
({
#
vals.update({
"amount_total"
:
amount
#
"amount_total": amount
})
#
})
res
=
super
(
CFTemplateCategory
,
self
)
.
write
(
vals
)
res
=
super
(
CFTemplateCategory
,
self
)
.
write
(
vals
)
return
res
return
res
...
@@ -593,6 +592,18 @@ class CFTemplateCategory(models.Model):
...
@@ -593,6 +592,18 @@ class CFTemplateCategory(models.Model):
sheet
.
write
(
n
,
j
,
body
[
i
][
j
])
sheet
.
write
(
n
,
j
,
body
[
i
][
j
])
wbk
.
save
(
file_name
)
##该文件名必须存在
wbk
.
save
(
file_name
)
##该文件名必须存在
@api.multi
def
check_before_qty
(
self
):
for
line
in
self
.
order_line
:
b_line
=
self
.
env
[
'before.purchase.line'
]
.
search
([(
'order_id'
,
'='
,
self
.
before_purchase_id
.
id
),(
'product_id'
,
'='
,
line
.
product_id
.
id
)])
if
len
(
b_line
)
==
1
:
b_qty
=
b_line
.
qty
line
.
update
({
'product_qty'
:
b_qty
})
else
:
raise
ValidationError
(
u'待确认询价单明细行该编码产品“{}”不存在或存在多条该编码明细行'
.
format
(
line
.
acc_code
))
return
True
def
export_record
(
self
,
file_name
):
def
export_record
(
self
,
file_name
):
"""
"""
导出采购单信息
导出采购单信息
...
@@ -616,6 +627,8 @@ class CFTemplateCategory(models.Model):
...
@@ -616,6 +627,8 @@ class CFTemplateCategory(models.Model):
pt.acc_code AS acc_code,
pt.acc_code AS acc_code,
pt.partner_code AS partner_code,
pt.partner_code AS partner_code,
pt.product_model AS product_model,
pt.product_model AS product_model,
pt.acc_purchase_price AS price,
pt.product_describe_cn AS describe,
pol.product_qty AS qty,
pol.product_qty AS qty,
rp. NAME AS supplier,
rp. NAME AS supplier,
pol.forcast_date AS forcast_date
pol.forcast_date AS forcast_date
...
@@ -648,8 +661,10 @@ class CFTemplateCategory(models.Model):
...
@@ -648,8 +661,10 @@ class CFTemplateCategory(models.Model):
detail_list_first
.
append
(
line
.
get
(
'acc_code'
))
detail_list_first
.
append
(
line
.
get
(
'acc_code'
))
detail_list_first
.
append
(
line
.
get
(
'partner_code'
))
detail_list_first
.
append
(
line
.
get
(
'partner_code'
))
detail_list_first
.
append
(
line
.
get
(
'product_model'
))
detail_list_first
.
append
(
line
.
get
(
'product_model'
))
detail_list_first
.
append
(
line
.
get
(
'price'
))
detail_list_first
.
append
(
line
.
get
(
'qty'
))
detail_list_first
.
append
(
line
.
get
(
'qty'
))
detail_list_first
.
append
(
line
.
get
(
'supplier'
))
detail_list_first
.
append
(
line
.
get
(
'supplier'
))
detail_list_first
.
append
(
line
.
get
(
'describe'
))
if
line
.
get
(
'forcast_date'
):
if
line
.
get
(
'forcast_date'
):
detail_list_first
.
append
(
line
.
get
(
'forcast_date'
)
.
strftime
(
"
%
Y-
%
m-
%
d"
))
detail_list_first
.
append
(
line
.
get
(
'forcast_date'
)
.
strftime
(
"
%
Y-
%
m-
%
d"
))
else
:
else
:
...
@@ -657,10 +672,10 @@ class CFTemplateCategory(models.Model):
...
@@ -657,10 +672,10 @@ class CFTemplateCategory(models.Model):
detail_list_all
.
append
(
detail_list_first
)
detail_list_all
.
append
(
detail_list_first
)
dir_path
=
os
.
path
.
join
(
file_url
,
'Administrator'
)
dir_path
=
os
.
path
.
join
(
file_url
,
'Administrator'
)
filename
=
"{}
.xls"
.
format
(
'询价单明细表'
)
filename
=
"{}
明细表.xls"
.
format
(
self
.
name
)
file_path
=
os
.
path
.
join
(
dir_path
,
filename
)
file_path
=
os
.
path
.
join
(
dir_path
,
filename
)
check_path
(
file_path
)
check_path
(
file_path
)
head
=
[
'序号'
,
'负责人'
,
'单号'
,
'标题'
,
'品牌'
,
'产品名称'
,
'产品编码'
,
'供应商编码'
,
'产品型号'
,
'
数量'
,
'供应商
'
,
'预计到货日期'
]
head
=
[
'序号'
,
'负责人'
,
'单号'
,
'标题'
,
'品牌'
,
'产品名称'
,
'产品编码'
,
'供应商编码'
,
'产品型号'
,
'
价格'
,
'数量'
,
'供应商'
,
'中文描述
'
,
'预计到货日期'
]
self
.
save_exel
(
head
,
detail_list_all
,
file_path
)
self
.
save_exel
(
head
,
detail_list_all
,
file_path
)
return
self
.
export_record
(
file_path
)
return
self
.
export_record
(
file_path
)
...
...
acct_purchase/models/before_purchase.py
查看文件 @
018e0b7
...
@@ -199,6 +199,7 @@ class BeforePurchase(models.Model):
...
@@ -199,6 +199,7 @@ class BeforePurchase(models.Model):
# return self.message_post(body=merge_tips, subject=subject)
# return self.message_post(body=merge_tips, subject=subject)
return
True
return
True
class
BeforePurchaseLine
(
models
.
Model
):
class
BeforePurchaseLine
(
models
.
Model
):
_name
=
'before.purchase.line'
_name
=
'before.purchase.line'
_description
=
" 待确认询价单明细"
_description
=
" 待确认询价单明细"
...
...
acct_purchase/views/acc_purchase_report_view.xml
查看文件 @
018e0b7
此文件的差异被折叠,
点击展开。
acct_purchase/views/acc_purchase_view.xml
查看文件 @
018e0b7
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
<button
name=
"%(purchase_separate_wizard)d"
type=
"action"
states=
"purchase"
string=
"分批账单"
class=
"oe_highlight"
groups=
"purchase.group_purchase_user"
/>
<button
name=
"%(purchase_separate_wizard)d"
type=
"action"
states=
"purchase"
string=
"分批账单"
class=
"oe_highlight"
groups=
"purchase.group_purchase_user"
/>
<button
name=
"update_newinfo"
string=
"更新产品信息"
type=
"object"
states=
"draft"
class=
"oe_highlight"
groups=
"base.group_user"
/>
<button
name=
"update_newinfo"
string=
"更新产品信息"
type=
"object"
states=
"draft"
class=
"oe_highlight"
groups=
"base.group_user"
/>
<button
name=
"fresh_merge_line"
string=
"合并重复产品"
type=
"object"
states=
"draft"
class=
"oe_highlight"
groups=
"base.group_user"
/>
<button
name=
"fresh_merge_line"
string=
"合并重复产品"
type=
"object"
states=
"draft"
class=
"oe_highlight"
groups=
"base.group_user"
/>
<button
name=
"check_before_qty"
string=
"数量校对"
type=
"object"
states=
"draft"
class=
"oe_highlight"
groups=
"base.group_user"
/>
<button
name=
"confirm"
string=
"提交审批"
type=
"object"
states=
"draft"
class=
"oe_highlight"
groups=
"base.group_user"
/>
<button
name=
"confirm"
string=
"提交审批"
type=
"object"
states=
"draft"
class=
"oe_highlight"
groups=
"base.group_user"
/>
<button
name=
"pomanager"
string=
"采购经理审批"
type=
"object"
states=
"confirm"
class=
"oe_highlight"
groups=
"acct_base.acc_commerce_manager_group"
/>
<button
name=
"pomanager"
string=
"采购经理审批"
type=
"object"
states=
"confirm"
class=
"oe_highlight"
groups=
"acct_base.acc_commerce_manager_group"
/>
<button
name=
"boss_accept"
string=
"管理部审批"
type=
"object"
states=
"pomanager"
class=
"oe_highlight"
groups=
"acct_base.acc_manage_info_group"
/>
<button
name=
"boss_accept"
string=
"管理部审批"
type=
"object"
states=
"pomanager"
class=
"oe_highlight"
groups=
"acct_base.acc_manage_info_group"
/>
...
...
acct_sale/models/acc_crm_lead.py
查看文件 @
018e0b7
...
@@ -86,32 +86,30 @@ class AccCrmLead(models.Model):
...
@@ -86,32 +86,30 @@ class AccCrmLead(models.Model):
@api.model
@api.model
def
create
(
self
,
vals
):
def
create
(
self
,
vals
):
res
=
super
(
AccCrmLead
,
self
)
.
create
(
vals
)
res
=
super
(
AccCrmLead
,
self
)
.
create
(
vals
)
if
vals
.
get
(
'user_id'
):
#
if vals.get('user_id'):
toaddrs
=
[]
#
toaddrs = []
toaddrs
.
append
(
res
.
user_id
.
login
)
#
toaddrs.append(res.user_id.login)
toaddrs
.
append
(
self
.
env
[
'res.users'
]
.
browse
(
self
.
_uid
)
.
login
)
#
toaddrs.append(self.env['res.users'].browse(self._uid).login)
# toaddrs = ['jie.dong@neotel-technology.com']
#
# toaddrs = ['jie.dong@neotel-technology.com']
subjects
=
"商机{}创建"
.
format
(
res
.
name
)
#
subjects = "商机{}创建".format(res.name)
message
=
"商机“{}”,关联客户“{}”,销售员“{}”,已在系统创建,详细信息请在erp系统中查看"
.
format
(
res
.
name
,
res
.
partner_id
.
name
,
res
.
user_id
.
partner_id
.
name
)
#
message = "商机“{}”,关联客户“{}”,销售员“{}”,已在系统创建,详细信息请在erp系统中查看".format(res.name,res.partner_id.name,res.user_id.partner_id.name)
self
.
env
[
'acc.tools'
]
.
send_report_email
(
subjects
,
message
,
toaddrs
)
#
self.env['acc.tools'].send_report_email(subjects,message,toaddrs)
# create = True
#
# create = True
self
.
sent
(
vals
,
res
,
create
=
True
)
#
self.sent(vals,res,create=True)
return
res
return
res
@api.multi
@api.multi
def
write
(
self
,
vals
):
def
write
(
self
,
vals
):
# _logger.debug('===========%s===============',res)
if
vals
.
get
(
'user_id'
):
if
vals
.
get
(
'user_id'
):
changeuser
=
self
.
env
[
'res.users'
]
.
browse
(
vals
.
get
(
'user_id'
))
changeuser
=
self
.
env
[
'res.users'
]
.
browse
(
vals
.
get
(
'user_id'
))
toaddrs
=
[]
toaddrs
=
[]
toaddrs
.
append
(
changeuser
.
login
)
toaddrs
.
append
(
changeuser
.
login
)
toaddrs
.
append
(
self
.
env
[
'res.users'
]
.
browse
(
self
.
_uid
)
.
login
)
toaddrs
.
append
(
self
.
env
[
'res.users'
]
.
browse
(
self
.
_uid
)
.
login
)
# toaddrs = ['jie.dong@neotel-technology.com']
# subjects = "采购单{}管理部已审批完成,请及时确认".format(self.name)
# message = "采购单{}<br><br>标题:{}<br><br>供应商:{}<br><br>支付条款:{}<br><br>总价:{}<br><br><br>管理部审批完成,请及时处理<br><br><br>谢谢".format(self.name,self.title,self.partner_id.name,self.payment_rule,self.amount_total)
subjects
=
"商机{}变更提醒"
.
format
(
self
.
name
)
subjects
=
"商机{}变更提醒"
.
format
(
self
.
name
)
message
=
"商机“{}<br><br>标题:{}<br><br>供应商:{}<br><br>支付条款:{}<br><br>总价:{}<br><br><br>管理部审批完成,请及时处理<br><br><br>谢谢"
.
format
(
self
.
name
,
self
.
title
,
self
.
partner_id
.
name
,
self
.
payment_rule
,
self
.
amount_total
)
message
=
"关联客户名称:{}<br><br>联系人名称:{}<br><br>电话:{}<br><br>手机:{}<br><br>邮箱:{}<br><br>销售员:{}"
.
format
(
self
.
partner_id
.
name
,
self
.
contact_id
.
name
,
self
.
contact_id
.
phone
,
self
.
contact_id
.
mobile
,
self
.
contact_id
.
email
,
changeuser
.
partner_id
.
name
)
message
=
"商机“{}”,关联客户“{}”,销售员已变更为“{}”,详细信息请在erp系统中查看"
.
format
(
self
.
name
,
self
.
partner_id
.
name
,
changeuser
.
partner_id
.
name
)
self
.
env
[
'acc.tools'
]
.
send_report_email
(
subjects
,
message
,
toaddrs
)
self
.
env
[
'acc.tools'
]
.
send_report_email
(
subjects
,
message
,
toaddrs
)
# create = False
self
.
sent
(
vals
,
res
=
True
,
create
=
False
)
self
.
sent
(
vals
,
res
=
True
,
create
=
False
)
res
=
super
(
AccCrmLead
,
self
)
.
write
(
vals
)
res
=
super
(
AccCrmLead
,
self
)
.
write
(
vals
)
return
res
return
res
...
...
acct_sale/models/acc_sale.py
查看文件 @
018e0b7
...
@@ -89,6 +89,7 @@ class AccSaleOrder(models.Model):
...
@@ -89,6 +89,7 @@ class AccSaleOrder(models.Model):
po_number
=
fields
.
Char
(
string
=
'关联的采购单'
,
readonly
=
True
,
copy
=
False
)
po_number
=
fields
.
Char
(
string
=
'关联的采购单'
,
readonly
=
True
,
copy
=
False
)
before_purchase_id
=
fields
.
Many2one
(
'before.purchase'
,
string
=
'待确认生成询价单'
,
copy
=
False
)
before_purchase_id
=
fields
.
Many2one
(
'before.purchase'
,
string
=
'待确认生成询价单'
,
copy
=
False
)
origin_sale_order_id
=
fields
.
Many2one
(
'sale.order'
,
string
=
'源销售单'
,
copy
=
False
)
origin_sale_order_id
=
fields
.
Many2one
(
'sale.order'
,
string
=
'源销售单'
,
copy
=
False
)
sale_order_id
=
fields
.
Many2one
(
'sale.order'
,
string
=
'借用销售订单'
,
copy
=
False
)
acc_quotation_id
=
fields
.
Many2one
(
'acc.quotation'
,
string
=
'关联报价单'
,
copy
=
False
)
acc_quotation_id
=
fields
.
Many2one
(
'acc.quotation'
,
string
=
'关联报价单'
,
copy
=
False
)
quo_amount_untaxed
=
fields
.
Float
(
string
=
'未含税金额'
,
store
=
True
,
readonly
=
True
,
compute
=
'_amount_quo_all'
,
track_visibility
=
'always'
)
quo_amount_untaxed
=
fields
.
Float
(
string
=
'未含税金额'
,
store
=
True
,
readonly
=
True
,
compute
=
'_amount_quo_all'
,
track_visibility
=
'always'
)
quo_amount_tax
=
fields
.
Float
(
string
=
'税'
,
store
=
True
,
readonly
=
True
,
compute
=
'_amount_quo_all'
)
quo_amount_tax
=
fields
.
Float
(
string
=
'税'
,
store
=
True
,
readonly
=
True
,
compute
=
'_amount_quo_all'
)
...
@@ -164,6 +165,7 @@ class AccSaleOrder(models.Model):
...
@@ -164,6 +165,7 @@ class AccSaleOrder(models.Model):
pass
pass
else
:
else
:
order
.
send_status
=
'no'
order
.
send_status
=
'no'
else
:
else
:
if
order
.
send_status
==
'part'
:
if
order
.
send_status
==
'part'
:
pass
pass
...
@@ -341,7 +343,7 @@ class AccSaleOrder(models.Model):
...
@@ -341,7 +343,7 @@ class AccSaleOrder(models.Model):
po_name
=
self
.
get_poname
(
p
)
po_name
=
self
.
get_poname
(
p
)
p_str
=
'物料名称:'
+
p
[
'product_id'
]
+
' '
+
'型号:'
+
p
[
'product_model'
]
+
' '
+
'品牌:'
+
p
[
'brand'
]
+
' '
+
'编码:'
+
p
[
'acc_code'
]
+
' '
+
'移除数量:'
+
str
(
p
[
'qty'
])
+
'采购单号:'
+
po_name
+
'<br>'
p_str
=
'物料名称:'
+
p
[
'product_id'
]
+
' '
+
'型号:'
+
p
[
'product_model'
]
+
' '
+
'品牌:'
+
p
[
'brand'
]
+
' '
+
'编码:'
+
p
[
'acc_code'
]
+
' '
+
'移除数量:'
+
str
(
p
[
'qty'
])
+
'采购单号:'
+
po_name
+
'<br>'
remove_products
.
append
(
p_str
)
remove_products
.
append
(
p_str
)
toaddrs
=
[
'luna.zhang@neotel-technology.com'
,
'
coco.ma@neotel-technology.com'
,
'fiona.wu@neotel-technology.com
'
]
toaddrs
=
[
'luna.zhang@neotel-technology.com'
,
'
xue.zhang@neotel.tech'
,
'fiona.wu@neotel-technology.com'
,
'tina.dong@neotel.tech
'
]
toaddrs
.
append
(
self
.
purchase_charge_person
.
login
)
toaddrs
.
append
(
self
.
purchase_charge_person
.
login
)
# toaddrs = ['jie.dong@acctronics.cn']
# toaddrs = ['jie.dong@acctronics.cn']
subjects
=
"源单据{}所申请物料清单有变动,请及时处理"
.
format
(
self
.
name
)
subjects
=
"源单据{}所申请物料清单有变动,请及时处理"
.
format
(
self
.
name
)
...
@@ -372,7 +374,7 @@ class AccSaleOrder(models.Model):
...
@@ -372,7 +374,7 @@ class AccSaleOrder(models.Model):
'order_line'
:
new_res_line
'order_line'
:
new_res_line
}
}
bp_obj
=
self
.
env
[
'before.purchase'
]
.
create
(
vals
)
bp_obj
=
self
.
env
[
'before.purchase'
]
.
create
(
vals
)
toaddrs
=
[
'luna.zhang@neotel-technology.com'
,
'
coco@neotel-technology.com
'
]
toaddrs
=
[
'luna.zhang@neotel-technology.com'
,
'
xue.zhang@neotel.tech
'
]
# toaddrs.append(bp_obj.charge_person.login)
# toaddrs.append(bp_obj.charge_person.login)
subjects
=
"待确认询价单{}"
.
format
(
bp_obj
.
name
)
subjects
=
"待确认询价单{}"
.
format
(
bp_obj
.
name
)
message
=
"待确认询价单{}已生成,请及时处理"
.
format
(
bp_obj
.
name
)
message
=
"待确认询价单{}已生成,请及时处理"
.
format
(
bp_obj
.
name
)
...
@@ -511,6 +513,53 @@ class AccSaleOrder(models.Model):
...
@@ -511,6 +513,53 @@ class AccSaleOrder(models.Model):
message
=
"待确认询价单{}已生成,请及时处理"
.
format
(
bp_obj
.
name
)
message
=
"待确认询价单{}已生成,请及时处理"
.
format
(
bp_obj
.
name
)
self
.
env
[
'acc.tools'
]
.
send_report_email
(
subjects
,
message
,
toaddrs
)
self
.
env
[
'acc.tools'
]
.
send_report_email
(
subjects
,
message
,
toaddrs
)
return
True
return
True
# def log_field(self):
# 额外重新生成待确认询价单流程
@api.multi
def
re_create_before_po
(
self
,
sale_order_id
,
product
,
qty
):
res_line
=
[]
mrp_bom
=
self
.
env
[
'mrp.bom'
]
.
search
([(
'product_tmpl_id'
,
'='
,
product
.
product_tmpl_id
.
id
),(
'active'
,
'='
,
True
)])
if
mrp_bom
:
mrp_vals
=
self
.
make_mrp_vals
(
mrp_bom
,
qty
)
res_line
+=
mrp_vals
vals
=
{
'sale_order_id'
:
sale_order_id
.
id
,
'charge_person'
:
self
.
purchase_charge_person
.
id
,
'delivery_address'
:
self
.
delivery_address
.
id
,
'purchase_company'
:
self
.
sale_company
.
id
,
'order_line'
:
res_line
}
bp_obj
=
self
.
env
[
'before.purchase'
]
.
create
(
vals
)
self
.
write
({
'before_purchase_id'
:
bp_obj
.
id
})
toaddrs
=
[]
toaddrs
.
append
(
bp_obj
.
charge_person
.
login
)
subjects
=
"待确认询价单{}"
.
format
(
bp_obj
.
name
)
message
=
"待确认询价单{}已生成,请及时处理"
.
format
(
bp_obj
.
name
)
self
.
env
[
'acc.tools'
]
.
send_report_email
(
subjects
,
message
,
toaddrs
)
body
=
"重新生成待确认询价单:
%
s"
%
(
bp_obj
.
name
)
sale_order_id
.
message_post
(
body
=
body
,
message_type
=
'comment'
)
return
True
@api.multi
def
make_sale_purchase
(
self
,
sent_product
,
sale_order_id
):
for
product
in
sent_product
:
mrp_production
=
self
.
env
[
'mrp.production'
]
.
search
([(
'product_id'
,
'='
,
product
.
id
),(
'origin'
,
'='
,
sale_order_id
.
name
)])
if
mrp_production
:
done_qty
=
sum
([
m
.
qty_done
for
m
in
mrp_production
.
finished_move_line_ids
])
trans_qty
=
self
.
env
[
'sale.order.line'
]
.
search
([(
'order_id'
,
'='
,
self
.
id
),(
'product_id'
,
'='
,
product
.
id
)])
.
product_uom_qty
if
trans_qty
>
done_qty
:
raise
ValidationError
(
'借用数量超过借用销售订单的<{}>生产完成数量!!'
.
format
(
product
.
product_tmpl_id
.
name
))
else
:
self
.
re_create_before_po
(
sale_order_id
,
product
,
trans_qty
)
new_mrp_production
=
self
.
env
[
'mrp.production'
]
.
search
([(
'product_id'
,
'='
,
product
.
id
),(
'origin'
,
'='
,
self
.
name
)])
new_mrp_production
.
write
({
'origin'
:
sale_order_id
.
name
})
body
=
"重新生成生产单:
%
s"
%
(
new_mrp_production
.
name
)
sale_order_id
.
message_post
(
body
=
body
,
message_type
=
'comment'
)
else
:
raise
ValidationError
(
'未找到借用销售单关联的生产单!!'
)
@api.multi
@api.multi
...
@@ -518,6 +567,19 @@ class AccSaleOrder(models.Model):
...
@@ -518,6 +567,19 @@ class AccSaleOrder(models.Model):
res
=
super
(
AccSaleOrder
,
self
)
.
action_confirm
()
res
=
super
(
AccSaleOrder
,
self
)
.
action_confirm
()
if
self
.
is_makepo
==
True
:
if
self
.
is_makepo
==
True
:
self
.
create_before_po
()
self
.
create_before_po
()
sale_order_id
=
self
.
sale_order_id
if
sale_order_id
:
move_product_ids
=
[]
sale_product_ids
=
[]
for
move_line
in
self
.
sale_order_id
.
order_line
:
move_product_ids
.
append
(
move_line
.
product_id
)
for
sale_line
in
self
.
order_line
:
sale_product_ids
.
append
(
sale_line
.
product_id
)
sent_product
=
[
x
for
x
in
move_product_ids
if
x
in
sale_product_ids
]
if
sent_product
:
self
.
make_sale_purchase
(
sent_product
,
sale_order_id
)
else
:
raise
ValidationError
(
'借用销售单中不存在要借用产品,请确认'
)
return
res
return
res
@api.multi
@api.multi
...
@@ -700,6 +762,8 @@ class AccQuotation(models.Model):
...
@@ -700,6 +762,8 @@ class AccQuotation(models.Model):
crm_lead_id
=
fields
.
Many2one
(
'crm.lead'
,
string
=
'商机'
,
readonly
=
True
)
crm_lead_id
=
fields
.
Many2one
(
'crm.lead'
,
string
=
'商机'
,
readonly
=
True
)
# is_makepo = fields.Boolean(string='是否生成采购单',default=True)
# is_makepo = fields.Boolean(string='是否生成采购单',default=True)
purchase_charge_person
=
fields
.
Many2one
(
'res.users'
,
string
=
'采购负责人'
,
required
=
True
)
purchase_charge_person
=
fields
.
Many2one
(
'res.users'
,
string
=
'采购负责人'
,
required
=
True
)
note1
=
fields
.
Char
(
string
=
'附注1'
,
placeholder
=
"填写格式如: 以上价格为人民币价格,含13.0
%
增值税"
)
note4
=
fields
.
Char
(
string
=
'备注'
)
# is_purchasing = fields.Boolean(string='是否开始采购',readonly=True)
# is_purchasing = fields.Boolean(string='是否开始采购',readonly=True)
# purchase_date = fields.Datetime(string='开始采购时间',readonly=True)
# purchase_date = fields.Datetime(string='开始采购时间',readonly=True)
# is_send = fields.Boolean(string='是否发货',readonly=True)
# is_send = fields.Boolean(string='是否发货',readonly=True)
...
...
acct_sale/report/acc_quotation_report_view.xml
查看文件 @
018e0b7
此文件的差异被折叠,
点击展开。
acct_sale/report/acc_quotation_report_view1.xml
0 → 100644
查看文件 @
018e0b7
此文件的差异被折叠,
点击展开。
acct_sale/report/acc_quotation_report_view2.xml
0 → 100644
查看文件 @
018e0b7
此文件的差异被折叠,
点击展开。
acct_sale/report/acc_quotation_report_view3.xml
0 → 100644
查看文件 @
018e0b7
此文件的差异被折叠,
点击展开。
acct_sale/report/accall_quotation_report_view.xml
查看文件 @
018e0b7
...
@@ -291,9 +291,10 @@
...
@@ -291,9 +291,10 @@
<tr>
<tr>
<td>
<td>
<p>
附注:
</p>
<p>
附注:
</p>
<p
style=
"text-indent:2em;"
>
1、
以上价格为人民币价格,含
<span
t-field=
"o.tax_id.amount"
/>
%增值税
</p>
<p
style=
"text-indent:2em;"
>
1、
<span
t-field=
"o.note1"
/>
</p>
<p
style=
"text-indent:2em;"
>
2、 交货周期为收到预付款后
<span
t-field=
"o.delivery_time"
/></p>
<p
style=
"text-indent:2em;"
>
2、 交货周期为收到预付款后
<span
t-field=
"o.delivery_time"
/></p>
<p
style=
"text-indent:2em;"
>
3、 付款方式:
<span
t-field=
"o.transaction_rule"
/></p>
<p
style=
"text-indent:2em;"
>
3、 付款方式:
<span
t-field=
"o.transaction_rule"
/></p>
<p
style=
"text-indent:2em;"
><span
t-field=
"o.note4"
/></p>
</td>
</td>
</tr>
</tr>
</table>
</table>
...
...
acct_sale/report/accen_quotation_report_view.xml
查看文件 @
018e0b7
...
@@ -313,7 +313,7 @@
...
@@ -313,7 +313,7 @@
<p
style=
"text-indent:2em;"
>
1 All prices in
<span
t-field=
"o.currency_id.name"
/></p>
<p
style=
"text-indent:2em;"
>
1 All prices in
<span
t-field=
"o.currency_id.name"
/></p>
<p
style=
"text-indent:2em;"
>
2 Delivery terms:
<span
t-field=
"o.transaction_mode.name"
/></p>
<p
style=
"text-indent:2em;"
>
2 Delivery terms:
<span
t-field=
"o.transaction_mode.name"
/></p>
<p
style=
"text-indent:2em;"
>
3 Lead time:
<span
t-field=
"o.delivery_time"
/>
after prepayment
</p>
<p
style=
"text-indent:2em;"
>
3 Lead time:
<span
t-field=
"o.delivery_time"
/>
after prepayment
</p>
<p
style=
"text-indent:2em;"
>
4 Payment term:
<span
t-field=
"o.transaction_rule"
/></p>
<p
style=
"text-indent:2em;"
>
4 Payment term
s
:
<span
t-field=
"o.transaction_rule"
/></p>
</td>
</td>
</tr>
</tr>
</table>
</table>
...
...
acct_sale/views/acc_crm_lead_view.xml
查看文件 @
018e0b7
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<openerp>
<data>
<data>
<!-- 商机视图 -->
<record
id=
"view_crm_lead_form_inherit"
model=
"ir.ui.view"
>
<record
id=
"view_crm_lead_form_inherit"
model=
"ir.ui.view"
>
<field
name=
"name"
>
crm.lead.inherit
</field>
<field
name=
"name"
>
crm.lead.inherit
</field>
<field
name=
"model"
>
crm.lead
</field>
<field
name=
"model"
>
crm.lead
</field>
...
@@ -26,6 +26,20 @@
...
@@ -26,6 +26,20 @@
</field>
</field>
</record>
</record>
<!-- 线索视图 -->
<record
id=
"view_crm_xiansuo_form_inherit"
model=
"ir.ui.view"
>
<field
name=
"name"
>
crm.lead1.inherit
</field>
<field
name=
"model"
>
crm.lead
</field>
<field
name=
"inherit_id"
ref=
"crm.crm_case_form_view_leads"
/>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//field[@name='partner_name']"
position=
"before"
>
<field
name=
"partner_id"
/>
<field
name=
"contact_id"
/>
<field
name=
"last_contact"
/>
</xpath>
</field>
</record>
<menuitem
id=
"menu_zhijing_acc_sale_quotation"
<menuitem
id=
"menu_zhijing_acc_sale_quotation"
action=
"action_acc_quotation1"
action=
"action_acc_quotation1"
parent=
"crm.crm_menu_sales"
parent=
"crm.crm_menu_sales"
...
...
acct_sale/views/acc_sale_view.xml
查看文件 @
018e0b7
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
<field
name=
"before_purchase_id"
readonly=
"1"
/>
<field
name=
"before_purchase_id"
readonly=
"1"
/>
<field
name=
"acc_quotation_id"
readonly=
"1"
/>
<field
name=
"acc_quotation_id"
readonly=
"1"
/>
<field
name=
"origin_sale_order_id"
/>
<field
name=
"origin_sale_order_id"
/>
<
!-- <field name="is_send"/> --
>
<
field
name=
"sale_order_id"
/
>
<field
name=
"send_date"
/>
<field
name=
"send_date"
/>
<field
name=
"is_pay"
/>
<field
name=
"is_pay"
/>
<field
name=
"send_status"
/>
<field
name=
"send_status"
/>
...
@@ -343,6 +343,8 @@
...
@@ -343,6 +343,8 @@
<field
name=
"is_createso"
/>
<field
name=
"is_createso"
/>
<field
name=
"discount"
/>
<field
name=
"discount"
/>
<field
name=
"ship_fee"
/>
<field
name=
"ship_fee"
/>
<field
name=
"note1"
/>
<field
name=
"note4"
/>
<!-- <field name="transaction_rule"/> -->
<!-- <field name="transaction_rule"/> -->
</group>
</group>
</group>
</group>
...
...
acct_stock/models/acc_stock_move.py
查看文件 @
018e0b7
...
@@ -60,29 +60,45 @@ class AccStockPicking(models.Model):
...
@@ -60,29 +60,45 @@ class AccStockPicking(models.Model):
# readonly=True, required=True,
# readonly=True, required=True,
# states={'draft': [('readonly', False)]})
# states={'draft': [('readonly', False)]})
title
=
fields
.
Char
(
string
=
'项目号'
)
title
=
fields
.
Char
(
string
=
'项目号'
)
# actual_location_id = fields.Many2one('stock.location',string='实际存放库位
')
sale_order_id
=
fields
.
Many2one
(
'sale.order'
,
string
=
'借用销售订单
'
)
# @api.multi
# @api.multi
# def button_validate(self):
# def button_validate(self):
# res = super(AccStockPicking,self).button_validate()
# res = super(AccStockPicking,self).button_validate()
# po_name = self.origin
# sale_order_id = self.sale_order_id
# po_obj = self.env['purchase.order'].search([('name', '=', po_name)])
# if sale_order_id:
# qty_received = []
# sale_order_id = self.sale_order_id
# product_qty = []
# move_product_ids = []
# if po_obj:
# sale_product_ids = []
# for line in po_obj.order_line:
# for move_line in self.move_ids_without_package:
# qty_received.append(line.qty_received)
# move_product_ids.append(move_line.product_id)
# product_qty.append(line.product_qty)
# for sale_line in self.sale_order_id.order_line:
# _logger.debug('===========%s===============', qty_received)
# sale_product_ids.append(sale_line.product_id)
# _logger.debug('===========%s===============', product_qty)
# sent_product = [x for x in move_product_ids if x in sale_product_ids]
# if sum(qty_received) == 0:
# if sent_product:
# po_obj.write({'product_state':'new'})
# self.make_sale_purchase(sent_product,sale_order_id)
# elif sum(qty_received) < sum(product_qty) and sum(qty_received) != 0:
# po_obj.write({'product_state':'part'})
# else:
# else:
#
po_obj.write({'product_state':'all'}
)
#
raise ValidationError('借用销售单中不存在交货产品,请确认'
)
# return res
# return res
@api.multi
def
make_sale_purchase
(
self
,
sent_product
,
sale_order_id
):
for
product
in
sent_product
:
mrp_production
=
self
.
env
[
'mrp.production'
]
.
search
([(
'product_id'
,
'='
,
product
.
id
),(
'origin'
,
'='
,
sale_order_id
.
name
)])
if
mrp_production
:
done_qty
=
sum
([
m
.
qty_done
for
m
in
mrp_production
.
finished_move_line_ids
])
trans_qty
=
self
.
env
[
'stock.move'
]
.
search
([(
'picking_id'
,
'='
,
self
.
id
),(
'product_id'
,
'='
,
product
.
id
)])
.
product_uom_qty
if
trans_qty
>
done_qty
:
raise
ValidationError
(
'交货数量超过借用销售订单的生产完成数量!!'
)
else
:
sale_order_id
.
re_create_before_po
(
product
,
trans_qty
)
new_mrp_production
=
self
.
env
[
'mrp.production'
]
.
search
([(
'product_id'
,
'='
,
product
.
id
),(
'origin'
,
'='
,
self
.
origin
)])
new_mrp_production
.
write
({
'origin'
:
sale_order_id
.
name
})
body
=
"重新生成生产单:
%
s"
%
(
new_mrp_production
.
name
)
sale_order_id
.
message_post
(
body
=
body
,
message_type
=
'comment'
)
else
:
raise
ValidationError
(
'未找到借用销售单关联的生产单!!'
)
@api.one
@api.one
@api.depends
(
'move_lines.date_expected'
)
@api.depends
(
'move_lines.date_expected'
)
def
_compute_scheduled_date
(
self
):
def
_compute_scheduled_date
(
self
):
...
@@ -269,6 +285,10 @@ class ExcipientsProduct(models.Model):
...
@@ -269,6 +285,10 @@ class ExcipientsProduct(models.Model):
is_active
=
fields
.
Boolean
(
string
=
'有效'
,
default
=
True
)
is_active
=
fields
.
Boolean
(
string
=
'有效'
,
default
=
True
)
@api.multi
def
draft_button
(
self
):
self
.
env
.
user
.
notify_success
(
message
=
'变更成功'
)
@api.onchange
(
'product_id'
)
@api.onchange
(
'product_id'
)
def
onchange_product_id
(
self
):
def
onchange_product_id
(
self
):
if
self
.
product_id
:
if
self
.
product_id
:
...
...
acct_stock/report/accstock_report_views.xml
查看文件 @
018e0b7
此文件的差异被折叠,
点击展开。
acct_stock/views/acc_stock_move_view.xml
查看文件 @
018e0b7
...
@@ -85,6 +85,7 @@
...
@@ -85,6 +85,7 @@
<field
name=
"arch"
type=
"xml"
>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//field[@name='origin']"
position=
"after"
>
<xpath
expr=
"//field[@name='origin']"
position=
"after"
>
<field
name=
"title"
/>
<field
name=
"title"
/>
<!-- <field name="sale_order_id" attrs="{'invisible': [('picking_type_code', '=', 'incoming')]}"/> -->
</xpath>
</xpath>
</field>
</field>
</record>
</record>
...
...
acct_stock/views/excipients_product_view.xml
查看文件 @
018e0b7
...
@@ -8,6 +8,9 @@
...
@@ -8,6 +8,9 @@
<field
name=
"model"
>
excipients.product
</field>
<field
name=
"model"
>
excipients.product
</field>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"arch"
type=
"xml"
>
<form
string=
"excipients product"
version=
"12.0"
>
<form
string=
"excipients product"
version=
"12.0"
>
<header>
<button
name=
"draft_button"
string=
"确认生成"
type=
"object"
/>
</header>
<sheet>
<sheet>
<!-- <div class="oe_title">
<!-- <div class="oe_title">
<h1><field name="name" readonly="1"/></h1>
<h1><field name="name" readonly="1"/></h1>
...
...
acct_stock/wizard/__init__.py
查看文件 @
018e0b7
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Part of Odoo. See LICENSE file for full copyright and licensing details.
#
from . import choose_move
from
.
import
choose_move
# from . import import_contact_data
# from . import import_contact_data
# from . import import_product_data
# from . import import_product_data
# from . import import_purchase_data
# from . import import_purchase_data
...
...
acct_stock/wizard/choose_move.py
查看文件 @
018e0b7
...
@@ -10,26 +10,26 @@ class ChooseMove(models.TransientModel):
...
@@ -10,26 +10,26 @@ class ChooseMove(models.TransientModel):
stock_moves
=
fields
.
Many2many
(
'stock.move'
,
string
=
'moves'
)
stock_moves
=
fields
.
Many2many
(
'stock.move'
,
string
=
'moves'
)
# flag_order = fields.Char('Flag Order')
# flag_order = fields.Char('Flag Order')
@api.multi
def
select_products
(
self
):
if
self
.
flag_order
==
'so'
:
order_id
=
self
.
env
[
'sale.order'
]
.
browse
(
self
.
_context
.
get
(
'active_id'
,
False
))
for
product
in
self
.
product_ids
:
self
.
env
[
'sale.order.line'
]
.
create
({
'product_id'
:
product
.
id
,
'product_uom'
:
product
.
uom_id
.
id
,
'price_unit'
:
product
.
lst_price
,
'order_id'
:
order_id
.
id
})
elif
self
.
flag_order
==
'po'
:
order_id
=
self
.
env
[
'purchase.order'
]
.
browse
(
self
.
_context
.
get
(
'active_id'
,
False
))
for
product
in
self
.
product_ids
:
self
.
env
[
'purchase.order.line'
]
.
create
({
'product_id'
:
product
.
id
,
'name'
:
product
.
name
,
'date_planned'
:
order_id
.
date_planned
,
'product_uom'
:
product
.
uom_id
.
id
,
'price_unit'
:
product
.
lst_price
,
'product_qty'
:
1.0
,
'order_id'
:
order_id
.
id
})
\ No newline at end of file
\ No newline at end of file
# @api.multi
# def select_products(self):
# if self.flag_order == 'so':
# order_id = self.env['sale.order'].browse(self._context.get('active_id', False))
# for product in self.product_ids:
# self.env['sale.order.line'].create({
# 'product_id': product.id,
# 'product_uom': product.uom_id.id,
# 'price_unit': product.lst_price,
# 'order_id': order_id.id
# })
# elif self.flag_order == 'po':
# order_id = self.env['purchase.order'].browse(self._context.get('active_id', False))
# for product in self.product_ids:
# self.env['purchase.order.line'].create({
# 'product_id': product.id,
# 'name': product.name,
# 'date_planned': order_id.date_planned,
# 'product_uom': product.uom_id.id,
# 'price_unit': product.lst_price,
# 'product_qty': 1.0,
# 'order_id': order_id.id
# })
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论