Commit 683f8149 董杰

合并分支 'dongjie0423' 到 'master'

Dongjie0423

查看合并请求 !3
2 个父辈 8fcdda3e 018e0b7f
正在显示 126 个修改的文件 包含 1052 行增加100 行删除
# -*- coding: utf-8 -*-
from . import models
from . import report
\ No newline at end of file
from . import report
from . import wizard
\ No newline at end of file
......@@ -32,5 +32,7 @@
'report/purchase_invoice_report_views.xml',
'views/base_menu.xml',
'views/report_menu.xml',
'wizard/update_date_view.xml',
],
}
\ No newline at end of file
......@@ -61,6 +61,7 @@ class AccPurchaseInvoice(models.AbstractModel):
res = {}
if len(docids)>1:
final_total = 0.0
final_residual = 0.0
po_names = ''
note_str = ''
bank_str = ''
......@@ -82,6 +83,7 @@ class AccPurchaseInvoice(models.AbstractModel):
if invoice_model.invoice_number:
invoice_str += invoice_model.invoice_number + ','
final_total += amount_total
final_residual += invoice_model.residual
res = {
'amount_total':final_total,
'po_names':po_names,
......@@ -89,7 +91,7 @@ class AccPurchaseInvoice(models.AbstractModel):
'bank_str':bank_str,
'invoice_str':invoice_str,
'today':today,
'residual':invoice_model.residual
'residual':final_residual
}
else:
po_names = ''
......
......@@ -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"/> -->
......
......@@ -57,9 +57,21 @@
<!-- <xpath expr="//button[@name='action_invoice_open']" position="before">
<button name="teller_accept" string="出纳审核" type="object" states="open" class="oe_highlight" groups="acct_base.acc_account_user_group"/>
</xpath> -->
<xpath expr="//button[@name='action_invoice_sent'][1]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='action_invoice_sent'][2]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='preview_invoice']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='action_invoice_open']" position="before">
<button name="boss_accept" string="财务审核" type="object" states="teller" class="oe_highlight" groups="acct_base.acc_account_user_group"/>
</xpath>
<xpath expr="//button[@name='action_invoice_open']" position="before">
<button name="%(update_date_wizard)d" states="open" type="action" string="更新到期日期" class="oe_highlight"/>
</xpath>
<xpath expr="//button[@name='action_invoice_open']" position="after">
<button name="add_sale_discount_line" string="添加折扣" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
</xpath>
......@@ -90,25 +102,32 @@
</tree>
</field>
<group class="oe_subtotal_footer oe_right">
<field name="invoice_acc_total" nolabel="1" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_subtotal_footer_separator" />
<field name="invoice_acc_total" nolabel="1" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_subtotal_footer_separator"/>
</group>
</page>
</xpath>
</field>
</record>
<!-- account.invoice tree视图 -->
<!-- <record model="ir.ui.view" id="account_invoice_acc_tree_view">
<field name="name">account.invoice.acc.tree</field>
<!-- 账单增加搜索条件视图 -->
<record id="acc_account_invoice_search_inherit_view" model="ir.ui.view">
<field name="name">acc.account.invoice.search</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="product.product_template_tree_view"/>
<field name="mode">primary</field>
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="internal_des"/>
<field name="partner_code"/>
<field name="product_model"/>
</field>
<xpath expr="//field[@name='user_id']" position="after">
<separator/>
<!-- <filter name="state" string="未到货" domain="[('state','=', 'draft')]"/> -->
<!-- <filter string="My Activities" name="activities_my" domain="[('activity_ids.user_id', '=', uid)]"/>
<separator/> -->
<filter string="逾期账单" name="activities_overdue" domain="[('date_due', '&lt;', context_today().strftime('%Y-%m-%d'))]"/>
<filter string="今日到期账单" name="activities_today" domain="[('date_due', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter string="本月到期账单" name="month"
domain="[('date_due','&gt;=', time.strftime('%Y-%m-01')),('date_due','&lt;', (context_today() + relativedelta(months=1)).strftime('%Y-%m-01') ) ]"/>
<!-- <filter string="Future Activities" name="activities_upcoming_all" domain="[('activity_ids.date_deadline', '&gt;', context_today().strftime('%Y-%m-%d')) ]"/> -->
</xpath>
</field>
</record> -->
</record>
</data>
</openerp>
# -*- coding: utf-8 -*-
from . import update_date
\ No newline at end of file
#coding=utf-8
from odoo import models,fields,api, _
import datetime
import logging
from odoo.exceptions import UserError, ValidationError
_logger = logging.getLogger(__name__)
class UpdateDate(models.TransientModel):
_name = "update.date"
date_due = fields.Date(string='到期日期',required=True)
@api.multi
def update_date_due(self):
date_due = self.date_due
context = dict(self._context or {})
active_id = context.get('active_id', False)
# if active_id:
# before_model = self.env['before.purchase'].browse(active_id)
# for line in before_model.order_line:
# if line.brand == brand:
# line.write()
if active_id:
active_model = self.env['account.invoice'].browse(active_id)
# cr = self.env.cr
# cr.execute("""
# UPDATE account_invoice
# SET partner_id = %s
# WHERE
# brand = '%s'
# AND order_id = %s
# """% (partner_id.id,brand,active_id)
# )
active_model.write({'date_due':date_due})
return True
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!--导数据-->
<record id="update_date_form_view" model="ir.ui.view">
<field name="name">更新账单到期日期</field>
<field name="model">update.date</field>
<field name="arch" type="xml">
<form string="updatedate">
<sheet>
<group>
<field name='date_due'/>
</group>
<footer name="codes">
<button class="oe_stat_button" name="update_date_due" string="更新" type="object"/>
</footer>
</sheet>
</form>
</field>
</record>
<record id="update_date_wizard" model="ir.actions.act_window">
<field name="name">更新到期日期</field>
<field name="res_model">update.date</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<!-- <field name="context">{"type":"vmc_watergodcard"}</field> -->
<field name="view_id" ref="update_date_form_view"/>
<field name="target">new</field>
</record>
<!-- <menuitem id="import_bom_data" name="供应商数据导入" parent="acct_data_import_menu" sequence="1" action="import_partner_data_wizard"/> -->
</data>
</odoo>
\ No newline at end of file
......@@ -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@041"
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"/>
......
......@@ -71,6 +71,7 @@ class AccHrExpenseSheet(models.Model):
subjects = "{}费用报销单{}审批".format(self.employee_id.name,self.name)
message = "{}的费用报销单{}需要您审批,请及时处理".format(self.employee_id.name,self.name)
self.env['acc.tools'].send_report_email(subjects,message,toaddrs)
self.env.user.notify_success(message='提交成功')
@api.multi
def approve_expense_sheets(self):
......@@ -100,6 +101,7 @@ class AccHrExpenseSheet(models.Model):
subjects = "{}费用报销单{}审批".format(self.employee_id.name,self.name)
message = "{}的费用报销单{}管理部已批准,请及时处理".format(self.employee_id.name,self.name)
self.env['acc.tools'].send_report_email(subjects,message,toaddrs)
self.env.user.notify_success(message='审核成功')
return True
def save_exel(self, header, body, file_name):
......
......@@ -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)
......
......@@ -48,6 +48,7 @@ class CFTemplateCategory(models.Model):
('done', 'Locked'),
('cancel', 'Cancelled')
], string='Status', readonly=True, index=True, copy=False, default='draft', track_visibility='onchange')
color = fields.Integer(string='Color Index')
crm_ponumber = fields.Char(string=u'老采购单号',readonly=True)
charge_person = fields.Many2one('res.users',string=u'负责人',default=lambda self: self.env.user.id,required=True)
traffic_rule = fields.Char(string=u'运输条款',required=True)
......@@ -168,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)
......@@ -376,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
......@@ -592,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):
"""
导出采购单信息
......@@ -615,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
......@@ -647,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:
......@@ -656,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)
......
......@@ -4,6 +4,7 @@ from odoo import fields, models, api, http, _
from odoo.addons import decimal_precision as dp
from odoo.http import request
from odoo.exceptions import UserError, ValidationError
import random
class BeforePurchase(models.Model):
"""
......@@ -30,6 +31,8 @@ class BeforePurchase(models.Model):
charge_person = fields.Many2one('res.users',string='采购负责人')
gen_datetime = fields.Datetime(string='生成时间',default=lambda self: fields.Datetime.now(),)
po_number = fields.Text(string='关联的采购单',readonly=True)
color = fields.Integer(string='颜色')
purchase_order_ids = fields.Many2many('purchase.order','before_purchase_rel','before_id','purchase_id',string='关联采购单',readonly=True)
purchase_company = fields.Many2one('acc.company',string='采购公司',required=True)
delivery_address = fields.Many2one('delivery.address',string='交货地址')
state = fields.Selection([('draft', '待确认'), ('done', '已确认'),('cancel', '已取消')], '状态', default='draft',track_visibility='onchange')
......@@ -76,6 +79,7 @@ class BeforePurchase(models.Model):
}
res_line = [(0,0,line_vals)]
po_vals = {
'color':random.randint(1, 12),
'partner_id':line.partner_id.id,
'title':self.name,
'before_purchase_id':self.id,
......@@ -93,7 +97,8 @@ class BeforePurchase(models.Model):
}
if not exits_order:
po_obj = self.env['purchase.order'].create(po_vals)
self.add_ponumber(po_obj)
# self.add_ponumber(po_obj)
self.add_ponumbers(po_obj)
if exits_order:
exits_order.write({'order_line':res_line})
# self.write({'purchase_date':fields.Datetime.now(),'is_purchasing':True})
......@@ -132,6 +137,12 @@ class BeforePurchase(models.Model):
sale_order.write({'po_number':new_po_name})
self.write({'po_number':new_po_name})
@api.multi
def add_ponumbers(self,pobj):
po_id = pobj.id
self.purchase_order_ids = [(4,po_id)]
return True
def merge_before_line(self):
order_id = self.id
......@@ -188,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 = " 待确认询价单明细"
......
......@@ -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"/>
......
......@@ -26,7 +26,8 @@
<field name="sale_order_id" readonly="1"/>
<field name="demand_purchase_id" readonly="1"/>
<field name="is_excipients" readonly="1"/>
<field name="po_number" />
<!-- <field name="po_number" /> -->
<field name="purchase_order_ids" widget="many2many_tags" options="{'color_field': 'color','no_create_edit': True}"/>
<field name="delivery_address"/>
</group>
<group>
......
......@@ -86,31 +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 = "商机“{}”,关联客户“{}”,销售员已变更为“{}”,详细信息请在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)
......@@ -384,6 +386,7 @@ class AccSaleOrder(models.Model):
# for remove_id in remove_ids:
# 删除的东西怎么处理?
self.change_bom_record()
self.env.user.notify_success(message='变更成功')
# self.write({'before_purchase_id':bp_obj.id})
#
#
......@@ -510,6 +513,53 @@ class AccSaleOrder(models.Model):
message = "待确认询价单{}已生成,请及时处理".format(bp_obj.name)
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
......@@ -517,6 +567,19 @@ class AccSaleOrder(models.Model):
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
......@@ -534,6 +597,7 @@ class AccSaleOrder(models.Model):
subjects = "销售单{}已提交需要您确认,请及时处理".format(self.name)
message = "销售单{}已提交需要您确认,请及时处理".format(self.name)
self.env['acc.tools'].send_report_email(subjects,message,toaddrs)
self.env.user.notify_success(message='提交成功')
return True
# @api.multi
......@@ -698,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)
......
......@@ -194,6 +194,15 @@
<table cellspacing="3" style="width:20%;" align="right">
<tr>
<th>
税金(<span t-field="o.pricelist_id.currency_id.name"/>)
</th>
<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_tax" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<th>
合计(<span t-field="o.pricelist_id.currency_id.name"/>)
</th>
<td>
......
......@@ -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:
......@@ -296,7 +316,7 @@ class ExcipientsProduct(models.Model):
AND product_id = %s """%(location_id, p_id)
# now_qty = cr.execute(now_qty_sql, (location_id,p_id))
cr.execute(now_qty_sql)
result = request.cr.dictfetchall()
result = cr.dictfetchall()
if result[0]['theory_qty']:
now_qty = result[0]['theory_qty']
else:
......@@ -350,7 +370,7 @@ class ExcipientsProduct(models.Model):
AND product_id = %s """%(location_id, p_id)
# now_qty = cr.execute(now_qty_sql, (location_id,p_id))
cr.execute(now_qty_sql)
result = request.cr.dictfetchall()
result = cr.dictfetchall()
if result[0]['theory_qty']:
now_qty = result[0]['theory_qty']
else:
......
......@@ -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
......@@ -18,14 +18,14 @@ except ImportError:
import time
import base64
import socket
import paramiko
# import paramiko
try:
import paramiko
except ImportError:
raise ImportError(
'This module needs paramiko to automatically write backups to the FTP through SFTP. Please install paramiko on your system. (sudo pip3 install paramiko)')
# try:
# import paramiko
# except ImportError:
# raise ImportError(
# 'This module needs paramiko to automatically write backups to the FTP through SFTP. Please install paramiko on your system. (sudo pip3 install paramiko)')
def execute(connector, method, *args):
......@@ -147,7 +147,8 @@ class DbBackup(models.Model):
for rec in conf_ids:
db_list = self.get_db_list(rec.host, rec.port)
print (db_list)
print (rec.folder)
if rec.name in db_list:
try:
if not os.path.isdir(rec.folder):
......
# -*- coding: utf-8 -*-
from . import controllers
\ No newline at end of file
# -*- coding: utf-8 -*-
{
'name': "Document Preview",
'summary': """
Document Preview allows users to preview a document without downloading it that leads to saving
time and storage of users.
""",
'description': """
Best Odoo Document Preview Apps
Odoo Document Preview Apps
Document Preview Apps
Odoo Documents Preview Apps
Documents Preview Apps
Odoo Preview Document Apps
Preview Document Apps
View Document Apps
Odoo View Document Apps
Document View Apps
Display Document Preview Apps
Odoo Display Document Preview Apps
PDF Document Preview Apps
Odoo PDF Document Preview Apps
Video Document Preview Apps
Odoo Video Document Preview Apps
Image Document Preview Apps
Show Document Apps
Binary Preview Apps
Binary File Preview Apps
File Preview Apps
Show File Document
Display Birany Files
Show Attachment Files
Display Attachment Files
Display Files
Check PDF Files
Check File
Check Image
Document Checker
File Checker
Report Preview
Odoo Report Preview
Document Management System
Document Management Portal
Document Preview Portal
Document Views In Website Portal
Document Version
Document Extension
Document Viewer PDF
MuK Documents View
Asset Documents Management
""",
'author': "Ksolves India Pvt. Ltd.",
'license': 'LGPL-3',
'website': "https://www.ksolves.com",
'category': 'Tools',
'support': 'sales@ksolves.com',
'images': ['static/description/banners/banner1.gif'],
'version': '12.0.1.0.0',
'depends': ['base', 'web', 'mail'],
'data': [
'views/ks_preview_templates.xml',
],
'qweb': ['static/src/xml/ks_binary_preview.xml',
],
}
\ No newline at end of file
# -*- coding: utf-8 -*-
#################################################################################
# Author : Webkul Software Pvt. Ltd. (<https://webkul.com/>)
# Copyright(c): 2015-Present Webkul Software Pvt. Ltd.
# License URL : https://store.webkul.com/license.html/
# All Rights Reserved.
#
#
#
# This program is copyright property of the author mentioned above.
# You can`t redistribute it and/or modify it.
#
#
# You should have received a copy of the License along with this program.
# If not, see <https://store.webkul.com/license.html/>
#################################################################################
from . import main
\ No newline at end of file
# -*- coding: utf-8 -*-
from odoo import fields, http, _
from odoo.http import request
class ks_file_preview(http.Controller):
# Controller: Get the file details
@http.route(['/get/record/details'], type='json', auth="public", methods=['POST'], website=True)
def GetRecordData(self,res_id, model, size, res_field, **kw):
data_file = {}
data = request.env['ir.attachment'].sudo().search([('res_model', '=', model), ('res_id', '=', res_id), ('res_field', '=', res_field)])
div = 2014
if size[-2:] == 'Kb' or size[-2:] == 'kb':
div = 1024
elif size[-2:] == 'Mb' or size[-2:] == 'mb':
div = 1024*1024
elif size[-5:] == 'bytes' or size[-5:] == 'Bytes':
div = 1
size = size[:-3]
for d in data:
if float(size[:-3]) == round(d.file_size/div, 2):
data_file = {
'name': d.name or d.dispay_name,
'id': d.id,
'type': d.mimetype,
}
break
return data_file
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * ks_binary_file_preview
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-30 13:34+0000\n"
"PO-Revision-Date: 2019-08-30 13:34+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: ks_binary_file_preview
#. openerp-web
#: code:addons/ks_binary_file_preview/static/src/xml/ks_binary_preview.xml:3
#, python-format
msgid "Preview"
msgstr ""
<?xml version="1.0" encoding="UTF-8"?>
<svg width="475px" height="403px" viewBox="0 0 475 403" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 55.1 (78136) - https://sketchapp.com -->
<title>check</title>
<desc>Created with Sketch.</desc>
<g id="Page-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Artboard" transform="translate(-455.000000, -400.000000)" fill-rule="nonzero">
<g id="check" transform="translate(455.000000, 400.000000)">
<path d="M396.283,221.097 C395.143,220.522 394.001,220.235 392.85,220.235 C390.372,220.235 388.189,221.186 386.287,223.092 L368.013,241.363 C366.305,243.078 365.447,245.169 365.447,247.646 L365.447,320.159 C365.447,332.724 360.984,343.473 352.032,352.423 C343.087,361.368 332.331,365.841 319.768,365.841 L82.226,365.841 C69.662,365.841 58.907,361.368 49.962,352.423 C41.015,343.474 36.544,332.725 36.544,320.159 L36.544,82.622 C36.544,70.06 41.015,59.306 49.962,50.358 C58.907,41.412 69.662,36.94 82.226,36.94 L319.77,36.94 C323.958,36.94 328.24,37.511 332.617,38.654 C333.76,39.032 334.616,39.225 335.18,39.225 C337.658,39.225 339.848,38.276 341.75,36.373 L355.74,22.383 C358.022,20.102 358.882,17.34 358.306,14.107 C357.735,11.061 356.02,8.871 353.165,7.54 C342.893,2.788 331.753,0.401 319.762,0.401 L82.226,0.401 C59.576,0.401 40.208,8.443 24.124,24.527 C8.042,40.613 0,59.978 0,82.629 L0,320.172 C0,342.819 8.042,362.186 24.125,378.27 C40.209,394.358 59.577,402.4 82.227,402.4 L319.768,402.4 C342.415,402.4 361.785,394.358 377.869,378.27 C393.954,362.186 402.003,342.82 402.003,320.172 L402.003,229.375 C402.003,225.381 400.088,222.623 396.283,221.097 Z" id="Path" fill="#F7B500"></path>
<path d="M467.95,57.216 L436.541,25.807 C431.973,21.24 426.545,18.956 420.262,18.956 C413.987,18.956 408.555,21.24 403.991,25.807 L219.265,210.532 L144.181,135.443 C139.612,130.873 134.186,128.592 127.907,128.592 C121.627,128.592 116.203,130.873 111.633,135.443 L80.228,166.848 C75.66,171.416 73.374,176.842 73.374,183.125 C73.374,189.405 75.66,194.829 80.228,199.399 L202.995,322.166 C207.564,326.737 212.99,329.017 219.269,329.017 C225.548,329.017 230.973,326.738 235.543,322.166 L467.947,89.763 C472.512,85.196 474.801,79.769 474.801,73.489 C474.801,67.209 472.518,61.783 467.95,57.216 Z" id="Path" fill="#040404"></path>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 180"><defs><style>.cls-1{fill:#e92727;}.cls-2,.cls-5{fill:#fff;stroke-miterlimit:10;}.cls-2{stroke:#e8e8e8;}.cls-3{fill:#c82128;}.cls-4{fill:#e72728;}.cls-5{stroke:#e92727;stroke-width:1.5px;}.cls-6{fill:#444;}.cls-6,.cls-7{fill-rule:evenodd;}.cls-7{fill:#e32235;}</style></defs><title>Ads Layout2</title><path class="cls-1" d="M108.25,66.8h0a46.86,46.86,0,0,1,93.71,0h3a49.9,49.9,0,0,0-99.79,0h3Z"/><path class="cls-2" d="M283.34,180H16C7.37,180,.32,172.72.32,163.82V82.6C.32,73.7,7.37,66.41,16,66.41H283.34C292,66.41,299,73.7,299,82.6v81.22C299,172.72,292,180,283.34,180Z"/><path class="cls-3" d="M284,180H24.1C10.84,180,0,172.74,0,163.88V82.47C0,73,3,64,22.15,66.35Z"/><path class="cls-4" d="M299,78.86v86.26s-.76,12.11-14.41,14.88H13.07A17.4,17.4,0,0,1,0,166.3V154.78Z"/><circle class="cls-5" cx="155.11" cy="65.75" r="33.39"/><path class="cls-6" d="M155.59,50.89V80.58a1.63,1.63,0,0,1-2.5,1.4c-1-.57-18.13-13.84-19.83-14.82a1.61,1.61,0,0,1-.64-2.16,1.63,1.63,0,0,1,.64-.66c1.22-.71,18.44-14,19.88-14.84A1.62,1.62,0,0,1,155.59,50.89Z"/><path id="Shape_3_copy" data-name="Shape 3 copy" class="cls-6" d="M178,58.59V72.9a.88.88,0,0,1-.86.91.8.8,0,0,1-.49-.14c-.53-.31-9.79-6.6-10.7-7.14a.9.9,0,0,1-.34-1.21A.92.92,0,0,1,166,65c.66-.39,10-6.72,10.73-7.16a.87.87,0,0,1,1.2.31A.93.93,0,0,1,178,58.59Z"/><path id="Shape_3_copy_2" data-name="Shape 3 copy 2" class="cls-7" d="M161.47,44.31V58.63a.88.88,0,0,0,.85.91.91.91,0,0,0,.49-.14c.54-.31,9.79-6.61,10.71-7.15a.88.88,0,0,0,.33-1.2.86.86,0,0,0-.33-.35c-.66-.39-10-6.72-10.74-7.16a.86.86,0,0,0-1.19.31A.83.83,0,0,0,161.47,44.31Z"/><path id="Shape_3_copy_3" data-name="Shape 3 copy 3" class="cls-7" d="M161.47,72.86V87.18a.88.88,0,0,0,.86.91.9.9,0,0,0,.48-.14c.54-.31,9.79-6.6,10.71-7.14a.9.9,0,0,0,0-1.55c-.66-.4-10-6.72-10.74-7.16a.85.85,0,0,0-1.19.31A.78.78,0,0,0,161.47,72.86Z"/></svg>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="459px" height="459px" viewBox="0 0 459 459" style="enable-background:new 0 0 459 459;" xml:space="preserve">
<g>
<g id="share">
<path d="M459,216.75L280.5,38.25v102c-178.5,25.5-255,153-280.5,280.5C63.75,331.5,153,290.7,280.5,290.7v104.55L459,216.75z" fill="#000"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="459px" height="459px" viewBox="0 0 459 459" style="enable-background:new 0 0 459 459;" xml:space="preserve">
<g>
<g id="share">
<path d="M459,216.75L280.5,38.25v102c-178.5,25.5-255,153-280.5,280.5C63.75,331.5,153,290.7,280.5,290.7v104.55L459,216.75z" fill="#007bff"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 12c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM6 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12-8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-4 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm4-4c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-4-4c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-4-4c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>
\ No newline at end of file
<svg height="512" viewBox="0 0 64 64" width="512" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="New_Gradient_Swatch_1" gradientUnits="userSpaceOnUse" x1="32" x2="32" y1="8.462" y2="55.216"><stop offset="0" stop-color="#fff33b"/><stop offset=".014" stop-color="#fee72e"/><stop offset=".042" stop-color="#fed51b"/><stop offset=".07" stop-color="#fdca10"/><stop offset=".1" stop-color="#fdc70c"/><stop offset=".4" stop-color="#f3903f"/><stop offset=".8" stop-color="#ed683c"/><stop offset="1" stop-color="#e93e3a"/></linearGradient><linearGradient id="New_Gradient_Swatch_1-2" x1="36" x2="36" xlink:href="#New_Gradient_Swatch_1" y1="8.462" y2="55.216"/><linearGradient id="New_Gradient_Swatch_1-3" x1="18" x2="18" xlink:href="#New_Gradient_Swatch_1" y1="8.462" y2="55.216"/><linearGradient id="New_Gradient_Swatch_1-5" x1="22" x2="22" xlink:href="#New_Gradient_Swatch_1" y1="8.462" y2="55.216"/><g id="Mail-6" data-name="Mail"><path d="m57 10h-50a5.006 5.006 0 0 0 -5 5v34a5.006 5.006 0 0 0 5 5h50a5.006 5.006 0 0 0 5-5v-34a5.006 5.006 0 0 0 -5-5zm-50 2h50a3 3 0 0 1 3 3v.46l-28 18.345-28-18.345v-.46a3 3 0 0 1 3-3zm53 5.851v27.383l-21.817-13.09zm-34.183 14.293-21.817 13.09v-27.383zm31.183 19.856h-50a3 3 0 0 1 -3-3v-1.434l23.675-14.2 3.777 2.474a1 1 0 0 0 1.1 0l3.777-2.474 23.671 14.2v1.434a3 3 0 0 1 -3 3z" fill="url(#New_Gradient_Swatch_1)"/><path d="m22 48h28v2h-28z" fill="url(#New_Gradient_Swatch_1-2)"/><path d="m16 48h4v2h-4z" fill="url(#New_Gradient_Swatch_1-3)"/><path d="m26 44h20v2h-20z" fill="url(#New_Gradient_Swatch_1-2)"/><path d="m20 44h4v2h-4z" fill="url(#New_Gradient_Swatch_1-5)"/></g></svg>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<path style="fill:black;" d="M256,512C114.844,512,0,397.156,0,256S114.844,0,256,0s256,114.844,256,256S397.156,512,256,512z" fill="black"/>
<path style="fill:black;" d="M375.467,426.667c-141.156,0-256-114.844-256-256c0-59.087,20.318-113.41,54.071-156.783
C72.768,48.311,0,143.72,0,256c0,141.156,114.844,256,256,256c82.069,0,155.049-38.974,201.929-99.217
C432.012,421.638,404.342,426.667,375.467,426.667z"/>
<path style="fill:#FFFFFF;" d="M203.034,388.414c-4.518,0-9.038-1.725-12.483-5.173L84.62,277.31
c-6.897-6.892-6.897-18.073,0-24.966c6.888-6.897,18.078-6.897,24.966,0l93.449,93.444l181.724-181.72
c6.888-6.897,18.078-6.897,24.966,0c6.897,6.892,6.897,18.073,0,24.966L215.517,383.241
C212.073,386.689,207.552,388.414,203.034,388.414z"/>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 52 52" style="enable-background:new 0 0 52 52;" xml:space="preserve">
<path d="M26,0C11.664,0,0,11.663,0,26s11.664,26,26,26s26-11.663,26-26S40.336,0,26,0z M38.5,28H28v11c0,1.104-0.896,2-2,2
s-2-0.896-2-2V28H13.5c-1.104,0-2-0.896-2-2s0.896-2,2-2H24V14c0-1.104,0.896-2,2-2s2,0.896,2,2v10h10.5c1.104,0,2,0.896,2,2
S39.604,28,38.5,28z"/>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<svg id="Layer_1" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg" data-name="Layer 1"><path d="m466.17 363.03v69.65h-154.45-111.44-154.45v-69.65z" fill="#00efd1"/><path d="m466.17 97.26v265.77h-420.34v-265.77h90.28l-1.01 185.81s85.71.01 144.77.01a61.835 61.835 0 1 0 55.2-89.71c-.16 0-.33 0-.49.01v-96.12z" fill="#fedb41"/><path d="m390.03 40.81v31.65h-55.45v-31.65a27.668 27.668 0 0 1 27.63-27.72h.1a27.662 27.662 0 0 1 27.72 27.63z" fill="#f4b844"/><path d="m284.14 220.14a61.691 61.691 0 0 1 50.44-26.76c.16-.01.33-.01.49-.01a61.828 61.828 0 1 1 -50.93 26.77z" fill="#00efd1"/><path d="m136.11 97.26.31-58.1a26.2 26.2 0 0 1 26.4-26.07h199.39a27.668 27.668 0 0 0 -27.63 27.72v152.57a61.844 61.844 0 0 0 -54.71 89.7c-59.06 0-144.77-.01-144.77-.01zm147.68-2.95a49.545 49.545 0 1 0 -49.54 49.54 49.54 49.54 0 0 0 49.54-49.54z" fill="#00acea"/><path d="m311.72 432.68 18.57 66.23h-148.58l18.57-66.23z" fill="#00acea"/><path d="m234.25 44.77a49.54 49.54 0 1 1 -49.55 49.54 49.54 49.54 0 0 1 49.55-49.54z" fill="#00efd1"/><g fill="#083863"><path d="m466.17 91h-125.17v-13h49.03c3.313 0 5.97-2.227 5.97-5.54v-31.748a33.714 33.714 0 0 0 -33.729-33.712h-199.451a32.2 32.2 0 0 0 -32.4 31.953l-.278 52.047h-84.312a6.085 6.085 0 0 0 -5.83 6.26v335.42c0 3.314 2.516 6.32 5.83 6.32h146.536l-15.205 54h-26.591a6 6 0 1 0 0 12h210.86a6 6 0 1 0 0-12h-26.591l-15.2-54h146.531c3.314 0 5.83-3.006 5.83-6.32v-335.42a6.085 6.085 0 0 0 -5.83-6.26zm-186.93 164.2a55.433 55.433 0 0 1 9.7-31.441c.1-.131.193-.264.281-.4a56.03 56.03 0 0 1 45.4-24.162c.107 0 .17-.194.278-.194h.169a55.969 55.969 0 1 1 -49.846 81.325v.023a55.139 55.139 0 0 1 -5.982-25.151zm83.082-236.2h.043a21.715 21.715 0 0 1 21.635 21.81v25.19h-43v-25.2a21.312 21.312 0 0 1 21.323-21.71l-.061-6.045zm-220.212 78.292.31-58.177a20.3 20.3 0 0 1 20.4-20.115h173.667c-5.129 6-7.487 13.779-7.487 21.81v146.88a59.615 59.615 0 0 0 -15.058 3.151 6.458 6.458 0 0 0 -4.542-1.841h-149.13a6 6 0 1 0 0 12h134.076a76.664 76.664 0 0 0 -13.257 13h-120.819a6 6 0 1 0 0 12h113.5a73.584 73.584 0 0 0 -4.652 13h-108.848a6 6 0 1 0 0 12h107.092c-.073 2-.122 2.743-.122 4.045a67.808 67.808 0 0 0 3.606 21.955c-48.62 0-110.419.031-129.713.029zm180.266 395.708h-132.752l15.205-54h102.342zm137.624-66h-408v-58h408zm-408-70v-254h78.077l-.977 179.907a6.151 6.151 0 0 0 1.746 4.329 6.03 6.03 0 0 0 4.254 1.8s82.325.026 141.206.027a67.514 67.514 0 0 0 58.764 33.958c37.4 0 68.04-30.424 68.04-67.826 0-35.545-28.11-64.767-62.11-67.583v-84.612h119v254z"/><path d="m234.25 149.85a55.54 55.54 0 1 0 -55.55-55.54 55.6 55.6 0 0 0 55.55 55.54zm0-99.08a43.54 43.54 0 1 1 -43.55 43.54 43.589 43.589 0 0 1 43.55-43.54z"/><path d="m234.25 113.02a5.622 5.622 0 0 1 -5.62-5.61 6 6 0 1 0 -12 0 17.621 17.621 0 0 0 10.37 16.032v2.558a6 6 0 0 0 12 0v-1.649a17.6 17.6 0 0 0 -4.75-34.551 5.615 5.615 0 1 1 5.61-5.62 6 6 0 0 0 12 0 17.627 17.627 0 0 0 -11.86-16.627v-2.553a6 6 0 0 0 -12 0v2.735a17.6 17.6 0 0 0 6.25 34.065 5.61 5.61 0 1 1 0 11.22z"/><path d="m160.27 176h149.13a6 6 0 0 0 0-12h-149.13a6 6 0 1 0 0 12z"/><path d="m324.737 273.222a6 6 0 0 0 4.248 1.778h.015a6 6 0 0 0 4.243-1.757l27.61-27.61a6 6 0 1 0 -8.486-8.486l-23.346 23.347-11.228-11.336a6 6 0 0 0 -8.526 8.444z"/></g></svg>
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 966.653 966.653" style="enable-background:new 0 0 966.653 966.653;" xml:space="preserve">
<g>
<g id="smartphone_1_">
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="483.3267" y1="995.5009" x2="483.3267" y2="-20.2906" gradientTransform="matrix(1 0 0 -1 0 949.7782)">
<stop offset="0" style="stop-color:#FFF33B"/>
<stop offset="0.014" style="stop-color:#FEE72E"/>
<stop offset="0.042" style="stop-color:#FED51B"/>
<stop offset="0.07" style="stop-color:#FDCA10"/>
<stop offset="0.1" style="stop-color:#FDC70C"/>
<stop offset="0.4" style="stop-color:#F3903F"/>
<stop offset="0.8" style="stop-color:#ED683C"/>
<stop offset="1" style="stop-color:#E93E3A"/>
</linearGradient>
<path style="fill:url(#SVGID_1_);" d="M694.718,0H271.936c-25.606,0.027-46.357,20.778-46.383,46.383V920.27
c0.027,25.606,20.778,46.357,46.383,46.383h422.782c25.606-0.027,46.357-20.778,46.383-46.383V46.383
C741.074,20.778,720.323,0.027,694.718,0z M271.936,32.222h422.782c7.814,0.018,14.144,6.348,14.161,14.161v50.282H257.774V46.383
C257.792,38.569,264.122,32.24,271.936,32.222z M708.879,128.887v708.879H257.774V128.887H708.879z M694.718,934.432H271.936
c-7.814-0.018-14.144-6.348-14.161-14.161v-50.282h451.105v50.282C708.861,928.084,702.531,934.414,694.718,934.432z"/>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="483.3267" y1="994.5021" x2="483.3267" y2="5.2613" gradientTransform="matrix(1 0 0 -1 0 949.7782)">
<stop offset="0" style="stop-color:#FFF33B"/>
<stop offset="0.014" style="stop-color:#FEE72E"/>
<stop offset="0.042" style="stop-color:#FED51B"/>
<stop offset="0.07" style="stop-color:#FDCA10"/>
<stop offset="0.1" style="stop-color:#FDC70C"/>
<stop offset="0.4" style="stop-color:#F3903F"/>
<stop offset="0.8" style="stop-color:#ED683C"/>
<stop offset="1" style="stop-color:#E93E3A"/>
</linearGradient>
<rect x="434.994" y="48.333" style="fill:url(#SVGID_2_);" width="96.665" height="32.222"/>
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="676.6573" y1="998.7875" x2="676.6573" y2="-11.0591" gradientTransform="matrix(1 0 0 -1 0 949.7782)">
<stop offset="0" style="stop-color:#FFF33B"/>
<stop offset="0.014" style="stop-color:#FEE72E"/>
<stop offset="0.042" style="stop-color:#FED51B"/>
<stop offset="0.07" style="stop-color:#FDCA10"/>
<stop offset="0.1" style="stop-color:#FDC70C"/>
<stop offset="0.4" style="stop-color:#F3903F"/>
<stop offset="0.8" style="stop-color:#ED683C"/>
<stop offset="1" style="stop-color:#E93E3A"/>
</linearGradient>
<rect x="660.546" y="48.333" style="fill:url(#SVGID_3_);" width="32.222" height="32.222"/>
<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="483.3267" y1="978.3428" x2="483.3267" y2="-21.08" gradientTransform="matrix(1 0 0 -1 0 949.7782)">
<stop offset="0" style="stop-color:#FFF33B"/>
<stop offset="0.014" style="stop-color:#FEE72E"/>
<stop offset="0.042" style="stop-color:#FED51B"/>
<stop offset="0.07" style="stop-color:#FDCA10"/>
<stop offset="0.1" style="stop-color:#FDC70C"/>
<stop offset="0.4" style="stop-color:#F3903F"/>
<stop offset="0.8" style="stop-color:#ED683C"/>
<stop offset="1" style="stop-color:#E93E3A"/>
</linearGradient>
<rect x="451.105" y="886.099" style="fill:url(#SVGID_4_);" width="64.444" height="32.222"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<svg height="512" viewBox="0 0 58 58" width="512" xmlns="http://www.w3.org/2000/svg"><g id="024---Star" fill="none"><path id="Shape" d="m40.01 35.73 17.82-14.73h-57.65l17.81 14.73z" fill="#e57e25"/><path id="Shape" d="m11.36 58 17.64-13.83 17.64 13.83c-13.06-44.58-9.09-31.62-17.64-58-11.26 34.76-2.18 6.09-17.64 58z" fill="#f0c419"/><path id="Shape" d="m46.64 58-17.64-13.83v-44.17c8.56 26.44 4.63 13.6 17.64 58z" fill="#f29c1f"/></g></svg>
\ No newline at end of file
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve" width="512px" height="512px"><g><g>
<g>
<path d="M256,0c-49.629,0-90,41.371-90,91c0,49.629,40.371,90,90,90c49.629,0,90-40.371,90-90C346,41.371,305.629,0,256,0z" data-original="#000000" class="active-path" data-old_color="#000000" fill="#FAB446"/>
</g>
</g><g>
<g>
<path d="M286,181h-30h-30c-21.158,0-41.603,5.469-60.19,14.773c31.569,8.518,61.293,20.786,90.19,37.372 c28.898-16.586,58.621-28.854,90.19-37.372C327.603,186.469,307.158,181,286,181z" data-original="#000000" class="active-path" data-old_color="#000000" fill="#FAB446"/>
</g>
</g><g>
<g>
<path d="M482,271c-16.569,0-30,13.431-30,30v60c0,16.567,13.431,30,30,30c16.569,0,30-13.433,30-30v-60 C512,284.431,498.569,271,482,271z" data-original="#000000" class="active-path" data-old_color="#000000" fill="#FAB446"/>
</g>
</g><g>
<g>
<path d="M30,271c-16.569,0-30,13.431-30,30v60c0,16.567,13.431,30,30,30c16.569,0,30-13.433,30-30v-60 C60,284.431,46.569,271,30,271z" data-original="#000000" class="active-path" data-old_color="#000000" fill="#FAB446"/>
</g>
</g><g>
<g>
<path d="M45,211c-8.291,0-15,6.709-15,15v15c33.091,0,60,26.909,60,60v60c0,33.091-26.909,60-60,60v15c0,8.291,6.709,15,15,15 c76.901,0,138.39,24.286,196,61V259.594C183.13,226.414,120.903,211,45,211z" data-original="#000000" class="active-path" data-old_color="#000000" fill="#FAB446"/>
</g>
</g><g>
<g>
<path d="M482,241v-15c0-8.291-6.709-15-15-15c-75.903,0-138.13,15.414-196,48.594V512c57.61-36.714,119.099-61,196-61 c8.291,0,15-6.709,15-15v-15c-33.091,0-60-26.909-60-60v-60C422,267.909,448.909,241,482,241z" data-original="#000000" class="active-path" data-old_color="#000000" fill="#FAB446"/>
</g>
</g></g> </svg>
odoo.define('ks_binary_file_preview.ks_binary_preview', function(require){
var BasicFields = require('web.basic_fields');
var DocumentViewer = require('mail.DocumentViewer');
var core = require('web.core');
var ajax = require('web.ajax');
var ks_file_data = undefined;
BasicFields.FieldBinaryFile.include({
events: _.extend({}, BasicFields.FieldBinaryFile.prototype.events, {
'click .ks_binary_file_preview': "ks_onAttachmentView",
}),
_renderReadonly: function(){
var self = this;
self._super.apply(this,arguments);
if (!self.res_id) {
self.$el.css('cursor', 'not-allowed');
} else {
self.$el.css('cursor', 'pointer');
self.$el.attr('title', 'Download');
}
self.$el.append(core.qweb.render("ks_preview_button"));
},
ks_onAttachmentView: function(ev){
var self = this;
try {
ev.preventDefault();
ev.stopPropagation();
var ks_mimetype = this.recordData.mimetype;
function ks_docView(ks_file_data){
if(ks_file_data){
var ks_attachment = [{
filename: ks_file_data.name,
id: ks_file_data.id,
is_main: false,
mimetype: ks_file_data.type,
name: ks_file_data.name,
type: ks_file_data.type,
url: "/web/content/" + ks_file_data.id + "?download=true",
}]
var ks_activeAttachmentID = ks_file_data.id;
var ks_attachmentViewer = new DocumentViewer(self, ks_attachment, ks_activeAttachmentID);
ks_attachmentViewer.appendTo($('body'));
}
}
if(ks_mimetype){
ks_file_data = {
'id' : this.recordData.id,
'type' : this.recordData.mimetype || 'application/octet-stream',
'name' : this.recordData.name || this.recordData.display_name || "",
}
ks_docView(ks_file_data);
}
else{
var def = ajax.jsonRpc("/get/record/details", 'call',{
'res_id': this.res_id,
'model': this.model,
'size': this.value,
'res_field': this.field.string || this.name,
});
}
return $.when(def).then(function(vals){
if (vals){
ks_docView(vals);
}
});
}
catch(err) {
alert(err);
}
},
});
});
<template xml:spacer="preserve">
<t t-name="ks_preview_button">
<button type="button" class="ks_binary_file_preview btn btn-secondary fa fa-file-text-o" style="padding: 0px 4px; color: #7C7BAD;" title="Preview" aria-label="Preview"/>
</t>
</template>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets_backend" name="board assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/ks_binary_file_preview/static/src/js/ks_binary_preview.js"/>
</xpath>
</template>
</odoo>
\ No newline at end of file
==========
Web Notify
==========
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/12.0/web_notify
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_notify
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/12.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
Send instant notification messages to the user in live.
This technical module allows you to send instant notification messages from the server to the user in live.
Two kinds of notification are supported.
* Success: Displayed in a `success` theme color flying popup div
* Danger: Displayed in a `danger` theme color flying popup div
* Warning: Displayed in a `warning` theme color flying popup div
* Information: Displayed in a `info` theme color flying popup div
* Default: Displayed in a `default` theme color flying popup div
**Table of contents**
.. contents::
:local:
Installation
============
This module is based on the Instant Messaging Bus. To work properly, the server must be launched in gevent mode.
Usage
=====
To send a notification to the user you just need to call one of the new methods defined on res.users:
.. code-block:: python
self.env.user.notify_success(message='My success message')
or
.. code-block:: python
self.env.user.notify_danger(message='My danger message')
or
.. code-block:: python
self.env.user.notify_warning(message='My warning message')
or
.. code-block:: python
self.env.user.notify_info(message='My information message')
or
.. code-block:: python
self.env.user.notify_default(message='My default message')
.. figure:: https://raw.githubusercontent.com/OCA/web/12.0/web_notify/static/description/notifications_screenshot.png
:scale: 80 %
:alt: Sample notifications
You can test the behaviour of the notifications by installing this module in a demo database.
Access the users form through Settings -> Users & Companies. You'll see a tab called "Test web notify", here you'll find two buttons that'll allow you test the module.
.. figure:: https://raw.githubusercontent.com/OCA/web/12.0/web_notify/static/description/test_notifications_demo.png
:scale: 80 %
:alt: Sample notifications
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_notify%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* ACSONE SA/NV
* AdaptiveCity
Contributors
~~~~~~~~~~~~
* Laurent Mignon <laurent.mignon@acsone.eu>
* Serpent Consulting Services Pvt. Ltd.<jay.vora@serpentcs.com>
* Aitor Bouzas <aitor.bouzas@adaptivecity.com>
* Shepilov Vladislav <shepilov.v@protonmail.com>
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/12.0/web_notify>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
# pylint: disable=missing-docstring
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models
# pylint: disable=missing-docstring
# Copyright 2016 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Web Notify',
'summary': """
Send notification messages to user""",
'version': '12.0.1.0.0',
'license': 'AGPL-3',
'author': 'ACSONE SA/NV,'
'AdaptiveCity,'
'Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/web',
'depends': [
'web',
'bus',
'base',
],
'data': [
'views/web_notify.xml'
],
'demo': [
'views/res_users_demo.xml'
],
'installable': True,
}
此文件的差异被折叠, 点击展开。
此文件的差异被折叠, 点击展开。
此文件的差异被折叠, 点击展开。
此文件的差异被折叠, 点击展开。
此文件的差异被折叠, 点击展开。
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!