Commit 018e0b7f 董杰

erp项目最近修改

1 个父辈 e9244759
......@@ -15,7 +15,7 @@
<field name="asset_sequence"/>
<field name="acc_asset_code"/>
<field name="user_id"/>
<!-- <field name="acc_type"/> -->
<field name="acc_type"/>
<!-- <field name="minus_amount"/>
<field name="invoice_acc_total"/>
<field name="invoice_state"/> -->
......
......@@ -26,6 +26,7 @@ class res_partner_acc(models.Model):
quality_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)
customer_type = fields.Selection([('jinxiao', '经销商'), ('daili', '代理商'), ('zuizhong', '最终用户')], '类型', default='jinxiao')
# @api.model
# def create(self,vals):
......
......@@ -33,13 +33,14 @@ class AccTools(models.Model):
@smtpaddr:smtp服务地址,可以在邮箱看,比如163邮箱为smtp.163.com
@password:发信人的邮箱密码
'''
fromaddr = "notreply@acctronics.cn"
# fromaddr = "notreply@acctronics.cn"
fromaddr = "notreply@neotel.tech"
smtpaddr = "smtp.exmail.qq.com"
# toaddrs = ['jie.dong@acctronics.cn']
toaddrs = toaddrs
# subject = "最新消息"
subject = subjects
password = "Acc@0707"
password = "Acc@0113"
# msg = "测试"
msg = message
mail_msg = MIMEMultipart()
......@@ -58,8 +59,8 @@ class AccTools(models.Model):
s.quit()
_logger.info("邮件发送成功")
except Exception as e:
print ("Error: unable to send email")
_logger.info("邮件发送失败")
# print ("Error: unable to send email")
_logger.info("邮件发送失败,错误信息:{}".format(e))
def get_users(self,group_name):
commerce_group = self.env['res.groups'].search([('name', '=', group_name)])
......
......@@ -149,6 +149,7 @@
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='lang']" position="after">
<field name="customer_type"/>
<field name="charge_person"/>
<field name="traffic_level" widget="priority"/>
<field name="quality_level" widget="priority"/>
......
......@@ -51,7 +51,7 @@ class AccMrpBom(models.Model):
# group_name = '商务部员工'
# create_user_id = self._uid
# 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']
subjects = "物料清单{}{}已创建".format(res.product_tmpl_id.name,res.code)
message = "物料清单{}{}已创建请及时查看".format(res.product_tmpl_id.name,res.code)
......
......@@ -169,6 +169,7 @@ class CFTemplateCategory(models.Model):
# toaddrs = []
# toaddrs.append(self.manage_user.login)
toaddrs = ['cissy.shen@neotel-technology.com']
# toaddrs = ['fiona.wu@neotel-technology.com']
# toaddrs = ['jie.dong@acctronics.cn']
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)
......@@ -377,19 +378,17 @@ class CFTemplateCategory(models.Model):
@api.multi
def write(self, vals):
# if self.purchase_type == 'office':
# self.check_office_price(vals)
if vals.get('minus_amount'):
amount = self.amount_untaxed + self.amount_tax - vals.get('minus_amount', 0)
vals.update({
"amount_total": amount
})
if vals.get('discount_rate'):
rate_amount = self.amount_untaxed * vals.get('discount_rate')/100
amount = self.amount_untaxed + self.amount_tax - rate_amount
vals.update({
"amount_total": amount
})
# if vals.get('discount_rate'):
# rate_amount = self.amount_untaxed * vals.get('discount_rate')/100
# amount = self.amount_untaxed + self.amount_tax - rate_amount
# vals.update({
# "amount_total": amount
# })
res = super(CFTemplateCategory, self).write(vals)
return res
......@@ -593,6 +592,18 @@ class CFTemplateCategory(models.Model):
sheet.write(n, j, body[i][j])
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):
"""
导出采购单信息
......@@ -616,6 +627,8 @@ class CFTemplateCategory(models.Model):
pt.acc_code AS acc_code,
pt.partner_code AS partner_code,
pt.product_model AS product_model,
pt.acc_purchase_price AS price,
pt.product_describe_cn AS describe,
pol.product_qty AS qty,
rp. NAME AS supplier,
pol.forcast_date AS forcast_date
......@@ -648,8 +661,10 @@ class CFTemplateCategory(models.Model):
detail_list_first.append(line.get('acc_code'))
detail_list_first.append(line.get('partner_code'))
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('supplier'))
detail_list_first.append(line.get('describe'))
if line.get('forcast_date'):
detail_list_first.append(line.get('forcast_date').strftime("%Y-%m-%d"))
else:
......@@ -657,10 +672,10 @@ class CFTemplateCategory(models.Model):
detail_list_all.append(detail_list_first)
dir_path = os.path.join(file_url, 'Administrator')
filename = "{}.xls".format('询价单明细表')
filename = "{}明细表.xls".format(self.name)
file_path = os.path.join(dir_path, filename)
check_path(file_path)
head = ['序号', '负责人','单号','标题','品牌','产品名称','产品编码','供应商编码','产品型号','数量','供应商','预计到货日期']
head = ['序号', '负责人','单号','标题','品牌','产品名称','产品编码','供应商编码','产品型号','价格','数量','供应商','中文描述','预计到货日期']
self.save_exel(head, detail_list_all, file_path)
return self.export_record(file_path)
......
......@@ -199,6 +199,7 @@ class BeforePurchase(models.Model):
# return self.message_post(body=merge_tips, subject=subject)
return True
class BeforePurchaseLine(models.Model):
_name = 'before.purchase.line'
_description = " 待确认询价单明细"
......
......@@ -76,12 +76,12 @@
<br/>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<th colspan="10" class="text-center">
<th colspan="11" class="text-center">
<strong><span t-field="o.purchase_company.name"/></strong>
</th>
</tr>
<tr>
<th colspan="10" class="text-center">
<th colspan="11" class="text-center">
<strong>采 购 合 同</strong>
</th>
</tr>
......@@ -89,7 +89,7 @@
<td colspan="5" class="text-center">
合同编号:<span t-field="o.name"/>
</td>
<td colspan="5" class="text-center">
<td colspan="6" class="text-center">
下单日期:<span t-field="o.gen_date"/>
</td>
</tr>
......@@ -103,7 +103,7 @@
<td colspan="2" class="text-center">
乙方(卖方)
</td>
<td colspan="3" class="text-center">
<td colspan="4" class="text-center">
<span t-field="o.partner_id.name"/>
</td>
</tr>
......@@ -117,7 +117,7 @@
<td colspan="2" class="text-center">
乙方联系人
</td>
<td colspan="3" class="text-center">
<td colspan="4" class="text-center">
<span t-field="o.contact_id.name"/>
</td>
</tr>
......@@ -131,12 +131,12 @@
<td colspan="2" class="text-center">
乙方电话:
</td>
<td colspan="3" class="text-center">
<td colspan="4" class="text-center">
<span t-field="o.contact_id.mobile"/>
</td>
</tr>
<tr>
<td colspan="10" class="text-left">
<td colspan="11" class="text-left">
甲方向乙方订购以下产品,请按照要求货期准时送货。
</td>
</tr>
......@@ -150,16 +150,16 @@
<th style="width:9%;">
名称
</th>
<th style="width:9%;">
<th style="width:11%;">
规格型号
</th>
<th style="width:8%;">
<th style="width:7%;">
供应商编号
</th>
<th style="width:15%;">
<th style="width:16%;">
描述
</th>
<th style="width:8%;">
<th style="width:7%;">
品牌
</th>
<th style="width:7%;">
......@@ -171,7 +171,7 @@
<th style="width:9%;">
单价
</th>
<th style="width:10%;">
<th style="width:9%;">
金额小计
</th>
<th style="width:15%;">
......@@ -221,7 +221,7 @@
</td>
</tr>
<tr>
<td colspan="10" class="text-left">
<td colspan="11" class="text-left">
备注:<span t-field="o.notes"/>
</td>
<!-- <th colspan="1">
......@@ -267,8 +267,9 @@
</p>
<p>
五、产品验收:
<p style="text-indent:2em;">1、甲方应在收到乙方产品之日起7日内进行验收。</p>
<p style="text-indent:2em;">1、甲方应在收到乙方产品之日起7日内进行验收,甲方的验收不免除乙方的质量保证责任</p>
<p style="text-indent:2em;">2、若甲方验收时发现产品存在质量、包装、损坏等问题,或乙方未按合同约定提供相应产品的,有权要求乙方更换,因此产生的额外费用由乙方承担。</p>
<p style="text-indent:2em;">3、乙方应当严格按照本订单约定交期向甲方交付产品,未经甲方提前书面同意,不得迟延、提前或分批交付。乙方逾期交付产品的,应当按照订单金额的3‰/日向甲方支付逾期违约金了,且甲方有权解除订单,甲方解除订单的,乙方应按照订单金额的30%向甲方承担违约责任,不足以弥补甲方的损失的(包括但不限于甲方因此向甲方客户承担的逾期违约责任、从第三方购买替代品所产生的额外费用等),乙方应当补足。</p>
</p>
<p>
......@@ -282,10 +283,12 @@
</p>
<p>
七、质量保证:
<p style="text-indent:2em;">1、验货标准,按照相应运营商产品规格及质量进行验货。乙方应当提供产品规格及质量标准供甲方参考。</p>
<p style="text-indent:2em;">2、产品的使用期质保期:乙方产品的使用期为1年,自收货日期开始计算。</p>
<p style="text-indent:2em;">3、若在使用期内产品出现损坏或无法正常使用,甲方有权要求乙方更换,因此产生的额外费用由乙方承担。</p>
<p style="text-indent:2em;">4、本次生产的产品必需与运营商样品质量一致。</p>
<p style="text-indent:2em;">1、质量标准:国家标准、行业标准、原厂标准及双方约定的其他标准。卖方提供的产品应当是全新原包装正品,产品到买方指定交货地点时剩余的有效期应大于全部有效期的75%。甲方不得隐瞒、改造、变造产品信息(包括但不限于品牌、原料、产地、生产厂商、生产日期、有效日期等)。乙方对于质量保证及保修的承诺对象不仅限于甲方,在甲方有要求时,乙方同意为甲方的客户、最终客户或其他第三方提供本协议所述之保证及服务;乙方接到质保/保修要求的,应当在12个小时内响应并处理</p>
<p style="text-indent:2em;"> 2.乙方应当向甲方主动、如实披露所有产品的信息,包括但不限于生厂商、货权、授权情况、有效期等,乙方不得向甲方交付不符合甲方要求的产品或违反乙方自身有义务遵守的货源渠道规则的产品。乙方交付的产品不符合订单规定的,乙方应向甲方退还全部货款,并承担订单金额的100%作为违约,并由乙方根据甲方的指示负责包换、保修或退货,并承担因此产生的费用。</p>
<p style="text-indent:2em;">3.乙方向甲方交付重大瑕疵产品的(包括但不限于假货、已使用、翻新、变造、替换零部件、伪造贴标/铭牌,或以买多发少、买高价发低价产品、以次充好、无交易有结算、滥用或泄漏甲方客户信息等不正当手段损害甲方或甲方客户利益的),乙方应当按照 违约订单商品数量乘以甲方向终端客户销售该产品的单价计算所得)总价的十倍进行赔偿,并承担甲方采取补救措施所支出的必要费用,包括但不限于向甲方客户赔偿的费用等。</p>
<p style="text-indent:2em;">4.除上述约定外,乙方违反/不履行本订单其他条款或因乙方提供的产品造成甲方损失的,由乙方承担所有损失(包括但不限于人工费、运输费、包装费、挑拣费、返修费、重置费、报废损失、客户索赔、人身伤害等赔偿);任何情况下赔偿金额无法计算或低于订单总金额30%的,乙方按照订单总金额的30%承担违约金。</p>
<p style="text-indent:2em;">5、产品的质保期:乙方产品的质保期为【1】年,自验收日起开始计算。</p>
<p style="text-indent:2em;">6、若在质保期内产品出现损坏或无法正常使用,甲方有权要求乙方更换,因此产生的额外费用由乙方承担。维修二次及二次以上或更换后仍无法正常使用或产品出现损坏的,甲方有权要求退货并取消订单,由此所产生的损失及费用由乙方承担(包括律师费、调查费、诉讼仲裁费、差旅费、诉讼保全担保费用等)。</p>
</p>
<p>
八、发货时间:
......@@ -297,22 +300,25 @@
</p>
<p>
十、违约责任:
<p style="text-indent:2em;">1、甲方逾期付款,每逾期一日需支付乙方合同金额1‰的违约金,逾期超过五日,乙方有权单方解除合同。</p>
<p style="text-indent:2em;">2、乙方逾期发货的,每逾期一日需支付甲方合同金额1%的违约金,逾期超过五日,甲方有权单方解除合同。</p>
<p style="text-indent:2em;">乙方逾期发货的,每逾期一日需支付甲方合同金额1%的违约金,逾期超过三十日,甲方有权单方解除合同。</p>
</p>
<p>
十一、合同效力:
十一、保密协议:
<p style="text-indent:2em;">1、除非为本订单所必须,乙方对因本订单的履行而获知的另一方的商业秘密、技术信息等以及本订单内容和订单签订过程的一切细节信息均负有保密义务,不得向任何第三方泄露,但中国现行法律另有规定或经另一方书面同意的除外。</p>
</p>
<p>
十二、合同效力:
<p style="text-indent:2em;">1、本合同自双方代表签字并加盖公司公章或合同专用章后生效;</p>
<p style="text-indent:2em;">2、双方未约定内容可另行签署补充协议作为本合同附件,与本协议效力相同。</p>
</p>
<p>
、争议解决
、争议解决
<p style="text-indent:2em;">因履行本合同发生争议,由当事人协商解决,协商不成的,可依法向甲方所在地人民法院提起诉讼。</p>
</p>
<p>
、本合同一式两份,双方各执一份,效力相同。
、本合同一式两份,双方各执一份,效力相同。
</p>
</div>
<div class="row unovo-report-purchase-footer">
......
......@@ -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="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="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="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"/>
......
......@@ -86,32 +86,30 @@ class AccCrmLead(models.Model):
@api.model
def create(self,vals):
res = super(AccCrmLead, self).create(vals)
if vals.get('user_id'):
toaddrs = []
toaddrs.append(res.user_id.login)
toaddrs.append(self.env['res.users'].browse(self._uid).login)
# toaddrs = ['jie.dong@neotel-technology.com']
subjects = "商机{}创建".format(res.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)
# create = True
self.sent(vals,res,create=True)
# if vals.get('user_id'):
# toaddrs = []
# toaddrs.append(res.user_id.login)
# toaddrs.append(self.env['res.users'].browse(self._uid).login)
# # toaddrs = ['jie.dong@neotel-technology.com']
# subjects = "商机{}创建".format(res.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)
# # create = True
# self.sent(vals,res,create=True)
return res
@api.multi
def write(self, vals):
# _logger.debug('===========%s===============',res)
if vals.get('user_id'):
changeuser = self.env['res.users'].browse(vals.get('user_id'))
toaddrs = []
toaddrs.append(changeuser.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)
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 = "商机“{}”,关联客户“{}”,销售员已变更为“{}”,详细信息请在erp系统中查看".format(self.name,self.partner_id.name,changeuser.partner_id.name)
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)
self.env['acc.tools'].send_report_email(subjects,message,toaddrs)
# create = False
self.sent(vals,res=True,create=False)
res = super(AccCrmLead, self).write(vals)
return res
......
......@@ -89,6 +89,7 @@ class AccSaleOrder(models.Model):
po_number = fields.Char(string='关联的采购单',readonly=True,copy=False)
before_purchase_id = fields.Many2one('before.purchase',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)
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')
......@@ -164,6 +165,7 @@ class AccSaleOrder(models.Model):
pass
else:
order.send_status = 'no'
else:
if order.send_status == 'part':
pass
......@@ -341,7 +343,7 @@ class AccSaleOrder(models.Model):
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>'
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 = ['jie.dong@acctronics.cn']
subjects = "源单据{}所申请物料清单有变动,请及时处理".format(self.name)
......@@ -372,7 +374,7 @@ class AccSaleOrder(models.Model):
'order_line':new_res_line
}
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)
subjects = "待确认询价单{}".format(bp_obj.name)
message = "待确认询价单{}已生成,请及时处理".format(bp_obj.name)
......@@ -512,12 +514,72 @@ class AccSaleOrder(models.Model):
self.env['acc.tools'].send_report_email(subjects,message,toaddrs)
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
def action_confirm(self):
res = super(AccSaleOrder, self).action_confirm()
if self.is_makepo == True:
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
@api.multi
......@@ -700,6 +762,8 @@ class AccQuotation(models.Model):
crm_lead_id = fields.Many2one('crm.lead',string='商机',readonly=True)
# is_makepo = fields.Boolean(string='是否生成采购单',default=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)
# purchase_date = fields.Datetime(string='开始采购时间',readonly=True)
# is_send = fields.Boolean(string='是否发货',readonly=True)
......
......@@ -4,7 +4,7 @@
<template id="acct_report_quotation">
<t t-call="web.basic_layout">
<t t-foreach="docs" t-as="o">
<style tyle="text/css">
<style type="text/css">
.unovo-report-purchase-title {
font-family:"DengXian";
font-size: 25px;
......@@ -18,6 +18,12 @@
font-size:16px;
text-align:right;
}
.unovo-report-purchase-name{
font-family:"DengXian";
font-size: 25px;
font-weight: bold;
line-height:40px;
}
.unovo-report-purchase-table {
vertical-align: middle;
font-family:"DengXian";
......@@ -29,17 +35,17 @@
}
.unovo-report-purchase-table th{
font-weight:bold;
text-align:center;
text-align:left;
height:20px;
font-size:16px;
font-size:14px;
border:1px solid #ccc;
}
.unovo-report-purchase-table td{
height:20px;
font-size:16px;
font-size:14px;
border:1px solid #ccc;
background:#FFF
text-align: center;
background:#FFF;
text-align: left;
}
.unovo-report-purchase-table p {
margin:5px 0px;
......@@ -53,6 +59,11 @@
line-height:22px;
font-size:16px;
}
.unovo-report-purchase-address {
font-size: 14px;margin: 7px 0 35px;
font-family:"DengXian";
font-size:14px;
}
.unovo-report-purchase-content p {
margin:5px 0px;
}
......@@ -61,8 +72,64 @@
line-height:22px;
font-size:16px;
}
.unovo-report-purchase-about{
vertical-align: middle;
font-family:"DengXian";
width:100%;
background:#FFF;
font-size: 14px;
}
.new-page-css{
min-width: 600px;
padding: 0 20px;
}
.title_position{
min-width: 80px;
text-align: left;position: relative;
}
.quotationcss{
max-height: 70px;position: absolute;right: 0;bottom: -15px;font-size: 30px;
}
.unovo-report-purchase-footer .text_right{
width: 100%;text-align: right;
}
.text_linehaight{
padding: 0 5px;line-height: 22px;
}
.font14{
font-size: 14px;
}
.padd5{
padding: 0 5px;
}
.connaction{
display: inline-block;width: 20%;margin-left: 10%;
}
.xcode{
display: inline-block;position: absolute;bottom: -5px;right:40px;
}
.imgCss{
max-height: 110px;width:170px
}
.total-css{
min-width:170px;font-size: 14px;
}
.interested-css{
width: 70%;background:#f8f8f8;border: 1px solid #f2f2f2;text-align:center;padding: 5px 0;
}
.weixinCss{
width: 125px;
padding:10px;
background:#f8f8f8 !important;border: 1px solid #f2f2f2 !important;
}
.text_indent{
text-indent:2em;
}
.code2{
max-height: 104px;width:104px
}
</style>
<div class="page">
<div class="page new-page-css">
<!-- <div class="header">
<div class="row">
<div class="col-xs-3">
......@@ -70,166 +137,138 @@
</div>
</div>
</div> -->
<div class="row unovo-report-purchase-title">
<div class="col-xs-6" style="width: 50%;text-align: left;">
<div class="" style="position: absolute;">
<!-- <img t-att-src="'data:image/jpg;base64,%s' % o.purchase_company.logo" style="max-height: 45px;"/> -->
<img t-att-src="'data:image/png;base64,%s' % logo" style="max-height: 110px;width:170px"/>
<!-- <img class="imgCss" src="./image001.png"/> -->
</div>
<div class="col-xs-6" style="width: 50%;text-align: right;color:#3d85c6;">
<strong style="max-height: 70px;width:250px">QUOTATION</strong>
</div>
</div>
<div class="row unovo-report-purchase-footer">
<div class="col-xs-6" style="width: 100%;text-align: right;">
<p>报价单编号:<span t-field="o.name"/></p>
<div class="row unovo-report-purchase-footer" style="padding-top: 50px;">
<div class="col-xs-6 text_right">
<strong style="font-size: 25px;">QUOTATION</strong>
<div>报价单编号:<span t-field="o.name"/></div>
</div>
</div>
<br/>
<div class="unovo-report-purchase-title"><span t-field="o.sale_company.name"/></div>
<div class="unovo-report-purchase-content">
<p>
<p>全国免费电话:400-088-1622</p>
<p>上海市闵行区联航路1588号中心大道西路18号楼 邮编:201112</p>
<p>电话:+86-21-62208085 +86-21-62208090 传真:+86-21-51026636</p>
</p>
<div class="unovo-report-purchase-name"><span t-field="o.sale_company.name"/></div>
<div class="unovo-report-purchase-address ">
<div>
<div> <a href="WWW.NEOTEL-TECHNOLOGY.COM">WWW.NEOTEL-TECHNOLOGY.COM</a></div>
<div style="margin-top:5px;">全国免费电话:400-088-1622</div>
<div style="margin-top:25px;">上海:上海市闵行区联航路1588号中心大道西路18号楼 邮编:201112</div>
<div style="margin-top:5px;">苏州:苏州市工业园区归家巷48号1幢101室 邮编:215021</div>
</div>
</div>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<th class="text-center" >
<strong>报价日期</strong>
<th class="padd5" style="width: 18%;">
<strong class="font14" >报价日期</strong>
</th>
<th class="text-center" >
<strong>公司名称</strong>
<th class="padd5" style="width: 30%;">
<strong class="font14" >公司名称</strong>
</th>
<th class="text-center" >
<strong>联系人</strong>
<th class="padd5" style="width: 11%;">
<strong class="font14" >联系人</strong>
</th>
<th class="text-center">
<strong>电话</strong>
<th class="padd5" style="width: 20%;">
<strong class="font14" >电话</strong>
</th>
<th class="text-center">
<strong>运输</strong>
<th class="padd5" style="width: 10%;">
<strong class="font14">运输</strong>
</th>
<th class="text-center">
<strong>交货期</strong>
<th class="padd5" style="width: 10%;">
<strong class="font14">交货期</strong>
</th>
</tr>
<tr>
<td class="text-center">
<span t-field="o.last_date"/>
<td class="text_linehaight">
<span t-field="o.last_date" />
</td>
<td class="text-center">
<span t-field="o.partner_id.name"/>
<td class="text_linehaight">
<span t-field="o.partner_id.name" />
</td>
<td class="text-center">
<td class="text_linehaight">
<span t-esc="o.contact_id.name"/>
</td>
<td class="text-center">
<span t-field="o.contact_id.phone"/>
<td class="text_linehaight">
<span t-field="o.contact_id.phone" />
</td>
<td class="text-center">
<td class="text_linehaight">
<span t-field="o.transaction_mode.name"/>
</td>
<td class="text-center">
<td class="text_linehaight">
<span t-field="o.delivery_time"/>
</td>
</tr>
</table>
<br/>
<br/>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<th class="text-center">
<strong>负责人</strong>
</th>
<th class="text-center" >
<strong>联系方式</strong>
</th>
<th class="text-center" >
<strong>邮箱</strong>
</th>
</tr>
<tr>
<td class="text-center">
<span t-field="o.user_id.name"/>
</td>
<td class="text-center">
<span t-field="o.user_id.phone"/>
</td>
<td class="text-center">
<span t-field="o.user_id.email"/>
</td>
</tr>
</table>
<br/>
<br/>
<div class="unovo-report-purchase-content">
<div class="unovo-report-purchase-content" style="padding:10px 0;">
<p>
报价产品信息:
<strong class="font14">报价内容:</strong>
</p>
</div>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<th class="text-center" style="width:15%;">
<strong>产品编码</strong>
<th class="padd5" style="width: 15%;">
<strong class="font14">产品型号</strong>
</th>
<th class="text-center" style="width:15%;">
<strong>产品名称</strong>
<th class="padd5" style="width: 15%;">
<strong class="font14">产品名称</strong>
</th>
<th class="text-center" style="width:45%;">
<strong>产品描述</strong>
<th class="padd5" style="width:34%">
<strong class="font14" >产品描述</strong>
</th>
<th class="text-center" style="width:5%;">
<strong>数量</strong>
<th class="padd5" style="width: 8%;">
<strong class="font14" >数量</strong>
</th>
<th class="text-center" style="width:5%;">
<strong>单位</strong>
<th class="padd5" style="width: 8%;">
<strong class="font14" >单位</strong>
</th>
<th class="text-center" style="width:10%;">
<strong>单价</strong>
<th class="padd5" style="width: 10%;">
<strong class="font14">单价</strong>
</th>
<th class="text-center" style="width:5%;">
<strong>小计</strong>
<th class="padd5" style="width: 10%;">
<strong class="font14" >小计</strong>
</th>
</tr>
<tr t-foreach="o.accquotation_line" t-as="line">
<td class="text-center">
<span t-field="line.product_id.product_tmpl_id.product_model"/>
<td class="text_linehaight" >
<span t-field="line.product_id.product_tmpl_id.product_model" />
</td>
<td class="text-center">
<td class="text_linehaight" >
<span t-field="line.product_id.product_tmpl_id.name"/>
</td>
<td style="text-align:left;">
<span t-field="line.product_id.product_tmpl_id.product_describe_cn"/>
<td class="text_linehaight">
<span t-field="line.product_id.product_tmpl_id.product_describe_cn" />
</td>
<td class="text-center">
<td class="text_linehaight">
<span t-field="line.product_qty"/>
</td>
<td class="text-center">
<td class="text_linehaight">
<span t-field="line.product_uom.name"/>
</td>
<td class="text-center">
<td class="text_linehaight">
<span t-field="line.price_unit" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<!-- <td class="text-center">
<span t-esc="', '.join(map(lambda x: x.name, line.taxes_id))"/>
</td> -->
<td class="text-center">
<td class="text_linehaight">
<!-- <span t-esc="'{:.2f}'.format(round(line.price_unit*line.product_qty,2))" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> -->
<span t-esc="line.price_unit*line.product_qty" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</table>
<br/>
<table cellspacing="3" style="width:25%;" align="right">
<table cellspacing="3" class="total-css" align="right">
<tr>
<td style="width:50%;">
小计(<span t-field="o.currency_id.name"/>):
小计(<span t-field="o.currency_id.name" />):
</td>
<td >
<span t-esc="o.amount_untaxed" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
<span t-esc="o.amount_untaxed" style="min-width:80px;" t-options='{"widget": "monetary", "display_currency": o.currency_id}' />
</td>
</tr>
<tr>
......@@ -276,50 +315,64 @@
</td>
</tr>
</table>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<table class="unovo-report-purchase-about" cellspacing="0" cellpadding="0">
<!-- <tr>
<th colspan="3" class="text-center">
<strong>Other Comments or Special Instructions</strong>
</th>
</tr> -->
<tr>
<td>
<p style="text-align:center">谢谢你的询价。以上为您所感兴趣的产品价格信息。如果您还需要我公司的其他产品信息或者资料</p>
<p style="text-align:center">请浏览我公司网站:</p>
<p style="text-align:center">http://www.neotel-technology.com</p>
<td style="width: 15%;"></td>
<td class="interested-css">
<div style="text-align:center;line-height: 20px;">以上是您感兴趣的产品资料,希望对您的工作带来方便,您还可以浏览</div>
<div style="text-align:center;line-height: 20px;"><a href="">http://www.neotel-technology.com</a> 获取其他产品信息。</div>
</td>
<td style="width: 15%;"></td>
</tr>
</table>
<br/>
<br/>
<div style="position: relative;">
<div style="width: 45%;display: inline-block;font-size: 14px;">
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<!-- <tr>
<th colspan="3" class="text-center">
<strong>Other Comments or Special Instructions</strong>
</th>
</tr> -->
<tr>
<td>
<p>附注:</p>
<p style="text-indent:2em;">1、 以上价格为人民币价格,含<span t-field="o.tax_id.amount"/>%增值税</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="padding-left:5px;">附注:</p>
<div style="padding:0 20px 5px;line-height: 20px;">
<div class="">1、 以上价格为<span t-field="o.note1"/></div>
<div class="">2、 交货周期为收到预付款后<span t-field="o.delivery_time"/></div>
<div class="">3、 付款方式:<span t-field="o.transaction_rule"/></div>
<div class=""><span t-field="o.note4"/></div>
</div>
</td>
</tr>
</table>
</div>
<div style="display: inline-block;font-size: 14px;position: absolute;right:120px;top: 5px;">
<table style="width: 110px;" class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="" style="background: #f8f8f8;padding: 2px 4px;" >
<p style="font-size: 14px;font-family:'DengXian';line-height: 20px;" class="">如果您对报价单有任何问题,可以直接联系微信客服:</p>
</div>
</td>
</tr>
</table>
</div>
<div style="display: inline-block;font-size: 14px;position: absolute;right: 0;">
<img t-att-src="'data:image/png;base64,%s' % qr_code" class="code2"/>
<!-- <img src="./code.png" class="code2"/> -->
</div>
</div>
<br/>
<br/>
<br/>
<!-- <div class="row unovo-report-purchase-title">
<div class="col-xs-6" style="width: 100%;text-align: center;">
<img t-att-src="'data:image/png;base64,%s' % qr_code" style="max-height: 2100px;width:210px"/>
</div>
</div> -->
<div class="footer">
<!-- <div class="footer">
<div class="col-xs-6" style="width: 100%;text-align: right;">
<img t-att-src="'data:image/png;base64,%s' % qr_code" style="max-height: 70px;width:70px"/>
</div>
</div>
</div> -->
</div>
<div style="page-break-after:always;"></div>
</t>
......
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="acct_report_quotation">
<t t-call="web.basic_layout">
<t t-foreach="docs" t-as="o">
<style tyle="text/css">
.unovo-report-purchase-title {
font-family:"DengXian";
font-size: 25px;
font-weight: bold;
text-align:center;
line-height:40px;
}
.unovo-report-purchase-header {
font-family:"DengXian";
line-height:22px;
font-size:16px;
text-align:right;
}
.unovo-report-purchase-table {
vertical-align: middle;
font-family:"DengXian";
border:1px solid #ccc;
width:100%;
border-collapse:collapse;
border:1px solid #ccc;
background:#FFF
}
.unovo-report-purchase-table th{
font-weight:bold;
text-align:center;
height:20px;
font-size:16px;
border:1px solid #ccc;
}
.unovo-report-purchase-table td{
height:20px;
font-size:16px;
border:1px solid #ccc;
background:#FFF
text-align: center;
}
.unovo-report-purchase-table p {
margin:5px 0px;
}
.unovo-report-purchase-total {
line-height:20px;
font-size:16px;
}
.unovo-report-purchase-content {
font-family:"DengXian";
line-height:22px;
font-size:16px;
}
.unovo-report-purchase-content p {
margin:5px 0px;
}
.unovo-report-purchase-footer {
font-family:"DengXian";
line-height:22px;
font-size:16px;
}
</style>
<div class="page">
<!-- <div class="header">
<div class="row">
<div class="col-xs-3">
<span t-field="o.purchase_company.name"/>
</div>
</div>
</div> -->
<div class="row unovo-report-purchase-title">
<div class="col-xs-6" style="width: 50%;text-align: left;">
<!-- <img t-att-src="'data:image/jpg;base64,%s' % o.purchase_company.logo" style="max-height: 45px;"/> -->
<img t-att-src="'data:image/png;base64,%s' % logo" style="max-height: 110px;width:170px"/>
</div>
<div class="col-xs-6" style="width: 50%;text-align: right;color:#3d85c6;">
<strong style="max-height: 70px;width:250px">QUOTATION</strong>
</div>
</div>
<div class="row unovo-report-purchase-footer">
<div class="col-xs-6" style="width: 100%;text-align: right;">
<p>报价单编号:<span t-field="o.name"/></p>
</div>
</div>
<br/>
<div class="unovo-report-purchase-title"><span t-field="o.sale_company.name"/></div>
<div class="unovo-report-purchase-content">
<p>
<p>全国免费电话:400-088-1622</p>
<p>上海市闵行区联航路1588号中心大道西路18号楼 邮编:201112</p>
<p>电话:+86-21-62208085 +86-21-62208090 传真:+86-21-51026636</p>
</p>
</div>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<th class="text-center" >
<strong>报价日期</strong>
</th>
<th class="text-center" >
<strong>公司名称</strong>
</th>
<th class="text-center" >
<strong>联系人</strong>
</th>
<th class="text-center">
<strong>电话</strong>
</th>
<th class="text-center">
<strong>运输</strong>
</th>
<th class="text-center">
<strong>交货期</strong>
</th>
</tr>
<tr>
<td class="text-center">
<span t-field="o.last_date"/>
</td>
<td class="text-center">
<span t-field="o.partner_id.name"/>
</td>
<td class="text-center">
<span t-esc="o.contact_id.name"/>
</td>
<td class="text-center">
<span t-field="o.contact_id.phone"/>
</td>
<td class="text-center">
<span t-field="o.transaction_mode.name"/>
</td>
<td class="text-center">
<span t-field="o.delivery_time"/>
</td>
</tr>
</table>
<br/>
<br/>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<th class="text-center">
<strong>负责人</strong>
</th>
<th class="text-center" >
<strong>联系方式</strong>
</th>
<th class="text-center" >
<strong>邮箱</strong>
</th>
</tr>
<tr>
<td class="text-center">
<span t-field="o.user_id.name"/>
</td>
<td class="text-center">
<span t-field="o.user_id.phone"/>
</td>
<td class="text-center">
<span t-field="o.user_id.email"/>
</td>
</tr>
</table>
<br/>
<br/>
<div class="unovo-report-purchase-content">
<p>
报价产品信息:
</p>
</div>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<th class="text-center" style="width:15%;">
<strong>产品编码</strong>
</th>
<th class="text-center" style="width:15%;">
<strong>产品名称</strong>
</th>
<th class="text-center" style="width:45%;">
<strong>产品描述</strong>
</th>
<th class="text-center" style="width:5%;">
<strong>数量</strong>
</th>
<th class="text-center" style="width:5%;">
<strong>单位</strong>
</th>
<th class="text-center" style="width:10%;">
<strong>单价</strong>
</th>
<th class="text-center" style="width:5%;">
<strong>小计</strong>
</th>
</tr>
<tr t-foreach="o.accquotation_line" t-as="line">
<td class="text-center">
<span t-field="line.product_id.product_tmpl_id.product_model"/>
</td>
<td class="text-center">
<span t-field="line.product_id.product_tmpl_id.name"/>
</td>
<td style="text-align:left;">
<span t-field="line.product_id.product_tmpl_id.product_describe_cn"/>
</td>
<td class="text-center">
<span t-field="line.product_qty"/>
</td>
<td class="text-center">
<span t-field="line.product_uom.name"/>
</td>
<td class="text-center">
<span t-field="line.price_unit" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<!-- <td class="text-center">
<span t-esc="', '.join(map(lambda x: x.name, line.taxes_id))"/>
</td> -->
<td class="text-center">
<!-- <span t-esc="'{:.2f}'.format(round(line.price_unit*line.product_qty,2))" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> -->
<span t-esc="line.price_unit*line.product_qty" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</table>
<br/>
<table cellspacing="3" style="width:25%;" align="right">
<tr>
<td style="width:50%;">
小计(<span t-field="o.currency_id.name"/>):
</td>
<td >
<span t-esc="o.amount_untaxed" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>
税费(<span t-field="o.currency_id.name"/>):
</td>
<td>
<span t-esc="o.amount_tax" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>
折扣(<span t-field="o.currency_id.name"/>):
</td>
<td >
<span t-esc="o.discount" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>
运费(<span t-field="o.currency_id.name"/>):
</td>
<td >
<span t-esc="o.ship_fee" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>
合计(<span t-field="o.currency_id.name"/>):
</td>
<td>
<!-- <span t-esc="o.amount_total - o.discount_amount - o.ship_fee" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> -->
<span t-esc="o.amount_total" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<th>
<p>
</p>
</th>
<td>
<p>
</p>
</td>
</tr>
</table>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<!-- <tr>
<th colspan="3" class="text-center">
<strong>Other Comments or Special Instructions</strong>
</th>
</tr> -->
<tr>
<td>
<p style="text-align:center">谢谢你的询价。以上为您所感兴趣的产品价格信息。如果您还需要我公司的其他产品信息或者资料</p>
<p style="text-align:center">请浏览我公司网站:</p>
<p style="text-align:center">http://www.neotel-technology.com</p>
</td>
</tr>
</table>
<br/>
<br/>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<!-- <tr>
<th colspan="3" class="text-center">
<strong>Other Comments or Special Instructions</strong>
</th>
</tr> -->
<tr>
<td>
<p>附注:</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;">3、 付款方式:<span t-field="o.transaction_rule"/></p>
<p style="text-indent:2em;"><span t-field="o.note4"/></p>
</td>
</tr>
</table>
<br/>
<br/>
<br/>
<!-- <div class="row unovo-report-purchase-title">
<div class="col-xs-6" style="width: 100%;text-align: center;">
<img t-att-src="'data:image/png;base64,%s' % qr_code" style="max-height: 2100px;width:210px"/>
</div>
</div> -->
<div class="footer">
<div class="col-xs-6" style="width: 100%;text-align: right;">
<img t-att-src="'data:image/png;base64,%s' % qr_code" style="max-height: 70px;width:70px"/>
</div>
</div>
</div>
<div style="page-break-after:always;"></div>
</t>
<t t-foreach="docs" t-as="doc">
<t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})"/>
</t>
</t>
</template>
<!-- <template id="unovo_report_purchaseorder">
<t t-call="report.html_container">
<t t-foreach="doc_ids" t-as="doc_id">
<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'unovo_report.unovo_report_purchaseorder_document')"/>
</t>
</t>
</template> -->
</data>
</odoo>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="acct_report_quotation">
<t t-call="web.basic_layout">
<t t-foreach="docs" t-as="o">
<style type="text/css">
.unovo-report-purchase-title {
font-family:"DengXian";
font-size: 25px;
font-weight: bold;
text-align:center;
line-height:40px;
}
.unovo-report-purchase-header {
font-family:"DengXian";
line-height:22px;
font-size:16px;
text-align:right;
}
.unovo-report-purchase-name{
font-family:"DengXian";
font-size: 25px;
font-weight: bold;
line-height:40px;
}
.unovo-report-purchase-table {
vertical-align: middle;
font-family:"DengXian";
border:1px solid #ccc;
width:100%;
border-collapse:collapse;
border:1px solid #ccc;
background:#FFF
}
.unovo-report-purchase-table th{
font-weight:bold;
text-align:left;
height:20px;
font-size:14px;
border:1px solid #ccc;
}
.unovo-report-purchase-table td{
height:20px;
font-size:14px;
border:1px solid #ccc;
background:#FFF;
text-align: left;
}
.unovo-report-purchase-table p {
margin:5px 0px;
}
.unovo-report-purchase-total {
line-height:20px;
font-size:16px;
}
.unovo-report-purchase-content {
font-family:"DengXian";
line-height:22px;
font-size:16px;
}
.unovo-report-purchase-address {
font-size: 14px;margin: 7px 0 35px;
font-family:"DengXian";
font-size:14px;
}
.unovo-report-purchase-content p {
margin:5px 0px;
}
.unovo-report-purchase-footer {
font-family:"DengXian";
line-height:22px;
font-size:16px;
}
.unovo-report-purchase-about{
vertical-align: middle;
font-family:"DengXian";
width:100%;
background:#FFF;
font-size: 14px;
}
.new-page-css{
min-width: 721px;
padding: 0 20px;
}
.title_position{
min-width: 80px;
text-align: left;position: relative;
}
.quotationcss{
max-height: 70px;position: absolute;right: 0;bottom: -15px;font-size: 30px;
}
.unovo-report-purchase-footer .text_right{
width: 100%;text-align: right;
}
.text_linehaight{
padding: 0 5px;line-height: 22px;
}
.font14{
font-size: 14px;
}
.padd5{
padding: 0 5px;
}
.connaction{
display: inline-block;width: 20%;margin-left: 10%;
}
.xcode{
display: inline-block;position: absolute;bottom: -5px;right:40px;
}
.imgCss{
max-height: 110px;width:170px
}
.total-css{
min-width:170px;font-size: 14px;
}
.interested-css{
width: 70%;background:#f8f8f8;border: 1px solid #f2f2f2;text-align:center;padding: 5px 0;
}
.weixinCss{
width: 125px;
padding:10px;
background:#f8f8f8 !important;border: 1px solid #f2f2f2 !important;
}
.text_indent{
text-indent:2em;
}
.code2{
max-height: 104px;width:104px
}
</style>
<div class="page new-page-css">
<!-- <div class="header">
<div class="row">
<div class="col-xs-3">
<span t-field="o.purchase_company.name"/>
</div>
</div>
</div> -->
<div class="" style="position: absolute;">
<!-- <img t-att-src="'data:image/jpg;base64,%s' % o.purchase_company.logo" style="max-height: 45px;"/> -->
<img t-att-src="'data:image/png;base64,%s' % logo" style="max-height: 110px;width:170px"/>
<!-- <img class="imgCss" src="./image001.png"/> -->
</div>
<div class="row unovo-report-purchase-footer" style="padding-top: 50px;">
<div class="col-xs-6 text_right">
<strong style="font-size: 25px;">QUOTATION</strong>
<div>报价单编号:<span t-field="o.name"/></div>
</div>
</div>
<br/>
<div class="unovo-report-purchase-name"><span t-field="o.sale_company.name"/></div>
<div class="unovo-report-purchase-address ">
<div>
<div> <a href="WWW.NEOTEL-TECHNOLOGY.COM">WWW.NEOTEL-TECHNOLOGY.COM</a></div>
<div style="margin-top:5px;">全国免费电话:400-088-1622</div>
<div style="margin-top:25px;">上海:上海市闵行区联航路1588号中心大道西路18号楼 邮编:201112</div>
<div style="margin-top:5px;">苏州:苏州市工业园区归家巷48号1幢101室 邮编:215021</div>
</div>
</div>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<th class="padd5" style="min-width:120px;">
<strong class="font14" >报价日期</strong>
</th>
<th class="padd5" style="min-width:195px;">
<strong class="font14" >公司名称</strong>
</th>
<th class="padd5" style="min-width:70px;">
<strong class="font14" >联系人</strong>
</th>
<th class="padd5" style="min-width:130px;">
<strong class="font14" >电话</strong>
</th>
<th class="padd5" style="min-width:65px;">
<strong class="font14">运输</strong>
</th>
<th class="padd5" style="min-width:65px;">
<strong class="font14">交货期</strong>
</th>
</tr>
<tr>
<td class="text_linehaight">
<span t-field="o.last_date" />
</td>
<td class="text_linehaight">
<span t-field="o.partner_id.name" />
</td>
<td class="text_linehaight">
<span t-esc="o.contact_id.name"/>
</td>
<td class="text_linehaight">
<span t-field="o.contact_id.phone" />
</td>
<td class="text_linehaight">
<span t-field="o.transaction_mode.name"/>
</td>
<td class="text_linehaight">
<span t-field="o.delivery_time"/>
</td>
</tr>
</table>
<div class="unovo-report-purchase-content" style="padding:10px 0;">
<p>
<strong class="font14">报价内容:</strong>
</p>
</div>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<th class="padd5" style="min-width:75px;">
<strong class="font14">产品编码</strong>
</th>
<th class="padd5" style="min-width:95px;">
<strong class="font14">产品名称</strong>
</th>
<th class="padd5" style="min-width:270px;">
<strong class="font14" >产品描述</strong>
</th>
<th class="padd5" style="min-width:30px;">
<strong class="font14" >数量</strong>
</th>
<th class="padd5" style="min-width:30px;">
<strong class="font14" >单位</strong>
</th>
<th class="padd5" style="min-width:70px;">
<strong class="font14">单价</strong>
</th>
<th class="padd5" style="min-width:65px;">
<strong class="font14" >小计</strong>
</th>
</tr>
<tr t-foreach="o.accquotation_line" t-as="line">
<td class="text_linehaight" >
<span t-field="line.product_id.product_tmpl_id.product_model" />
</td>
<td class="text_linehaight" >
<span t-field="line.product_id.product_tmpl_id.name"/>
</td>
<td class="text_linehaight">
<span t-field="line.product_id.product_tmpl_id.product_describe_cn" />
</td>
<td class="text_linehaight">
<span t-field="line.product_qty"/>
</td>
<td class="text_linehaight">
<span t-field="line.product_uom.name"/>
</td>
<td class="text_linehaight">
<span t-field="line.price_unit" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<!-- <td class="text-center">
<span t-esc="', '.join(map(lambda x: x.name, line.taxes_id))"/>
</td> -->
<td class="text_linehaight">
<!-- <span t-esc="'{:.2f}'.format(round(line.price_unit*line.product_qty,2))" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> -->
<span t-esc="line.price_unit*line.product_qty" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</table>
<br/>
<table cellspacing="3" class="total-css" align="right">
<tr>
<td style="width:50%;">
小计(<span t-field="o.currency_id.name" />):
</td>
<td >
<span t-esc="o.amount_untaxed" style="min-width:80px;" t-options='{"widget": "monetary", "display_currency": o.currency_id}' />
</td>
</tr>
<tr>
<td>
税费(<span t-field="o.currency_id.name"/>):
</td>
<td>
<span t-esc="o.amount_tax" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>
折扣(<span t-field="o.currency_id.name"/>):
</td>
<td >
<span t-esc="o.discount" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>
运费(<span t-field="o.currency_id.name"/>):
</td>
<td >
<span t-esc="o.ship_fee" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>
合计(<span t-field="o.currency_id.name"/>):
</td>
<td>
<!-- <span t-esc="o.amount_total - o.discount_amount - o.ship_fee" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> -->
<span t-esc="o.amount_total" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<th>
<p>
</p>
</th>
<td>
<p>
</p>
</td>
</tr>
</table>
<table class="unovo-report-purchase-about" cellspacing="0" cellpadding="0">
<!-- <tr>
<th colspan="3" class="text-center">
<strong>Other Comments or Special Instructions</strong>
</th>
</tr> -->
<tr>
<td style="width: 15%;"></td>
<td class="interested-css">
<div style="text-align:center;line-height: 20px;">以上是您感兴趣的产品资料,希望对您的工作带来方便,您还可以浏览</div>
<div style="text-align:center;line-height: 20px;"><a href="">http://www.neotel-technology.com</a> 获取其他产品信息。</div>
</td>
<td style="width: 15%;"></td>
</tr>
</table>
<br/>
<br/>
<div style="position: relative;">
<div style="width: 45%;display: inline-block;font-size: 14px;">
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<td>
<p style="padding-left:5px;">附注:</p>
<p class="text_indent">1、 以上价格为<span t-field="o.note1"/></p>
<p class="text_indent">2、 交货周期为收到预付款后<span t-field="o.delivery_time"/></p>
<p class="text_indent">3、 付款方式:<span t-field="o.transaction_rule"/></p>
<p class="text_indent">4、<span t-field="o.note4"/></p>
</td>
</tr>
</table>
</div>
<div style="display: inline-block;font-size: 14px;position: absolute;right:120px;top: 5px;">
<table style="width: 110px;" class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="" style="background: #f8f8f8;padding: 2px 4px;" >
<p style="font-size: 14px;font-family:'DengXian';line-height: 20px;" class="">如果您对报价单有任何问题,可以直接联系微信客服:</p>
</div>
</td>
</tr>
</table>
</div>
<div style="display: inline-block;font-size: 14px;position: absolute;right: 0;">
<img t-att-src="'data:image/png;base64,%s' % qr_code" class="code2"/>
<!-- <img src="./code.png" class="code2"/> -->
</div>
</div>
<br/>
<br/>
<br/>
<!-- <div class="footer">
<div class="col-xs-6" style="width: 100%;text-align: right;">
<img t-att-src="'data:image/png;base64,%s' % qr_code" style="max-height: 70px;width:70px"/>
</div>
</div> -->
</div>
<div style="page-break-after:always;"></div>
</t>
<t t-foreach="docs" t-as="doc">
<t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})"/>
</t>
</t>
</template>
<!-- <template id="unovo_report_purchaseorder">
<t t-call="report.html_container">
<t t-foreach="doc_ids" t-as="doc_id">
<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'unovo_report.unovo_report_purchaseorder_document')"/>
</t>
</t>
</template> -->
</data>
</odoo>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="acct_report_quotation">
<t t-call="web.basic_layout">
<t t-foreach="docs" t-as="o">
<style type="text/css">
.unovo-report-purchase-title {
font-family:"DengXian";
font-size: 25px;
font-weight: bold;
text-align:center;
line-height:40px;
}
.unovo-report-purchase-header {
font-family:"DengXian";
line-height:22px;
font-size:16px;
text-align:right;
}
.unovo-report-purchase-name{
font-family:"DengXian";
font-size: 25px;
font-weight: bold;
line-height:40px;
}
.unovo-report-purchase-table {
vertical-align: middle;
font-family:"DengXian";
border:1px solid #ccc;
width:100%;
border-collapse:collapse;
border:1px solid #ccc;
background:#FFF
}
.unovo-report-purchase-table th{
font-weight:bold;
text-align:left;
height:20px;
font-size:14px;
border:1px solid #ccc;
}
.unovo-report-purchase-table td{
height:20px;
font-size:14px;
border:1px solid #ccc;
background:#FFF;
text-align: left;
}
.unovo-report-purchase-table p {
margin:5px 0px;
}
.unovo-report-purchase-total {
line-height:20px;
font-size:16px;
}
.unovo-report-purchase-content {
font-family:"DengXian";
line-height:22px;
font-size:16px;
}
.unovo-report-purchase-address {
font-size: 14px;margin: 7px 0 35px;
font-family:"DengXian";
font-size:14px;
}
.unovo-report-purchase-content p {
margin:5px 0px;
}
.unovo-report-purchase-footer {
font-family:"DengXian";
line-height:22px;
font-size:16px;
}
.unovo-report-purchase-about{
vertical-align: middle;
font-family:"DengXian";
width:100%;
background:#FFF;
font-size: 14px;
}
.new-page-css{
min-width: 600px;
padding: 0 20px;
}
.title_position{
min-width: 80px;
text-align: left;position: relative;
}
.quotationcss{
max-height: 70px;position: absolute;right: 0;bottom: -15px;font-size: 30px;
}
.unovo-report-purchase-footer .text_right{
width: 100%;text-align: right;
}
.text_linehaight{
padding: 0 5px;line-height: 22px;
}
.font14{
font-size: 14px;
}
.padd5{
padding: 0 5px;
}
.connaction{
display: inline-block;width: 20%;margin-left: 10%;
}
.xcode{
display: inline-block;position: absolute;bottom: -5px;right:40px;
}
.imgCss{
max-height: 110px;width:170px
}
.total-css{
min-width:170px;font-size: 14px;
}
.interested-css{
width: 70%;background:#f8f8f8;border: 1px solid #f2f2f2;text-align:center;padding: 5px 0;
}
.weixinCss{
width: 125px;
padding:10px;
background:#f8f8f8 !important;border: 1px solid #f2f2f2 !important;
}
.text_indent{
text-indent:2em;
}
.code2{
max-height: 104px;width:104px
}
</style>
<div class="page new-page-css">
<!-- <div class="header">
<div class="row">
<div class="col-xs-3">
<span t-field="o.purchase_company.name"/>
</div>
</div>
</div> -->
<div class="" style="position: absolute;">
<!-- <img t-att-src="'data:image/jpg;base64,%s' % o.purchase_company.logo" style="max-height: 45px;"/> -->
<img t-att-src="'data:image/png;base64,%s' % logo" style="max-height: 110px;width:170px"/>
<!-- <img class="imgCss" src="./image001.png"/> -->
</div>
<div class="row unovo-report-purchase-footer" style="padding-top: 50px;">
<div class="col-xs-6 text_right">
<strong style="font-size: 25px;">QUOTATION</strong>
<div>报价单编号:<span t-field="o.name"/></div>
</div>
</div>
<br/>
<div class="unovo-report-purchase-name"><span t-field="o.sale_company.name"/></div>
<div class="unovo-report-purchase-address ">
<div>
<div> <a href="WWW.NEOTEL-TECHNOLOGY.COM">WWW.NEOTEL-TECHNOLOGY.COM</a></div>
<div style="margin-top:5px;">全国免费电话:400-088-1622</div>
<div style="margin-top:25px;">上海:上海市闵行区联航路1588号中心大道西路18号楼 邮编:201112</div>
<div style="margin-top:5px;">苏州:苏州市工业园区归家巷48号1幢101室 邮编:215021</div>
</div>
</div>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<th class="padd5" style="width: 18%;">
<strong class="font14" >报价日期</strong>
</th>
<th class="padd5" style="width: 30%;">
<strong class="font14" >公司名称</strong>
</th>
<th class="padd5" style="width: 11%;">
<strong class="font14" >联系人</strong>
</th>
<th class="padd5" style="width: 20%;">
<strong class="font14" >电话</strong>
</th>
<th class="padd5" style="width: 10%;">
<strong class="font14">运输</strong>
</th>
<th class="padd5" style="width: 10%;">
<strong class="font14">交货期</strong>
</th>
</tr>
<tr>
<td class="text_linehaight">
<span t-field="o.last_date" />
</td>
<td class="text_linehaight">
<span t-field="o.partner_id.name" />
</td>
<td class="text_linehaight">
<span t-esc="o.contact_id.name"/>
</td>
<td class="text_linehaight">
<span t-field="o.contact_id.phone" />
</td>
<td class="text_linehaight">
<span t-field="o.transaction_mode.name"/>
</td>
<td class="text_linehaight">
<span t-field="o.delivery_time"/>
</td>
</tr>
</table>
<div class="unovo-report-purchase-content" style="padding:10px 0;">
<p>
<strong class="font14">报价内容:</strong>
</p>
</div>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<th class="padd5" style="width: 15%;">
<strong class="font14">产品型号</strong>
</th>
<th class="padd5" style="width: 15%;">
<strong class="font14">产品名称</strong>
</th>
<th class="padd5" style="width:34%">
<strong class="font14" >产品描述</strong>
</th>
<th class="padd5" style="width: 8%;">
<strong class="font14" >数量</strong>
</th>
<th class="padd5" style="width: 8%;">
<strong class="font14" >单位</strong>
</th>
<th class="padd5" style="width: 10%;">
<strong class="font14">单价</strong>
</th>
<th class="padd5" style="width: 10%;">
<strong class="font14" >小计</strong>
</th>
</tr>
<tr t-foreach="o.accquotation_line" t-as="line">
<td class="text_linehaight" >
<span t-field="line.product_id.product_tmpl_id.product_model" />
</td>
<td class="text_linehaight" >
<span t-field="line.product_id.product_tmpl_id.name"/>
</td>
<td class="text_linehaight">
<span t-field="line.product_id.product_tmpl_id.product_describe_cn" />
</td>
<td class="text_linehaight">
<span t-field="line.product_qty"/>
</td>
<td class="text_linehaight">
<span t-field="line.product_uom.name"/>
</td>
<td class="text_linehaight">
<span t-field="line.price_unit" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<!-- <td class="text-center">
<span t-esc="', '.join(map(lambda x: x.name, line.taxes_id))"/>
</td> -->
<td class="text_linehaight">
<!-- <span t-esc="'{:.2f}'.format(round(line.price_unit*line.product_qty,2))" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> -->
<span t-esc="line.price_unit*line.product_qty" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</table>
<br/>
<table cellspacing="3" class="total-css" align="right">
<tr>
<td style="width:50%;">
小计(<span t-field="o.currency_id.name" />):
</td>
<td >
<span t-esc="o.amount_untaxed" style="min-width:80px;" t-options='{"widget": "monetary", "display_currency": o.currency_id}' />
</td>
</tr>
<tr>
<td>
税费(<span t-field="o.currency_id.name"/>):
</td>
<td>
<span t-esc="o.amount_tax" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>
折扣(<span t-field="o.currency_id.name"/>):
</td>
<td >
<span t-esc="o.discount" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>
运费(<span t-field="o.currency_id.name"/>):
</td>
<td >
<span t-esc="o.ship_fee" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>
合计(<span t-field="o.currency_id.name"/>):
</td>
<td>
<!-- <span t-esc="o.amount_total - o.discount_amount - o.ship_fee" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> -->
<span t-esc="o.amount_total" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<th>
<p>
</p>
</th>
<td>
<p>
</p>
</td>
</tr>
</table>
<table class="unovo-report-purchase-about" cellspacing="0" cellpadding="0">
<!-- <tr>
<th colspan="3" class="text-center">
<strong>Other Comments or Special Instructions</strong>
</th>
</tr> -->
<tr>
<td style="width: 15%;"></td>
<td class="interested-css">
<div style="text-align:center;line-height: 20px;">以上是您感兴趣的产品资料,希望对您的工作带来方便,您还可以浏览</div>
<div style="text-align:center;line-height: 20px;"><a href="">http://www.neotel-technology.com</a> 获取其他产品信息。</div>
</td>
<td style="width: 15%;"></td>
</tr>
</table>
<br/>
<br/>
<div style="position: relative;">
<div style="width: 45%;display: inline-block;font-size: 14px;">
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<td>
<p style="padding-left:5px;">附注:</p>
<p class="text_indent">1、 以上价格为<span t-field="o.note1"/></p>
<p class="text_indent">2、 交货周期为收到预付款后<span t-field="o.delivery_time"/></p>
<p class="text_indent">3、 付款方式:<span t-field="o.transaction_rule"/></p>
<p class="text_indent"><span t-field="o.note4"/></p>
</td>
</tr>
</table>
</div>
<div style="display: inline-block;font-size: 14px;position: absolute;right:120px;top: 5px;">
<table style="width: 110px;" class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="" style="background: #f8f8f8;padding: 2px 4px;" >
<p style="font-size: 14px;font-family:'DengXian';line-height: 20px;" class="">如果您对报价单有任何问题,可以直接联系微信客服:</p>
</div>
</td>
</tr>
</table>
</div>
<div style="display: inline-block;font-size: 14px;position: absolute;right: 0;">
<img t-att-src="'data:image/png;base64,%s' % qr_code" class="code2"/>
<!-- <img src="./code.png" class="code2"/> -->
</div>
</div>
<br/>
<br/>
<br/>
<!-- <div class="footer">
<div class="col-xs-6" style="width: 100%;text-align: right;">
<img t-att-src="'data:image/png;base64,%s' % qr_code" style="max-height: 70px;width:70px"/>
</div>
</div> -->
</div>
<div style="page-break-after:always;"></div>
</t>
<t t-foreach="docs" t-as="doc">
<t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})"/>
</t>
</t>
</template>
<!-- <template id="unovo_report_purchaseorder">
<t t-call="report.html_container">
<t t-foreach="doc_ids" t-as="doc_id">
<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'unovo_report.unovo_report_purchaseorder_document')"/>
</t>
</t>
</template> -->
</data>
</odoo>
\ No newline at end of file
......@@ -291,9 +291,10 @@
<tr>
<td>
<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;">3、 付款方式:<span t-field="o.transaction_rule"/></p>
<p style="text-indent:2em;"><span t-field="o.note4"/></p>
</td>
</tr>
</table>
......
......@@ -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;">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;">4 Payment term:<span t-field="o.transaction_rule"/></p>
<p style="text-indent:2em;">4 Payment terms<span t-field="o.transaction_rule"/></p>
</td>
</tr>
</table>
......
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- 商机视图 -->
<record id="view_crm_lead_form_inherit" model="ir.ui.view">
<field name="name">crm.lead.inherit</field>
<field name="model">crm.lead</field>
......@@ -26,6 +26,20 @@
</field>
</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"
action="action_acc_quotation1"
parent="crm.crm_menu_sales"
......
......@@ -72,7 +72,7 @@
<field name="before_purchase_id" readonly="1"/>
<field name="acc_quotation_id" readonly="1"/>
<field name="origin_sale_order_id"/>
<!-- <field name="is_send"/> -->
<field name="sale_order_id"/>
<field name="send_date"/>
<field name="is_pay"/>
<field name="send_status"/>
......@@ -343,6 +343,8 @@
<field name="is_createso"/>
<field name="discount" />
<field name="ship_fee"/>
<field name="note1"/>
<field name="note4"/>
<!-- <field name="transaction_rule"/> -->
</group>
</group>
......
......@@ -60,29 +60,45 @@ class AccStockPicking(models.Model):
# readonly=True, required=True,
# states={'draft': [('readonly', False)]})
title = fields.Char(string='项目号')
# actual_location_id = fields.Many2one('stock.location',string='实际存放库位')
sale_order_id = fields.Many2one('sale.order',string='借用销售订单')
# @api.multi
# def button_validate(self):
# res = super(AccStockPicking,self).button_validate()
# po_name = self.origin
# po_obj = self.env['purchase.order'].search([('name', '=', po_name)])
# qty_received = []
# product_qty = []
# if po_obj:
# for line in po_obj.order_line:
# qty_received.append(line.qty_received)
# product_qty.append(line.product_qty)
# _logger.debug('===========%s===============', qty_received)
# _logger.debug('===========%s===============', product_qty)
# if sum(qty_received) == 0:
# po_obj.write({'product_state':'new'})
# elif sum(qty_received) < sum(product_qty) and sum(qty_received) != 0:
# po_obj.write({'product_state':'part'})
# sale_order_id = self.sale_order_id
# if sale_order_id:
# sale_order_id = self.sale_order_id
# move_product_ids = []
# sale_product_ids = []
# for move_line in self.move_ids_without_package:
# move_product_ids.append(move_line.product_id)
# for sale_line in self.sale_order_id.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:
# po_obj.write({'product_state':'all'})
# raise ValidationError('借用销售单中不存在交货产品,请确认')
# 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.depends('move_lines.date_expected')
def _compute_scheduled_date(self):
......@@ -269,6 +285,10 @@ class ExcipientsProduct(models.Model):
is_active = fields.Boolean(string='有效',default=True)
@api.multi
def draft_button(self):
self.env.user.notify_success(message='变更成功')
@api.onchange('product_id')
def onchange_product_id(self):
if self.product_id:
......
......@@ -72,196 +72,126 @@
</div> -->
<div class="row unovo-report-purchase-title">
<div class="col-xs-6" style="width: 50%;text-align: left;">
<!-- <img t-att-src="'data:image/jpg;base64,%s' % o.purchase_company.logo" style="max-height: 45px;"/> -->
<img t-att-src="'data:image/png;base64,%s' % logo" style="max-height: 110px;width:170px"/>
</div>
<!-- <div class="col-xs-6" style="width: 50%;text-align: right;color:#3d85c6;">
<strong style="max-height: 70px;width:250px">QUOTATION</strong>
</div> -->
</div>
<!-- <div class="row unovo-report-purchase-footer">
<div class="col-xs-6" style="width: 100%;text-align: right;">
<p>报价单编号:<span t-field="o.name"/></p>
</div>
</div> -->
<br/>
<img t-att-src="'data:image/png;base64,%s' % logo" style="max-height: 2000px;width:170px"/>
</div>
<div class="col-xs-6" style="width: 50%;text-align: left;">
<div class="unovo-report-purchase-content">
<p>
<p><span t-field="so_obj.sale_company.name"/></p>
<p><span t-field="o.so_obj.sale_company.name"/></p>
<p>上海市闵行区联航路1588号中心大道西路18栋</p>
<p>Tel: 0086-21-6220 8090</p>
<p>Fax:0086-21-5102 6636</p>
<p>Email: info@neotel-technology.com</p>
<p>电话: 0086-21-6220 8090</p>
<p>传真:0086-21-5102 6636</p>
<p>邮箱: info@neotel-technology.com</p>
</p>
</div>
</div>
</div>
<br/>
<div class="unovo-report-purchase-title">出货单</div>
<br/>
<div class="unovo-report-purchase-content">
<p>
开单日期:<span t-esc="partner_info.get('now_date', '')"/>
客户订单号:<span t-field="so_obj.partner_ponumber"/>
</p>
<p>
SO:<span t-field="so_obj.name"/>
</p>
<p>
出货日期:<span t-esc="partner_info.get('now_date', '')"/>
</p>
</div>
<br/>
<div class="unovo-report-purchase-content">
<div style="text-align:left">
<span style="float:left;width:50%">
出货公司:<span t-field="so_obj.sale_company"/>
</span>
<span style="float:left;width:50%">
收货公司:<span t-field="o.partner_id.name"/>
</span>
<span style="float:left;width:50%">
联系人:<span t-field="so_obj.user_id.name"/>
</span>
<span style="float:left;width:50%">
联系人:
</span>
<span style="float:left;width:50%">
联系电话:<span t-field="so_obj.user_id.phone"/>
</span>
<span style="float:left;width:50%">
联系电话:
</span>
<span style="float:left;width:50%">
&amp;nbsp;
</span>
<span style="float:left;width:50%">
收货地址:<span t-field="o.partner_id.street"/>
</span>
</div>
</div>
<table class="unovo-report-purchase-table" border="1px" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="3" class="text-center" style="width:15%;">
购货单位
</td>
<td class="text-center" style="width:15%;">
名称
</td>
<td colspan="2" class="text-center" style="width:25%;">
<span t-field="so_obj.partner_id.name"/>
</td>
<td class="text-center" style="width:25%;">
税务登记号
</td>
<td class="text-center" style="width:20%;">
<!-- <span t-field="so_obj.partner_id.name"/> -->
</td>
</tr>
<tr>
<td class="text-center">
联系人
</td>
<td colspan="2" class="text-center">
<span t-field="so_obj.contact_id.name"/>
</td>
<td class="text-center">
<!-- 税务登记号 -->
</td>
<td class="text-center">
<!-- <span t-field="so_obj.partner_id.name"/> -->
</td>
</tr>
<tr>
<td class="text-center">
电话
</td>
<td colspan="2" class="text-center">
<span t-field="so_obj.partner_id.phone"/>
</td>
<td class="text-center">
开户银行及账号
</td>
<td class="text-center">
<span t-esc="partner_info.get('bank_number', '')"/> <span t-esc="partner_info.get('bank_number', '')"/>
</td>
</tr>
<tr>
<th>
订单日期
<th class="text-center" style="width:15%;">
<strong>产品名称</strong>
</th>
<!-- <th>
<strong>物料编码</strong>
</th> -->
<th>
订单号
<th class="text-center" style="width:15%;">
<strong>产品型号</strong>
</th>
<!-- <th>
产品名称
<th class="text-center" style="width:35%;">
<strong>描述</strong>
</th>
<th>
料号/描述
</th> -->
<th colspan="2">
品名/型号
<th class="text-center" style="width:10%;">
<strong>数量</strong>
</th>
<th>
数量
<th class="text-center" style="width:10%;">
<strong>包装方式</strong>
</th>
<th>
单位
<th class="text-center" style="width:10%;">
<strong>包装数量</strong>
</th>
</tr>
<tr t-foreach="so_obj.quotation_line" t-as="line">
<td class="text-center">
<span t-esc="partner_info.get('now_date', '')"/>
<span t-field="line.product_id.product_tmpl_id.name"/>
</td>
<td class="text-center">
<span t-esc="so_obj.partner_ponumber"></span>
<span t-field="line.product_id.product_tmpl_id.product_model"/>
</td>
<!-- <td class="text-center">
<span t-esc="line.product_id.product_tmpl_id.name"></span>
<td style="text-align:left;">
<span t-field="line.product_id.product_tmpl_id.product_describe_cn"/>
</td>
<td class="text-center">
<span t-esc="line.product_id.product_tmpl_id.product_model"></span>
</td> -->
<td colspan="2" class="text-center">
<span t-esc="line.product_id.product_tmpl_id.name"></span>
<span t-esc="line.product_id.product_tmpl_id.product_model"></span>
</td>
<td class="text-center">
<span t-esc="line.product_qty"></span>
</td>
<td class="text-center">
<span t-esc="line.product_uom.name"></span>
</td>
</tr>
<tr>
<td rowspan="3" class="text-center">
销货单位
</td>
<td class="text-center">
名称
</td>
<td colspan="2" class="text-center">
<span t-field="so_obj.sale_company.name"/>
</td>
<td class="text-center">
税务登记号
</td>
<td class="text-center">
<!-- <span t-field="so_obj.partner_id.name"/> -->
</td>
</tr>
<tr>
<td class="text-center">
联系人
</td>
<td colspan="2" class="text-center">
<span t-field="so_obj.charge_person.name"/>
</td>
<td class="text-center">
<!-- 税务登记号 -->
</td>
<td class="text-center">
<!-- <span t-field="so_obj.partner_id.name"/> -->
</td>
</tr>
<tr>
<td class="text-center">
电话
</td>
<td colspan="2" class="text-center">
86-21-62208085 86-21-62208090
<span t-field="line.product_qty"/>
</td>
<td class="text-center">
开户银行及账号
<span t-field="line.product_uom.name"/>
</td>
<td class="text-center">
<span t-field="so_obj.sale_company.bank"/><span t-field="so_obj.sale_company.bank_number"/>
<span t-field="line.product_uom.name"/>
</td>
</tr>
</table>
<br/>
<br/>
<div class="unovo-report-purchase-content" style="text-align:right">
<div class="unovo-report-purchase-content" >
<p>
<p>客户签名:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</p>
<p>公司盖章:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</p>
<p>日期:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</p>
运输方式:
</p>
<p>
物流单号:
</p>
<br/>
<br/>
<p>
客户签字:
</p>
<br/>
<p>
日期:
</p>
</div>
<!-- <div class="row unovo-report-purchase-title">
<div class="col-xs-6" style="width: 100%;text-align: center;">
<img t-att-src="'data:image/png;base64,%s' % qr_code" style="max-height: 2100px;width:210px"/>
</div>
</div> -->
<!-- <div class="footer">
<div class="col-xs-6" style="width: 100%;text-align: right;">
<img t-att-src="'data:image/png;base64,%s' % qr_code" style="max-height: 70px;width:70px"/>
</div>
</div> -->
</div>
<div style="page-break-after:always;"></div>
</t>
......
......@@ -85,6 +85,7 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='origin']" position="after">
<field name="title"/>
<!-- <field name="sale_order_id" attrs="{'invisible': [('picking_type_code', '=', 'incoming')]}"/> -->
</xpath>
</field>
</record>
......
......@@ -8,6 +8,9 @@
<field name="model">excipients.product</field>
<field name="arch" type="xml">
<form string="excipients product" version="12.0">
<header>
<button name="draft_button" string="确认生成" type="object"/>
</header>
<sheet>
<!-- <div class="oe_title">
<h1><field name="name" readonly="1"/></h1>
......
# -*- coding: utf-8 -*-
# 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_product_data
# from . import import_purchase_data
......
......@@ -10,26 +10,26 @@ class ChooseMove(models.TransientModel):
stock_moves = fields.Many2many('stock.move', string='moves')
# 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
# @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
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!