[MERGE]Merge lp:~openerp-dev/openobject-addons/trunk-website-al.
bzr revid: bth@tinyerp.com-20130802113100-o2zujug0h9mbuw49 bzr revid: bth@tinyerp.com-20130805080538-tqslnjo1tzu5isrs bzr revid: bth@tinyerp.com-20130806091909-fbpfe6mj7p3ob0dt
This commit is contained in:
commit
78d007ec50
|
@ -8,19 +8,19 @@ msgstr ""
|
|||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
|
||||
"PO-Revision-Date: 2012-04-13 22:35+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"PO-Revision-Date: 2013-07-30 22:25+0000\n"
|
||||
"Last-Translator: Masaki Yamaya <Unknown>\n"
|
||||
"Language-Team: Japanese <ja@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2013-03-16 05:47+0000\n"
|
||||
"X-Generator: Launchpad (build 16532)\n"
|
||||
"X-Launchpad-Export-Date: 2013-07-31 05:16+0000\n"
|
||||
"X-Generator: Launchpad (build 16718)\n"
|
||||
|
||||
#. module: account_accountant
|
||||
#: model:ir.actions.client,name:account_accountant.action_client_account_menu
|
||||
msgid "Open Accounting Menu"
|
||||
msgstr ""
|
||||
msgstr "会計メニューを開く"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "\n"
|
||||
|
|
|
@ -8,14 +8,14 @@ msgstr ""
|
|||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
|
||||
"PO-Revision-Date: 2012-06-13 17:16+0000\n"
|
||||
"Last-Translator: Akira Hiyama <Unknown>\n"
|
||||
"PO-Revision-Date: 2013-07-30 22:29+0000\n"
|
||||
"Last-Translator: Masaki Yamaya <Unknown>\n"
|
||||
"Language-Team: Japanese <ja@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2013-03-16 05:34+0000\n"
|
||||
"X-Generator: Launchpad (build 16532)\n"
|
||||
"X-Launchpad-Export-Date: 2013-07-31 05:16+0000\n"
|
||||
"X-Generator: Launchpad (build 16718)\n"
|
||||
|
||||
#. module: account_budget
|
||||
#: view:account.budget.analytic:0
|
||||
|
@ -418,7 +418,7 @@ msgstr "からの分析"
|
|||
#. module: account_budget
|
||||
#: view:crossovered.budget:0
|
||||
msgid "Draft Budgets"
|
||||
msgstr "ドラフト予算"
|
||||
msgstr "予算案"
|
||||
|
||||
#, python-format
|
||||
#~ msgid "The General Budget '%s' has no Accounts!"
|
||||
|
|
|
@ -211,7 +211,7 @@ class event_event(osv.osv):
|
|||
'city': fields.related('address_id','city',type='char',string='city'),
|
||||
'speaker_confirmed': fields.boolean('Speaker Confirmed', readonly=False, states={'done': [('readonly', True)]}),
|
||||
'country_id': fields.related('address_id', 'country_id',
|
||||
type='many2one', relation='res.country', string='Country', readonly=False, states={'done': [('readonly', True)]}),
|
||||
type='many2one', relation='res.country', string='Country', readonly=False, states={'done': [('readonly', True)]}, store=True),
|
||||
'note': fields.text('Description', readonly=False, states={'done': [('readonly', True)]}),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=False, change_default=True, readonly=False, states={'done': [('readonly', True)]}),
|
||||
'is_subscribed' : fields.function(_subscribe_fnc, type="boolean", string='Subscribed'),
|
||||
|
|
|
@ -7,14 +7,14 @@ msgstr ""
|
|||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
|
||||
"PO-Revision-Date: 2013-04-24 06:41+0000\n"
|
||||
"Last-Translator: viney <Unknown>\n"
|
||||
"PO-Revision-Date: 2013-07-26 07:07+0000\n"
|
||||
"Last-Translator: Wei \"oldrev\" Li <oldrev@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2013-04-25 05:20+0000\n"
|
||||
"X-Generator: Launchpad (build 16580)\n"
|
||||
"X-Launchpad-Export-Date: 2013-07-27 05:02+0000\n"
|
||||
"X-Generator: Launchpad (build 16700)\n"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: field:report.transaction.pos,product_nb:0
|
||||
|
@ -51,7 +51,7 @@ msgstr "打印销售订单的收据"
|
|||
#. module: point_of_sale
|
||||
#: field:pos.session,cash_register_balance_end:0
|
||||
msgid "Computed Balance"
|
||||
msgstr ""
|
||||
msgstr "计算余额"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:pos.session:0
|
||||
|
@ -62,7 +62,7 @@ msgstr "今天"
|
|||
#. module: point_of_sale
|
||||
#: field:pos.config,iface_electronic_scale:0
|
||||
msgid "Electronic Scale Interface"
|
||||
msgstr ""
|
||||
msgstr "电子称接口"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:pos.category,name:point_of_sale.plain_water
|
||||
|
@ -85,7 +85,7 @@ msgstr ""
|
|||
#: field:pos.config,journal_id:0
|
||||
#: field:pos.order,sale_journal:0
|
||||
msgid "Sale Journal"
|
||||
msgstr ""
|
||||
msgstr "销售日记账"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.spa_2l_product_template
|
||||
|
@ -102,7 +102,7 @@ msgstr "销售详情"
|
|||
#. module: point_of_sale
|
||||
#: constraint:pos.config:0
|
||||
msgid "You cannot have two cash controls in one Point Of Sale !"
|
||||
msgstr ""
|
||||
msgstr "同一个销售点不能使用两个钱箱"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: field:pos.payment.report.user,user_id:0
|
||||
|
@ -111,7 +111,7 @@ msgstr ""
|
|||
#: view:report.pos.order:0
|
||||
#: field:report.pos.order,user_id:0
|
||||
msgid "Salesperson"
|
||||
msgstr ""
|
||||
msgstr "销售员"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:report.pos.order:0
|
||||
|
@ -128,13 +128,13 @@ msgstr "产品名称"
|
|||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.pamplemousse_rouge_pamplemousse_product_template
|
||||
msgid "Red grapefruit"
|
||||
msgstr ""
|
||||
msgstr "红葡萄柚"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1343
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1373
|
||||
#, python-format
|
||||
msgid "Assign a Custom EAN"
|
||||
msgstr ""
|
||||
msgstr "使用自定义的条码"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:pos.session.opening:0
|
||||
|
@ -164,12 +164,12 @@ msgstr "取钱"
|
|||
#: code:addons/point_of_sale/point_of_sale.py:105
|
||||
#, python-format
|
||||
msgid "not used"
|
||||
msgstr ""
|
||||
msgstr "未被使用"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: field:pos.config,iface_vkeyboard:0
|
||||
msgid "Virtual KeyBoard Interface"
|
||||
msgstr ""
|
||||
msgstr "虚拟键盘接口"
|
||||
|
||||
#. module: point_of_sale
|
||||
#. openerp-web
|
||||
|
@ -181,11 +181,11 @@ msgstr "+/-"
|
|||
#. module: point_of_sale
|
||||
#: field:pos.ean_wizard,ean13_pattern:0
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
msgstr "单号"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1041
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1057
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1066
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1083
|
||||
#: report:pos.invoice:0
|
||||
#: report:pos.lines:0
|
||||
#, python-format
|
||||
|
@ -200,32 +200,32 @@ msgstr "开始日期"
|
|||
#. module: point_of_sale
|
||||
#: constraint:pos.session:0
|
||||
msgid "You cannot create two active sessions with the same responsible!"
|
||||
msgstr ""
|
||||
msgstr "同一个负责人不能创建两个活动销售会话"
|
||||
|
||||
#. module: point_of_sale
|
||||
#. openerp-web
|
||||
#: code:addons/point_of_sale/static/src/xml/pos.xml:473
|
||||
#, python-format
|
||||
msgid "Weighting"
|
||||
msgstr ""
|
||||
msgstr "称重"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.fenouil_fenouil_product_template
|
||||
msgid "Fennel"
|
||||
msgstr ""
|
||||
msgstr "小茴香"
|
||||
|
||||
#. module: point_of_sale
|
||||
#. openerp-web
|
||||
#: code:addons/point_of_sale/static/src/xml/pos.xml:472
|
||||
#, python-format
|
||||
msgid "Help needed"
|
||||
msgstr ""
|
||||
msgstr "需要帮助"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:739
|
||||
#: code:addons/point_of_sale/point_of_sale.py:760
|
||||
#, python-format
|
||||
msgid "Configuration Error!"
|
||||
msgstr ""
|
||||
msgstr "设置错误!"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: report:account.statement:0
|
||||
|
@ -237,7 +237,7 @@ msgstr "业务伙伴"
|
|||
#. module: point_of_sale
|
||||
#: view:pos.session:0
|
||||
msgid "Closing Cash Control"
|
||||
msgstr ""
|
||||
msgstr "关闭现金箱"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: report:pos.details:0
|
||||
|
@ -259,7 +259,7 @@ msgstr "会计信息"
|
|||
#. module: point_of_sale
|
||||
#: field:pos.session.opening,show_config:0
|
||||
msgid "Show Config"
|
||||
msgstr ""
|
||||
msgstr "显示配置"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: report:pos.lines:0
|
||||
|
@ -277,7 +277,7 @@ msgstr "折扣合计"
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:441
|
||||
#, python-format
|
||||
msgid "Debug Window"
|
||||
msgstr ""
|
||||
msgstr "调试窗口"
|
||||
|
||||
#. module: point_of_sale
|
||||
#. openerp-web
|
||||
|
@ -315,10 +315,10 @@ msgid "Disc.(%)"
|
|||
msgstr "折扣(%)"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1006
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1031
|
||||
#, python-format
|
||||
msgid "Please define income account for this product: \"%s\" (id:%d)."
|
||||
msgstr ""
|
||||
msgstr "请为这个产品定义收益科目:\"%s\" (id:%d)."
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:report.pos.order:0
|
||||
|
@ -336,7 +336,7 @@ msgstr "Leffe Brune 33cl"
|
|||
msgid ""
|
||||
"Check this if this point of sale should open by default in a self checkout "
|
||||
"mode. If unchecked, OpenERP uses the normal cashier mode by default."
|
||||
msgstr ""
|
||||
msgstr "如果需要把自助收银作为默认模式,请选中这里。 如果未选, OpenERP 将使用普通收银员作为默认模式。"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:ir.actions.report.xml,name:point_of_sale.pos_sales_user
|
||||
|
@ -353,7 +353,7 @@ msgstr "饮料类"
|
|||
#: model:ir.actions.act_window,name:point_of_sale.action_pos_session_opening
|
||||
#: model:ir.ui.menu,name:point_of_sale.menu_pos_session_opening
|
||||
msgid "Your Session"
|
||||
msgstr ""
|
||||
msgstr "您的销售会话"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.stella_50cl_product_template
|
||||
|
@ -375,12 +375,12 @@ msgstr "上级类别"
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:482
|
||||
#, python-format
|
||||
msgid "Open Cashbox"
|
||||
msgstr ""
|
||||
msgstr "打开钱箱"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:pos.session.opening:0
|
||||
msgid "Select your Point of Sale"
|
||||
msgstr ""
|
||||
msgstr "选择您的销售点"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: field:report.sales.by.margin.pos,total:0
|
||||
|
@ -404,25 +404,25 @@ msgstr "Dr. Oetker Ristorante Speciale"
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:480
|
||||
#, python-format
|
||||
msgid "Payment Request"
|
||||
msgstr ""
|
||||
msgstr "付款请求"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: field:product.product,to_weight:0
|
||||
msgid "To Weight"
|
||||
msgstr ""
|
||||
msgstr "需要称重"
|
||||
|
||||
#. module: point_of_sale
|
||||
#. openerp-web
|
||||
#: code:addons/point_of_sale/static/src/xml/pos.xml:476
|
||||
#, python-format
|
||||
msgid "Hardware Events"
|
||||
msgstr ""
|
||||
msgstr "硬件事件"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:301
|
||||
#, python-format
|
||||
msgid "You should assign a Point of Sale to your session."
|
||||
msgstr ""
|
||||
msgstr "您需要为您的销售会话指定一个销售点"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:pos.order.line:0
|
||||
|
@ -435,7 +435,7 @@ msgid "Fanta Orange 33cl"
|
|||
msgstr "Fanta Orange 33cl"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:420
|
||||
#: code:addons/point_of_sale/point_of_sale.py:423
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Please set your profit and loss accounts on your payment method '%s'. This "
|
||||
|
@ -446,10 +446,10 @@ msgstr ""
|
|||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:315
|
||||
#: code:addons/point_of_sale/point_of_sale.py:512
|
||||
#: code:addons/point_of_sale/point_of_sale.py:514
|
||||
#, python-format
|
||||
msgid "error!"
|
||||
msgstr ""
|
||||
msgstr "错误!"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:ir.actions.act_window,name:point_of_sale.action_report_sales_by_user_pos_month
|
||||
|
@ -471,12 +471,12 @@ msgstr ""
|
|||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.Onions_product_template
|
||||
msgid "Onions"
|
||||
msgstr ""
|
||||
msgstr "洋葱"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:pos.session:0
|
||||
msgid "Validate & Open Session"
|
||||
msgstr ""
|
||||
msgstr "验证并打开销售会话"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:99
|
||||
|
@ -484,18 +484,18 @@ msgstr ""
|
|||
#: selection:pos.session.opening,pos_state:0
|
||||
#, python-format
|
||||
msgid "In Progress"
|
||||
msgstr ""
|
||||
msgstr "进行中"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:pos.session:0
|
||||
#: field:pos.session,opening_details_ids:0
|
||||
msgid "Opening Cash Control"
|
||||
msgstr ""
|
||||
msgstr "正在打开钱箱"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: help:res.users,ean13:0
|
||||
msgid "BarCode"
|
||||
msgstr ""
|
||||
msgstr "条码"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: help:pos.category,image_medium:0
|
||||
|
@ -508,19 +508,19 @@ msgstr ""
|
|||
#. module: point_of_sale
|
||||
#: view:pos.session.opening:0
|
||||
msgid "Open Session"
|
||||
msgstr ""
|
||||
msgstr "打开销售会话"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:ir.ui.menu,name:point_of_sale.menu_point_of_sale
|
||||
msgid "Daily Operations"
|
||||
msgstr "每天经营"
|
||||
msgstr "日常经营"
|
||||
|
||||
#. module: point_of_sale
|
||||
#. openerp-web
|
||||
#: code:addons/point_of_sale/static/src/xml/pos.xml:42
|
||||
#, python-format
|
||||
msgid "Google Chrome"
|
||||
msgstr ""
|
||||
msgstr "Google Chrome"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:pos.category,name:point_of_sale.sparkling_water
|
||||
|
@ -543,7 +543,7 @@ msgstr "查询现金对账单"
|
|||
#: field:pos.session.opening,pos_state_str:0
|
||||
#: field:report.pos.order,state:0
|
||||
msgid "Status"
|
||||
msgstr ""
|
||||
msgstr "状态"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: selection:report.pos.order,month:0
|
||||
|
@ -568,14 +568,14 @@ msgstr "POS单明细"
|
|||
#. module: point_of_sale
|
||||
#: view:pos.config:0
|
||||
msgid "Point of Sale Configuration"
|
||||
msgstr ""
|
||||
msgstr "销售点配置"
|
||||
|
||||
#. module: point_of_sale
|
||||
#. openerp-web
|
||||
#: code:addons/point_of_sale/static/src/xml/pos.xml:359
|
||||
#, python-format
|
||||
msgid "Your order has to be validated by a cashier."
|
||||
msgstr ""
|
||||
msgstr "您的订单已被收银员确认"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.fanta_orange_50cl_product_template
|
||||
|
@ -609,7 +609,7 @@ msgid ""
|
|||
msgstr ""
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:867
|
||||
#: code:addons/point_of_sale/point_of_sale.py:888
|
||||
#, python-format
|
||||
msgid "Customer Invoice"
|
||||
msgstr "客户发票"
|
||||
|
@ -619,7 +619,7 @@ msgstr "客户发票"
|
|||
msgid ""
|
||||
"You can continue sales from the touchscreen interface by clicking on \"Start "
|
||||
"Selling\" or close the cash register session."
|
||||
msgstr ""
|
||||
msgstr "通过触摸屏幕的“开始销售”或者关闭钱箱之后您就可以继续进行销售。"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: report:account.statement:0
|
||||
|
@ -631,7 +631,7 @@ msgstr "结束日期"
|
|||
#. module: point_of_sale
|
||||
#: view:pos.session:0
|
||||
msgid "Opening Cashbox Lines"
|
||||
msgstr ""
|
||||
msgstr "正在打开钱箱"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: selection:report.pos.order,month:0
|
||||
|
@ -678,7 +678,7 @@ msgstr "行号"
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:453
|
||||
#, python-format
|
||||
msgid "Set Weight"
|
||||
msgstr ""
|
||||
msgstr "设置重量"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:account.bank.statement:0
|
||||
|
@ -693,7 +693,7 @@ msgstr "净合计:"
|
|||
#. module: point_of_sale
|
||||
#: model:ir.actions.client,name:point_of_sale.action_client_pos_menu
|
||||
msgid "Open POS Menu"
|
||||
msgstr ""
|
||||
msgstr "打开销售点菜单"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: report:pos.details_summary:0
|
||||
|
@ -710,12 +710,12 @@ msgstr "发表POS机日记帐分录"
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:457
|
||||
#, python-format
|
||||
msgid "Barcode Scanner"
|
||||
msgstr ""
|
||||
msgstr "条码扫描器"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.pomme_granny_smith_product_template
|
||||
msgid "Granny Smith apples"
|
||||
msgstr ""
|
||||
msgstr "Granny Smith 苹果"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: help:product.product,expense_pdt:0
|
||||
|
@ -743,7 +743,7 @@ msgstr ""
|
|||
#. module: point_of_sale
|
||||
#: view:pos.session.opening:0
|
||||
msgid "Click to start a session."
|
||||
msgstr ""
|
||||
msgstr "单击开始销售会话"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:pos.details:0
|
||||
|
@ -778,7 +778,7 @@ msgstr "新增产品"
|
|||
#. module: point_of_sale
|
||||
#: field:pos.config,name:0
|
||||
msgid "Point of Sale Name"
|
||||
msgstr ""
|
||||
msgstr "销售点名称"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: field:report.transaction.pos,invoice_am:0
|
||||
|
@ -825,7 +825,7 @@ msgstr "期末结余"
|
|||
#: code:addons/point_of_sale/wizard/pos_box_out.py:89
|
||||
#, python-format
|
||||
msgid "please check that account is set to %s."
|
||||
msgstr ""
|
||||
msgstr "请检查该科目已经设为为:%s"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: help:pos.category,image:0
|
||||
|
@ -863,7 +863,7 @@ msgstr ""
|
|||
#. module: point_of_sale
|
||||
#: view:pos.ean_wizard:0
|
||||
msgid "Ean13 Generator"
|
||||
msgstr ""
|
||||
msgstr "条码生成器"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.spa_1l_product_template
|
||||
|
@ -879,7 +879,7 @@ msgstr "错误:无效的EAN编码"
|
|||
#. module: point_of_sale
|
||||
#: model:pos.category,name:point_of_sale.legumes_racine
|
||||
msgid "Root vegetables"
|
||||
msgstr ""
|
||||
msgstr "根类蔬菜"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:ir.actions.act_window,name:point_of_sale.act_pos_open_statement
|
||||
|
@ -939,7 +939,7 @@ msgstr ""
|
|||
#. module: point_of_sale
|
||||
#: view:res.users:0
|
||||
msgid "Edit EAN"
|
||||
msgstr ""
|
||||
msgstr "编辑条码"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/wizard/pos_open_statement.py:80
|
||||
|
@ -965,7 +965,7 @@ msgstr ""
|
|||
#. module: point_of_sale
|
||||
#: field:pos.session.opening,pos_session_id:0
|
||||
msgid "PoS Session"
|
||||
msgstr ""
|
||||
msgstr "销售点会话"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: selection:report.pos.order,month:0
|
||||
|
@ -979,7 +979,7 @@ msgid "User's Product"
|
|||
msgstr "用户的产品"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1143
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1173
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You have to select a pricelist in the sale form !\n"
|
||||
|
@ -1011,7 +1011,7 @@ msgstr "增加一个全局折扣"
|
|||
#. module: point_of_sale
|
||||
#: view:pos.config:0
|
||||
msgid "Journals"
|
||||
msgstr ""
|
||||
msgstr "日记账"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.oetker_prosciutto_product_template
|
||||
|
@ -1031,7 +1031,7 @@ msgstr "Coca-Cola Light Lemon 50cl"
|
|||
|
||||
#. module: point_of_sale
|
||||
#. openerp-web
|
||||
#: code:addons/point_of_sale/point_of_sale.py:518
|
||||
#: code:addons/point_of_sale/point_of_sale.py:520
|
||||
#: code:addons/point_of_sale/static/src/xml/pos.xml:689
|
||||
#: code:addons/point_of_sale/static/src/xml/pos.xml:744
|
||||
#, python-format
|
||||
|
@ -1041,7 +1041,7 @@ msgstr ""
|
|||
#. module: point_of_sale
|
||||
#: view:product.product:0
|
||||
msgid "Set a Custom EAN"
|
||||
msgstr ""
|
||||
msgstr "设置自定义条码"
|
||||
|
||||
#. module: point_of_sale
|
||||
#. openerp-web
|
||||
|
@ -1053,7 +1053,7 @@ msgstr ""
|
|||
#. module: point_of_sale
|
||||
#: model:pos.category,name:point_of_sale.legumes
|
||||
msgid "Fresh vegetables"
|
||||
msgstr ""
|
||||
msgstr "新鲜蔬菜"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:pos.session:0
|
||||
|
@ -1065,7 +1065,7 @@ msgstr ""
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:478
|
||||
#, python-format
|
||||
msgid "Scan Item Success"
|
||||
msgstr ""
|
||||
msgstr "扫描条目成功"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: report:account.statement:0
|
||||
|
@ -1082,17 +1082,17 @@ msgstr ""
|
|||
#. module: point_of_sale
|
||||
#: sql_constraint:pos.session:0
|
||||
msgid "The name of this POS Session must be unique !"
|
||||
msgstr ""
|
||||
msgstr "销售会话名称必须唯一"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:pos.session:0
|
||||
msgid "Opening Subtotal"
|
||||
msgstr ""
|
||||
msgstr "小计"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:pos.session:0
|
||||
msgid "payment method."
|
||||
msgstr ""
|
||||
msgstr "付款方式"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:pos.order:0
|
||||
|
@ -1137,7 +1137,7 @@ msgstr "折扣"
|
|||
#. module: point_of_sale
|
||||
#: view:pos.order:0
|
||||
msgid "(update)"
|
||||
msgstr ""
|
||||
msgstr "(更新)"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.ijsboerke_vanille_2,5l_product_template
|
||||
|
@ -1153,12 +1153,12 @@ msgstr "销售详情"
|
|||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.evian_2l_product_template
|
||||
msgid "2L Evian"
|
||||
msgstr ""
|
||||
msgstr "2L 依云"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:373
|
||||
#: code:addons/point_of_sale/point_of_sale.py:472
|
||||
#: code:addons/point_of_sale/wizard/pos_session_opening.py:34
|
||||
#: code:addons/point_of_sale/point_of_sale.py:474
|
||||
#: code:addons/point_of_sale/wizard/pos_session_opening.py:33
|
||||
#, python-format
|
||||
msgid "Start Point Of Sale"
|
||||
msgstr ""
|
||||
|
@ -1215,14 +1215,14 @@ msgstr "Chaudfontaine Petillante 50cl"
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:485
|
||||
#, python-format
|
||||
msgid "Read Weighting Scale"
|
||||
msgstr ""
|
||||
msgstr "读取电子秤"
|
||||
|
||||
#. module: point_of_sale
|
||||
#. openerp-web
|
||||
#: code:addons/point_of_sale/static/src/xml/pos.xml:426
|
||||
#, python-format
|
||||
msgid "0.00 €"
|
||||
msgstr ""
|
||||
msgstr "0.00 €"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: field:pos.order.line,create_date:0
|
||||
|
@ -1240,7 +1240,7 @@ msgstr "今天的销售情况"
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:324
|
||||
#, python-format
|
||||
msgid "Welcome"
|
||||
msgstr ""
|
||||
msgstr "欢迎"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/wizard/pos_box_entries.py:46
|
||||
|
@ -1295,7 +1295,7 @@ msgstr "已开票合计"
|
|||
#: model:ir.model,name:point_of_sale.model_pos_category
|
||||
#: field:product.product,pos_categ_id:0
|
||||
msgid "Point of Sale Category"
|
||||
msgstr ""
|
||||
msgstr "销售点商品分类"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: view:report.pos.order:0
|
||||
|
@ -1315,7 +1315,7 @@ msgstr ""
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:324
|
||||
#, python-format
|
||||
msgid "Choose your type of receipt:"
|
||||
msgstr ""
|
||||
msgstr "选择小票类型"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:ir.model,name:point_of_sale.model_report_sales_by_margin_pos_month
|
||||
|
@ -1352,7 +1352,7 @@ msgstr ""
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:479
|
||||
#, python-format
|
||||
msgid "Scan Item Unrecognized"
|
||||
msgstr ""
|
||||
msgstr "未能识别扫描的条目"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: report:all.closed.cashbox.of.the.day:0
|
||||
|
@ -1360,7 +1360,7 @@ msgid "Today's Closed Cashbox"
|
|||
msgstr "今日关闭的钱箱"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:897
|
||||
#: code:addons/point_of_sale/point_of_sale.py:920
|
||||
#, python-format
|
||||
msgid "Selected orders do not have the same session!"
|
||||
msgstr ""
|
||||
|
@ -1396,7 +1396,7 @@ msgstr "开启日期"
|
|||
#: model:ir.actions.act_window,name:point_of_sale.action_pos_session
|
||||
#: model:ir.ui.menu,name:point_of_sale.menu_pos_session_all
|
||||
msgid "All Sessions"
|
||||
msgstr ""
|
||||
msgstr "全部销售会话"
|
||||
|
||||
#. module: point_of_sale
|
||||
#. openerp-web
|
||||
|
@ -1415,7 +1415,7 @@ msgstr "税:"
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:271
|
||||
#, python-format
|
||||
msgid "Thank you for shopping with us."
|
||||
msgstr ""
|
||||
msgstr "感谢您的光临。"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.coca_light_2l_product_template
|
||||
|
@ -1431,7 +1431,7 @@ msgstr "Dr. Oetker Ristorante Funghi"
|
|||
#: model:ir.actions.act_window,name:point_of_sale.pos_category_action
|
||||
#: model:ir.ui.menu,name:point_of_sale.menu_pos_category
|
||||
msgid "Product Categories"
|
||||
msgstr ""
|
||||
msgstr "商品类别"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: help:pos.config,journal_id:0
|
||||
|
@ -1448,7 +1448,7 @@ msgstr "折扣"
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:467
|
||||
#, python-format
|
||||
msgid "Invalid Ean"
|
||||
msgstr ""
|
||||
msgstr "无效的条码"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.lindemans_kriek_37,5cl_product_template
|
||||
|
@ -1458,7 +1458,7 @@ msgstr "Lindemans Kriek 37.5cl"
|
|||
#. module: point_of_sale
|
||||
#: view:pos.config:0
|
||||
msgid "Point of Sale Config"
|
||||
msgstr ""
|
||||
msgstr "销售点配置"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.coca_zero_33cl_product_template
|
||||
|
@ -1511,7 +1511,7 @@ msgstr "税:"
|
|||
#. module: point_of_sale
|
||||
#: view:pos.session:0
|
||||
msgid "+ Transactions"
|
||||
msgstr ""
|
||||
msgstr "+ 交易"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:ir.actions.act_window,name:point_of_sale.action_pos_discount
|
||||
|
@ -1541,12 +1541,12 @@ msgstr "用户"
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:194
|
||||
#, python-format
|
||||
msgid "Kg"
|
||||
msgstr ""
|
||||
msgstr "千克"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: field:product.product,available_in_pos:0
|
||||
msgid "Available in the Point of Sale"
|
||||
msgstr ""
|
||||
msgstr "可在销售点销售"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: selection:pos.config,state:0
|
||||
|
@ -1563,7 +1563,7 @@ msgstr ""
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:338
|
||||
#, python-format
|
||||
msgid "The scanned product was not recognized"
|
||||
msgstr ""
|
||||
msgstr "无法识别扫描的商品"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:ir.model,name:point_of_sale.model_report_transaction_pos
|
||||
|
@ -1613,7 +1613,7 @@ msgstr "11月"
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:267
|
||||
#, python-format
|
||||
msgid "Please scan an item or your member card"
|
||||
msgstr ""
|
||||
msgstr "请扫描商品或您的会员卡"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:product.template,name:point_of_sale.poivron_verts_product_template
|
||||
|
@ -1644,7 +1644,7 @@ msgid "Number of Transaction"
|
|||
msgstr "交易数"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:738
|
||||
#: code:addons/point_of_sale/point_of_sale.py:759
|
||||
#, python-format
|
||||
msgid ""
|
||||
"There is no receivable account defined to make payment for the partner: "
|
||||
|
@ -1655,7 +1655,7 @@ msgstr ""
|
|||
#: view:pos.config:0
|
||||
#: selection:pos.config,state:0
|
||||
msgid "Inactive"
|
||||
msgstr ""
|
||||
msgstr "不活跃的"
|
||||
|
||||
#. module: point_of_sale
|
||||
#. openerp-web
|
||||
|
@ -1679,7 +1679,7 @@ msgstr "取消"
|
|||
#: code:addons/point_of_sale/static/src/xml/pos.xml:296
|
||||
#, python-format
|
||||
msgid "Please put your product on the scale"
|
||||
msgstr ""
|
||||
msgstr "请将商品放到称上"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: model:ir.actions.report.xml,name:point_of_sale.pos_details_summary
|
||||
|
@ -1699,7 +1699,7 @@ msgstr "Timmermans Kriek 37.5cl"
|
|||
#. module: point_of_sale
|
||||
#: field:pos.config,sequence_id:0
|
||||
msgid "Order IDs Sequence"
|
||||
msgstr ""
|
||||
msgstr "订单号序列"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: report:pos.invoice:0
|
||||
|
@ -1815,7 +1815,7 @@ msgid "Difference"
|
|||
msgstr ""
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:529
|
||||
#: code:addons/point_of_sale/point_of_sale.py:549
|
||||
#, python-format
|
||||
msgid "Unable to Delete !"
|
||||
msgstr "不能删除!"
|
||||
|
@ -1978,7 +1978,7 @@ msgid "Salespeople"
|
|||
msgstr ""
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:756
|
||||
#: code:addons/point_of_sale/point_of_sale.py:777
|
||||
#: code:addons/point_of_sale/wizard/pos_box_entries.py:118
|
||||
#: code:addons/point_of_sale/wizard/pos_box_out.py:91
|
||||
#, python-format
|
||||
|
@ -1986,7 +1986,7 @@ msgid "You have to open at least one cashbox."
|
|||
msgstr ""
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1142
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1172
|
||||
#, python-format
|
||||
msgid "No Pricelist !"
|
||||
msgstr "没有价格表!"
|
||||
|
@ -2038,7 +2038,7 @@ msgid "No Cash Register Defined !"
|
|||
msgstr "没有定义收银机"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:513
|
||||
#: code:addons/point_of_sale/point_of_sale.py:515
|
||||
#, python-format
|
||||
msgid ""
|
||||
"No cash statement found for this session. Unable to record returned cash."
|
||||
|
@ -2761,7 +2761,7 @@ msgid "Pos Lines"
|
|||
msgstr "销售单明细"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:413
|
||||
#: code:addons/point_of_sale/point_of_sale.py:416
|
||||
#, python-format
|
||||
msgid "Point of Sale Profit"
|
||||
msgstr ""
|
||||
|
@ -2774,7 +2774,7 @@ msgid "Please wait, a cashier is on the way"
|
|||
msgstr ""
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/wizard/pos_session_opening.py:68
|
||||
#: code:addons/point_of_sale/wizard/pos_session_opening.py:67
|
||||
#: field:pos.box.entries,session_id:0
|
||||
#: view:pos.order:0
|
||||
#: field:pos.order,session_id:0
|
||||
|
@ -3085,15 +3085,17 @@ msgstr ""
|
|||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:300
|
||||
#: code:addons/point_of_sale/point_of_sale.py:409
|
||||
#: code:addons/point_of_sale/point_of_sale.py:419
|
||||
#: code:addons/point_of_sale/point_of_sale.py:457
|
||||
#: code:addons/point_of_sale/point_of_sale.py:712
|
||||
#: code:addons/point_of_sale/point_of_sale.py:756
|
||||
#: code:addons/point_of_sale/point_of_sale.py:818
|
||||
#: code:addons/point_of_sale/point_of_sale.py:897
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1006
|
||||
#: code:addons/point_of_sale/point_of_sale.py:412
|
||||
#: code:addons/point_of_sale/point_of_sale.py:422
|
||||
#: code:addons/point_of_sale/point_of_sale.py:459
|
||||
#: code:addons/point_of_sale/point_of_sale.py:536
|
||||
#: code:addons/point_of_sale/point_of_sale.py:733
|
||||
#: code:addons/point_of_sale/point_of_sale.py:777
|
||||
#: code:addons/point_of_sale/point_of_sale.py:839
|
||||
#: code:addons/point_of_sale/point_of_sale.py:920
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1031
|
||||
#: code:addons/point_of_sale/report/pos_invoice.py:46
|
||||
#: code:addons/point_of_sale/wizard/pos_box.py:23
|
||||
#: code:addons/point_of_sale/wizard/pos_box.py:22
|
||||
#: code:addons/point_of_sale/wizard/pos_box_entries.py:46
|
||||
#: code:addons/point_of_sale/wizard/pos_box_entries.py:118
|
||||
#: code:addons/point_of_sale/wizard/pos_box_entries.py:123
|
||||
|
@ -3187,13 +3189,13 @@ msgid "Chaudfontaine 1.5l"
|
|||
msgstr "Chaudfontaine 1.5l"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1069
|
||||
#: code:addons/point_of_sale/point_of_sale.py:1096
|
||||
#, python-format
|
||||
msgid "Trade Receivables"
|
||||
msgstr ""
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:529
|
||||
#: code:addons/point_of_sale/point_of_sale.py:549
|
||||
#, python-format
|
||||
msgid "In order to delete a sale, it must be new or cancelled."
|
||||
msgstr "只有新的或被取消的销售流水可以删除"
|
||||
|
@ -3228,7 +3230,7 @@ msgid "Journal Entry"
|
|||
msgstr "日记账簿"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:736
|
||||
#: code:addons/point_of_sale/point_of_sale.py:757
|
||||
#, python-format
|
||||
msgid "There is no receivable account defined to make payment."
|
||||
msgstr ""
|
||||
|
@ -3259,7 +3261,7 @@ msgid "Supplier Invoice"
|
|||
msgstr "供应商发票"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:458
|
||||
#: code:addons/point_of_sale/point_of_sale.py:460
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You cannot confirm all orders of this session, because they have not the "
|
||||
|
@ -3338,7 +3340,7 @@ msgid "Coca-Cola Regular 1L"
|
|||
msgstr "Coca-Cola Regular 1L"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:712
|
||||
#: code:addons/point_of_sale/point_of_sale.py:733
|
||||
#, python-format
|
||||
msgid "Unable to cancel the picking."
|
||||
msgstr "无法取消发货"
|
||||
|
@ -3379,7 +3381,7 @@ msgid "Spa Barisart 1.5l"
|
|||
msgstr "Spa Barisart 1.5l"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:789
|
||||
#: code:addons/point_of_sale/point_of_sale.py:810
|
||||
#: view:pos.order:0
|
||||
#, python-format
|
||||
msgid "Return Products"
|
||||
|
@ -3495,7 +3497,7 @@ msgid "Default Point of Sale"
|
|||
msgstr ""
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/wizard/pos_box.py:24
|
||||
#: code:addons/point_of_sale/wizard/pos_box.py:23
|
||||
#, python-format
|
||||
msgid "There is no cash register for this PoS Session"
|
||||
msgstr ""
|
||||
|
@ -3539,7 +3541,7 @@ msgid "PRO-FORMA"
|
|||
msgstr "形式发票"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:818
|
||||
#: code:addons/point_of_sale/point_of_sale.py:839
|
||||
#, python-format
|
||||
msgid "Please provide a partner for the sale."
|
||||
msgstr "请提供业务伙伴。"
|
||||
|
@ -3591,7 +3593,7 @@ msgid "Print Receipt"
|
|||
msgstr "打印收银条"
|
||||
|
||||
#. module: point_of_sale
|
||||
#: code:addons/point_of_sale/point_of_sale.py:417
|
||||
#: code:addons/point_of_sale/point_of_sale.py:420
|
||||
#, python-format
|
||||
msgid "Point of Sale Loss"
|
||||
msgstr ""
|
||||
|
@ -4020,6 +4022,7 @@ msgstr ""
|
|||
#~ msgid "Discount percentage"
|
||||
#~ msgstr "折扣百分比"
|
||||
|
||||
#, python-format
|
||||
#~ msgid "Close"
|
||||
#~ msgstr "关闭"
|
||||
|
||||
|
@ -4843,9 +4846,11 @@ msgstr ""
|
|||
#~ msgid "Subtotal:"
|
||||
#~ msgstr "小计:"
|
||||
|
||||
#, python-format
|
||||
#~ msgid "Validate"
|
||||
#~ msgstr "确认"
|
||||
|
||||
#, python-format
|
||||
#~ msgid "Print"
|
||||
#~ msgstr "打印"
|
||||
|
||||
|
@ -4931,6 +4936,7 @@ msgstr ""
|
|||
#~ msgid "PoS Backend"
|
||||
#~ msgstr "POS后端"
|
||||
|
||||
#, python-format
|
||||
#~ msgid "Next Order"
|
||||
#~ msgstr "下一订单"
|
||||
|
||||
|
|
|
@ -7,14 +7,14 @@ msgstr ""
|
|||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-12-21 17:06+0000\n"
|
||||
"PO-Revision-Date: 2012-11-27 09:28+0000\n"
|
||||
"Last-Translator: 盈通 ccdos <ccdos@163.com>\n"
|
||||
"PO-Revision-Date: 2013-07-28 11:18+0000\n"
|
||||
"Last-Translator: Wei \"oldrev\" Li <oldrev@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2013-03-16 05:25+0000\n"
|
||||
"X-Generator: Launchpad (build 16532)\n"
|
||||
"X-Launchpad-Export-Date: 2013-07-29 05:25+0000\n"
|
||||
"X-Generator: Launchpad (build 16700)\n"
|
||||
|
||||
#. module: product
|
||||
#: field:product.packaging,rows:0
|
||||
|
@ -513,7 +513,7 @@ msgstr "标准耳机"
|
|||
#. module: product
|
||||
#: model:product.uom,name:product.product_uom_day
|
||||
msgid "Day(s)"
|
||||
msgstr ""
|
||||
msgstr "天"
|
||||
|
||||
#. module: product
|
||||
#: help:product.product,incoming_qty:0
|
||||
|
@ -800,7 +800,7 @@ msgstr "结束日期"
|
|||
#. module: product
|
||||
#: model:product.uom,name:product.product_uom_litre
|
||||
msgid "Liter(s)"
|
||||
msgstr ""
|
||||
msgstr "升"
|
||||
|
||||
#. module: product
|
||||
#: view:product.price_list:0
|
||||
|
@ -843,7 +843,7 @@ msgstr "价格表"
|
|||
#. module: product
|
||||
#: model:product.uom,name:product.product_uom_hour
|
||||
msgid "Hour(s)"
|
||||
msgstr ""
|
||||
msgstr "小时"
|
||||
|
||||
#. module: product
|
||||
#: selection:product.template,state:0
|
||||
|
@ -1114,7 +1114,7 @@ msgstr "右父项"
|
|||
#. module: product
|
||||
#: field:product.product,price:0
|
||||
msgid "Price"
|
||||
msgstr ""
|
||||
msgstr "价格"
|
||||
|
||||
#. module: product
|
||||
#: field:product.pricelist.item,price_surcharge:0
|
||||
|
@ -1192,7 +1192,7 @@ msgstr "显示产品列表的顺序号"
|
|||
#. module: product
|
||||
#: model:product.uom,name:product.product_uom_dozen
|
||||
msgid "Dozen(s)"
|
||||
msgstr ""
|
||||
msgstr "打"
|
||||
|
||||
#. module: product
|
||||
#: field:product.uom,factor:0
|
||||
|
@ -1338,7 +1338,7 @@ msgstr "指定一个产品分类 ,规则只被应用在与这个分类以及
|
|||
#. module: product
|
||||
#: view:product.product:0
|
||||
msgid "Inventory"
|
||||
msgstr "盘点"
|
||||
msgstr "库存"
|
||||
|
||||
#. module: product
|
||||
#: field:product.product,seller_info_id:0
|
||||
|
@ -1346,7 +1346,7 @@ msgid "Supplier Info"
|
|||
msgstr "供应商信息"
|
||||
|
||||
#. module: product
|
||||
#: code:addons/product/product.py:729
|
||||
#: code:addons/product/product.py:732
|
||||
#, python-format
|
||||
msgid "%s (copy)"
|
||||
msgstr "%s (副本)"
|
||||
|
@ -1891,7 +1891,7 @@ msgstr "消息"
|
|||
#. module: product
|
||||
#: model:product.uom,name:product.product_uom_unit
|
||||
msgid "Unit(s)"
|
||||
msgstr ""
|
||||
msgstr "件"
|
||||
|
||||
#. module: product
|
||||
#: code:addons/product/product.py:176
|
||||
|
@ -2341,7 +2341,7 @@ msgstr "序列"
|
|||
msgid ""
|
||||
"Average delay in days to produce this product. In the case of multi-level "
|
||||
"BOM, the manufacturing lead times of the components will be added."
|
||||
msgstr ""
|
||||
msgstr "生成该产品的平均延时天数。在多级BoM的情况下,部件的制造提前期将被累加"
|
||||
|
||||
#. module: product
|
||||
#: model:product.template,name:product.product_assembly_product_template
|
||||
|
@ -2364,6 +2364,8 @@ msgid ""
|
|||
" </p>\n"
|
||||
" "
|
||||
msgstr ""
|
||||
"单击以创建一个新的计量单位\n"
|
||||
" "
|
||||
|
||||
#. module: product
|
||||
#: model:product.template,name:product.product_product_11_product_template
|
||||
|
@ -2444,7 +2446,7 @@ msgid "15” LCD Monitor"
|
|||
msgstr "15” LCD 显示器"
|
||||
|
||||
#. module: product
|
||||
#: code:addons/product/pricelist.py:376
|
||||
#: code:addons/product/pricelist.py:379
|
||||
#: field:product.pricelist.item,base_pricelist_id:0
|
||||
#, python-format
|
||||
msgid "Other Pricelist"
|
||||
|
|
|
@ -17,4 +17,4 @@ access_product_pricelist_partner_manager,product.pricelist partner manager,model
|
|||
access_product_product_employee,product.product employee,model_product_product,base.group_user,1,0,0,0
|
||||
access_product_template_sale_manager,product.template salemanager,model_product_template,base.group_sale_manager,1,1,1,1
|
||||
access_product_product_sale_manager,product.product salemanager,model_product_product,base.group_sale_manager,1,1,1,1
|
||||
access_product_category_sale_manager,product.category salemanager,product.model_product_category,base.group_sale_manager,1,1,1,1
|
||||
access_product_category_sale_manager,product.category salemanager,product.model_product_category,base.group_sale_manager,1,1,1,1
|
|
File diff suppressed because it is too large
Load Diff
|
@ -17,30 +17,6 @@ import werkzeug.wrappers
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def template_values():
|
||||
script = "\n".join(['<script type="text/javascript" src="%s"></script>' % i for i in manifest_list('js', db=request.db)])
|
||||
css = "\n".join('<link rel="stylesheet" href="%s">' % i for i in manifest_list('css', db=request.db))
|
||||
try:
|
||||
request.session.check_security()
|
||||
loggued = True
|
||||
uid = request.session._uid
|
||||
except http.SessionExpiredException:
|
||||
loggued = False
|
||||
uid = openerp.SUPERUSER_ID
|
||||
|
||||
values = {
|
||||
'loggued': loggued,
|
||||
'editable': loggued,
|
||||
'request': request,
|
||||
'registry': request.registry,
|
||||
'cr': request.cr,
|
||||
'uid': uid,
|
||||
'script': script,
|
||||
'css': css,
|
||||
'host_url': request.httprequest.host_url,
|
||||
}
|
||||
return values
|
||||
|
||||
class Website(openerp.addons.web.controllers.main.Home):
|
||||
@http.route('/', type='http', auth="admin")
|
||||
def index(self, **kw):
|
||||
|
@ -52,13 +28,11 @@ class Website(openerp.addons.web.controllers.main.Home):
|
|||
|
||||
@http.route('/pagenew/<path:path>', type='http', auth="admin")
|
||||
def pagenew(self, path):
|
||||
values = template_values()
|
||||
uid = values['uid']
|
||||
imd = request.registry['ir.model.data']
|
||||
view = request.registry['ir.ui.view']
|
||||
view_model, view_id = imd.get_object_reference(request.cr, uid, 'website', 'default_page')
|
||||
newview_id = view.copy(request.cr, uid, view_id)
|
||||
newview = view.browse(request.cr, uid, newview_id, context={})
|
||||
view_model, view_id = imd.get_object_reference(request.cr, request.uid, 'website', 'default_page')
|
||||
newview_id = view.copy(request.cr, request.uid, view_id)
|
||||
newview = view.browse(request.cr, request.uid, newview_id, context={})
|
||||
newview.write({
|
||||
'arch': newview.arch.replace("website.default_page", path),
|
||||
'name': "page/%s" % path
|
||||
|
@ -68,7 +42,7 @@ class Website(openerp.addons.web.controllers.main.Home):
|
|||
else:
|
||||
module = False
|
||||
idname = path
|
||||
imd.create(request.cr, uid, {
|
||||
imd.create(request.cr, request.uid, {
|
||||
'name': idname,
|
||||
'module': module,
|
||||
'model': 'ir.ui.view',
|
||||
|
@ -79,29 +53,14 @@ class Website(openerp.addons.web.controllers.main.Home):
|
|||
|
||||
@http.route('/page/<path:path>', type='http', auth="admin")
|
||||
def page(self, path):
|
||||
#def get_html_head():
|
||||
# head += ['<link rel="stylesheet" href="%s">' % i for i in manifest_list('css', db=request.db)]
|
||||
#modules = request.registry.get("ir.module.module").search_read(request.cr, openerp.SUPERUSER_ID, fields=['id', 'shortdesc', 'summary', 'icon_image'], limit=50)
|
||||
values = template_values()
|
||||
uid = values['uid']
|
||||
context = {
|
||||
'inherit_branding': values['editable'],
|
||||
}
|
||||
company = request.registry['res.company'].browse(request.cr, uid, 1, context=context)
|
||||
values.update(
|
||||
res_company=company,
|
||||
path=path,
|
||||
google_map_url="http://maps.googleapis.com/maps/api/staticmap?" + urllib.urlencode({
|
||||
'center': '%s, %s %s, %s' % (company.street, company.city, company.zip, company.country_id and company.country_id.name_get()[0][1] or ''),
|
||||
'sensor': 'false',
|
||||
'zoom': '8',
|
||||
'size': '298x298',
|
||||
}),
|
||||
)
|
||||
website = request.registry.get("website")
|
||||
values = website.get_rendering_context({
|
||||
'path': path
|
||||
})
|
||||
try:
|
||||
html = request.registry.get("ir.ui.view").render(request.cr, uid, path, values, context)
|
||||
except ValueError, e:
|
||||
html = request.registry.get("ir.ui.view").render(request.cr, uid, 'website.404', values, context)
|
||||
html = website.render(path, values)
|
||||
except ValueError:
|
||||
html = website.render('website.404', values)
|
||||
return html
|
||||
|
||||
@http.route('/website/attach', type='http', auth='admin') # FIXME: auth
|
||||
|
|
|
@ -1,4 +1,17 @@
|
|||
openerp.website = function(instance) {
|
||||
|
||||
instance.web.ActionManager.include({
|
||||
// Temporary fix until un-webclientization of the editorbar
|
||||
ir_actions_client: function (action) {
|
||||
if (instance.web.client_actions.get_object(action.tag)) {
|
||||
return this._super.apply(this, arguments);
|
||||
} else {
|
||||
console.warn("Action '%s' not found in registry", action.tag);
|
||||
return $.when();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var _lt = instance.web._lt;
|
||||
var QWeb = instance.web.qweb;
|
||||
instance.website.EditorBar = instance.web.Widget.extend({
|
||||
|
|
|
@ -4,18 +4,16 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<template id="header">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<a href='/page/website.homepage' class='brand'>
|
||||
<em>Open</em><b>ERP</b>
|
||||
<!--<img t-att-alt="res_company.name" src='/web/binary/company_logo'/></a>-->
|
||||
</a>
|
||||
<ul class="nav pull-right">
|
||||
<li class='pull-right'><a href="/admin">Sign in</a></li>
|
||||
<li class='pull-right'><a href="/page/website.contactus">Contact us</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<a href='/page/website.homepage' class='brand'>
|
||||
<em>Open</em><b>ERP</b>
|
||||
<!--<img t-att-alt="res_company.name" src='/web/binary/company_logo'/></a>-->
|
||||
</a>
|
||||
<ul class="nav pull-right">
|
||||
<li class='pull-right'><a href="/admin">Sign in</a></li>
|
||||
<li class='pull-right'><a href="/page/website.contactus">Contact us</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template id="footer">
|
||||
|
@ -38,12 +36,12 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div class="span4" name="about_us">
|
||||
<h5 t-record="res_company" t-field="name">Company name</h5>
|
||||
<h5 t-field="res_company.name">Company name</h5>
|
||||
<ul class='unstyled'>
|
||||
<li><a href="/page/website.contactus">Contact us</a></li>
|
||||
<li><a href="/page/website.news">News</a></li>
|
||||
<li><a href="/page/website.contactus">About us</a></li>
|
||||
<li><a href='#'>&#x2706; <span t-record="res_company" t-field="phone"/></a></li>
|
||||
<li><a href='#'>&#x2706; <span t-field="res_company.phone"/></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -75,23 +73,19 @@
|
|||
<link rel='stylesheet' href='/website/static/lib/bootstrap/css/bootstrap-responsive.css'/>
|
||||
</head>
|
||||
<body>
|
||||
<div id='wrap'>
|
||||
<header class='navbar navbar-fixed-top'>
|
||||
<div class='navbar-inner'>
|
||||
<t t-call="website.header"/>
|
||||
</div>
|
||||
</header>
|
||||
<div t-raw="0">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<h1>I'm an empty page, please edit me...</h1>
|
||||
</div>
|
||||
</div>
|
||||
<header class='navbar navbar-fixed-top'>
|
||||
<div class='navbar-inner'>
|
||||
<t t-call="website.header"/>
|
||||
</div>
|
||||
</header>
|
||||
<div t-raw="0" id="wrap">
|
||||
<div class="container">
|
||||
<h1>Main Layout</h1>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
<t t-call="website.footer"/>
|
||||
<p class="text-center">&copy; <span t-record="res_company" t-field="name">Company name</span>.</p>
|
||||
<p class="text-center">&copy; <span t-field="res_company.name">Company name</span>.</p>
|
||||
</footer>
|
||||
|
||||
<div class='oe_snippet_editor' style="display: none;">
|
||||
|
@ -353,9 +347,7 @@
|
|||
<t t-call="website.layout">
|
||||
<t t-set="title">Contact us - <t t-esc="res_company.name"/></t>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<h2>Contact us</h2>
|
||||
</div>
|
||||
<h2>Contact us</h2>
|
||||
<div class="row">
|
||||
<div class="span8">
|
||||
<p>
|
||||
|
@ -363,19 +355,19 @@
|
|||
</p><p>
|
||||
We'll do our best to get back to you as soon as possible.
|
||||
</p>
|
||||
<div class="text-center oe_mt32" name="mail_button">
|
||||
<div class="text-center mt64" name="mail_button">
|
||||
<a t-att-href="'mailto:'+res_company.email" class="btn btn-primary">Send us an email</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span4">
|
||||
<address>
|
||||
<strong t-record="res_company" t-field="name">Name</strong><br/>
|
||||
<span t-record="res_company" t-field="street"/><br/>
|
||||
<span t-record="res_company" t-field="city"/>, <span t-record="res_company" t-field="zip"/><br/>
|
||||
<span t-record="res_company" t-field="country_id"> </span><br/>
|
||||
<strong t-field="res_company.name">Name</strong><br/>
|
||||
<span t-field="res_company.street"/><br/>
|
||||
<span t-field="res_company.city"/>, <span t-field="res_company.zip"/><br/>
|
||||
<span t-field="res_company.country_id"> </span><br/>
|
||||
<br/>
|
||||
<span>&#x2706; <span t-record="res_company" t-field="phone"><t t-esc="res_company.phone"/></span></span><br/>
|
||||
<i class="icon-envelope"></i> <t t-esc="res_company.email"/>
|
||||
<span>&#x2706; <span t-field="res_company.phone"></span></span><br/>
|
||||
<i class="icon-envelope"></i> <span t-field="res_company.email"></span>
|
||||
</address>
|
||||
<img class="thumbnail" t-att-src="google_map_url"/>
|
||||
</div>
|
||||
|
|
|
@ -1,50 +1,54 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import openerp
|
||||
from openerp.osv import osv
|
||||
from openerp.addons.web import http
|
||||
from openerp.addons.web.controllers import main
|
||||
from openerp.addons.web.http import request
|
||||
|
||||
|
||||
class website(http.Controller):
|
||||
public_user_id = None
|
||||
def auth_method_public():
|
||||
registry = openerp.modules.registry.RegistryManager.get(request.db)
|
||||
request.public_uid = None
|
||||
with registry.cursor() as cr:
|
||||
request.public_uid = request.registry['ir.model.data'].get_object_reference(cr, openerp.SUPERUSER_ID, 'website', 'public_user')[1]
|
||||
if not request.session.uid:
|
||||
request.uid = request.public_uid
|
||||
else:
|
||||
request.uid = request.session.uid
|
||||
http.auth_methods['public'] = auth_method_public
|
||||
|
||||
def get_uid(self):
|
||||
try:
|
||||
request.session.check_security()
|
||||
uid = request.session._uid
|
||||
except http.SessionExpiredException:
|
||||
if not website.public_user_id:
|
||||
data_obj = request.registry['ir.model.data']
|
||||
website.public_user_id = data_obj.get_object_reference(request.cr, openerp.SUPERUSER_ID, 'website', 'public_user')[1]
|
||||
uid = website.public_user_id
|
||||
|
||||
return uid
|
||||
class website(osv.osv):
|
||||
_name = "website" # Avoid website.website convention for conciseness (for new api). Got a special authorization from xmo and rco
|
||||
_description = "Website"
|
||||
|
||||
def isloggued(self):
|
||||
return website.public_user_id != self.get_uid()
|
||||
|
||||
def render(self, cr, uid, template, add_values={}):
|
||||
script = "\n".join(['<script type="text/javascript" src="%s"></script>' % i for i in main.manifest_list('js', db=request.db)])
|
||||
css = "\n".join('<link rel="stylesheet" href="%s">' % i for i in main.manifest_list('css', db=request.db))
|
||||
_values = {
|
||||
'editable': self.isloggued(),
|
||||
def get_rendering_context(self, additional_values=None):
|
||||
debug = 'debug' in request.params
|
||||
editable = False
|
||||
if request.uid or (request.public_uid and request.uid != request.public_uid):
|
||||
editable = True
|
||||
values = {
|
||||
'debug': debug,
|
||||
'editable': editable,
|
||||
'request': request,
|
||||
'registry': request.registry,
|
||||
'cr': cr,
|
||||
'uid': uid,
|
||||
'script': script,
|
||||
'css': css,
|
||||
'cr': request.cr,
|
||||
'uid': request.uid,
|
||||
'host_url': request.httprequest.host_url,
|
||||
'res_company': request.registry['res.company'].browse(request.cr, openerp.SUPERUSER_ID, 1),
|
||||
}
|
||||
_values.update(add_values)
|
||||
return request.registry.get("ir.ui.view").render(cr, uid, template, _values)
|
||||
if editable:
|
||||
values.update({
|
||||
'script': "\n".join(['<script type="text/javascript" src="%s"></script>' % i for i in main.manifest_list('js', db=request.db, debug=debug)]),
|
||||
'css': "\n".join('<link rel="stylesheet" href="%s">' % i for i in main.manifest_list('css', db=request.db, debug=debug))
|
||||
})
|
||||
if additional_values:
|
||||
values.update(additional_values)
|
||||
return values
|
||||
|
||||
@staticmethod
|
||||
def route(*args, **kwargs):
|
||||
def wrap(_funct):
|
||||
@http.route(*args, **kwargs)
|
||||
def wrapper(self, *a, **k):
|
||||
return _funct(self, request.cr, self.get_uid(), *a, **k)
|
||||
return wrapper
|
||||
return wrap
|
||||
def render(self, template, values={}):
|
||||
# context = {
|
||||
# 'inherit_branding': values['editable'],
|
||||
# }
|
||||
return request.registry.get("ir.ui.view").render(request.cr, request.uid, template, values)
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import openerp
|
||||
from openerp.addons.web import http
|
||||
from openerp.addons.web.http import request
|
||||
from openerp.addons.website.controllers.main import template_values
|
||||
|
||||
from urllib import quote_plus
|
||||
|
||||
|
@ -11,16 +9,14 @@ class contactus(http.Controller):
|
|||
|
||||
@http.route(['/crm/contactus'], type='http', auth="admin")
|
||||
def contactus(self, *arg, **post):
|
||||
website = request.registry['website']
|
||||
post['user_id'] = False
|
||||
request.registry['crm.lead'].create(request.cr, request.uid, post)
|
||||
values = template_values()
|
||||
company = request.registry['res.company'].browse(request.cr, request.uid, 1)
|
||||
values = website.get_rendering_context()
|
||||
company = values['res_company']
|
||||
values.update({
|
||||
'res_company': company,
|
||||
'google_map_url': "http://maps.googleapis.com/maps/api/staticmap?center=%s&sensor=false&zoom=8&size=298x298" % quote_plus('%s, %s %s, %s' % (company.street, company.city, company.zip, company.country_id and company.country_id.name_get()[0][1] or ''))
|
||||
})
|
||||
html = request.registry.get("ir.ui.view").render(request.cr, request.uid, "website_crm.thanks", values)
|
||||
return html
|
||||
|
||||
return website.render("website_crm.thanks", values)
|
||||
|
||||
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
import controllers
|
||||
import event
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
'name': 'Website Event',
|
||||
'category': 'mail',
|
||||
'version': '1.0',
|
||||
'description': """
|
||||
OpenERP Blog
|
||||
============
|
||||
|
||||
""",
|
||||
'author': 'OpenERP SA',
|
||||
'depends': ['website', 'event', 'website_sale'],
|
||||
'data': [
|
||||
'views/website_event.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'security/website_event.xml',
|
||||
],
|
||||
'qweb': ['static/src/xml/*.xml'],
|
||||
'installable': True,
|
||||
'auto_install': True,
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
import main
|
|
@ -0,0 +1,122 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from openerp.addons.web import http
|
||||
from openerp.addons.web.http import request
|
||||
from openerp.tools.translate import _
|
||||
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from openerp import tools
|
||||
import urllib
|
||||
import werkzeug
|
||||
|
||||
|
||||
class website_event(http.Controller):
|
||||
|
||||
@http.route(['/event'], type='http', auth="public")
|
||||
def events(self, **searches):
|
||||
website = request.registry['website']
|
||||
event_obj = request.registry['event.event']
|
||||
|
||||
searches.setdefault('date', 'all')
|
||||
searches.setdefault('type', 'all')
|
||||
searches.setdefault('country', 'all')
|
||||
|
||||
domain_search = {}
|
||||
|
||||
def sd(date):
|
||||
return date.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
today = datetime.today()
|
||||
dates = [
|
||||
['all', _('All Dates'), [(1, "=", 1)], 0],
|
||||
['today', _('Today'), [
|
||||
("date_begin", ">", sd(today)),
|
||||
("date_begin", "<", sd(today + relativedelta(days=1)))],
|
||||
0],
|
||||
['tomorrow', _('Tomorrow'), [
|
||||
("date_begin", ">", sd(today + relativedelta(days=1))),
|
||||
("date_begin", "<", sd(today + relativedelta(days=2)))],
|
||||
0],
|
||||
['week', _('This Week'), [
|
||||
("date_begin", ">=", sd(today + relativedelta(days=-today.weekday()))),
|
||||
("date_begin", "<", sd(today + relativedelta(days=6-today.weekday())))],
|
||||
0],
|
||||
['nextweek', _('Next Week'), [
|
||||
("date_begin", ">=", sd(today + relativedelta(days=7-today.weekday()))),
|
||||
("date_begin", "<", sd(today + relativedelta(days=13-today.weekday())))],
|
||||
0],
|
||||
['month', _('This month'), [
|
||||
("date_begin", ">=", sd(today.replace(day=1) + relativedelta(months=1))),
|
||||
("date_begin", "<", sd(today.replace(day=1) + relativedelta(months=1)))],
|
||||
0],
|
||||
]
|
||||
|
||||
# search domains
|
||||
for date in dates:
|
||||
if searches.get("date") == date[0]:
|
||||
domain_search["date"] = date[2]
|
||||
if searches.get("type", "all") != 'all':
|
||||
domain_search["type"] = [("type", "=", int(searches.get("type")))]
|
||||
if searches.get("country", "all") != 'all':
|
||||
domain_search["country"] = [("country_id", "=", int(searches.get("country")))]
|
||||
|
||||
def dom_without(without):
|
||||
domain = [(1, "=", 1)]
|
||||
for key, search in domain_search.items():
|
||||
if key != without:
|
||||
domain += search
|
||||
print domain
|
||||
return domain
|
||||
|
||||
# count by domains without self search
|
||||
for date in dates:
|
||||
date[3] = event_obj.search(request.cr, request.uid, dom_without('date') + date[2], count=True)
|
||||
|
||||
domain = dom_without('type')
|
||||
types = event_obj.read_group(request.cr, request.uid, domain, ["id", "type"], groupby="type", orderby="type")
|
||||
types.insert(0, {'type_count': event_obj.search(request.cr, request.uid, domain, count=True), 'type': ("all", _("All Categories"))})
|
||||
|
||||
domain = dom_without('country')
|
||||
countries = event_obj.read_group(request.cr, request.uid, domain, ["id", "country_id"], groupby="country_id", orderby="country_id")
|
||||
countries.insert(0, {'country_id_count': event_obj.search(request.cr, request.uid, domain, count=True), 'country_id': ("all", _("All Countries"))})
|
||||
|
||||
|
||||
obj_ids = event_obj.search(request.cr, request.uid, dom_without("none"), order="date_begin DESC")
|
||||
values = website.get_rendering_context({
|
||||
'event_ids': event_obj.browse(request.cr, request.uid, obj_ids),
|
||||
'dates': dates,
|
||||
'types': types,
|
||||
'countries': countries,
|
||||
'searches': searches,
|
||||
'search_path': "?%s" % urllib.urlencode(searches),
|
||||
})
|
||||
|
||||
return website.render("website_event.index", values)
|
||||
|
||||
@http.route(['/event/<int:event_id>'], type='http', auth="public")
|
||||
def event(self, event_id=None, **post):
|
||||
website = request.registry['website']
|
||||
event = request.registry['event.event'].browse(request.cr, request.uid, event_id)
|
||||
values = website.get_rendering_context({
|
||||
'event_id': event,
|
||||
'google_map_url': "http://maps.googleapis.com/maps/api/staticmap?center=%s&sensor=false&zoom=12&size=298x298" % urllib.quote_plus('%s, %s %s, %s' % (event.street, event.city, event.zip, event.country_id and event.country_id.name_get()[0][1] or ''))
|
||||
})
|
||||
return website.render("website_event.detail", values)
|
||||
|
||||
@http.route(['/event/<int:event_id>/add_cart'], type='http', auth="public")
|
||||
def add_cart(self, event_id=None, **post):
|
||||
if not post:
|
||||
return werkzeug.utils.redirect("/event/%s/" % event_id)
|
||||
|
||||
return werkzeug.utils.redirect("/shop/checkout")
|
||||
|
||||
@http.route(['/event/publish'], type='http', auth="public")
|
||||
def publish(self, **post):
|
||||
obj_id = int(post['id'])
|
||||
data_obj = request.registry['event.event']
|
||||
|
||||
obj = data_obj.browse(request.cr, request.uid, obj_id)
|
||||
data_obj.write(request.cr, request.uid, [obj_id], {'website_published': not obj.website_published})
|
||||
obj = data_obj.browse(request.cr, request.uid, obj_id)
|
||||
|
||||
return obj.website_published and "1" or "0"
|
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from openerp.osv import osv, fields
|
||||
|
||||
|
||||
class event(osv.osv):
|
||||
_inherit = 'event.event'
|
||||
_columns = {
|
||||
'website_published': fields.boolean('Available in the website'),
|
||||
'description_website': fields.html('Description for the website'),
|
||||
'product_ids': fields.one2many('event.event.product', "event_id", "Event"),
|
||||
}
|
||||
|
||||
|
||||
class event_product(osv.osv):
|
||||
_name = 'event.event.product'
|
||||
_columns = {
|
||||
'event_id': fields.many2one('event.event', "Event"),
|
||||
'product_id': fields.many2one('product.product', 'Product'),
|
||||
'price': fields.float('Price'),
|
||||
'qty': fields.integer('Current Registrations', readonly=True),
|
||||
'max_qty': fields.integer('Maximum Registrations'),
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_event_event_public,event.event.public,event.model_event_event,base.group_public,1,0,0,0
|
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="event_event_public" model="ir.rule">
|
||||
<field name="name">event: Public</field>
|
||||
<field name="model_id" ref="event.model_event_event"/>
|
||||
<field name="domain_force">[('website_published', '=', True)]</field>
|
||||
<field name="groups" eval="[(4, ref('base.group_public'))]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
<field name="perm_unlink" eval="False"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,2 @@
|
|||
sass:
|
||||
sass --compass --trace -t expanded hr.sass hr.css
|
|
@ -0,0 +1 @@
|
|||
@import "compass/css3"
|
|
@ -0,0 +1,18 @@
|
|||
$(document).ready(function () {
|
||||
$(document).on('click', '.js_publish, .js_unpublish', function (e) {
|
||||
e.preventDefault();
|
||||
var $link = $(this).parent();
|
||||
$link.find('.js_publish, .js_unpublish').addClass("hidden");
|
||||
var $unp = $link.find(".js_unpublish");
|
||||
var $p = $link.find(".js_publish");
|
||||
$.post('/event/publish', {'id': $link.data('id')}, function (result) {
|
||||
if (+result) {
|
||||
$p.addClass("hidden");
|
||||
$unp.removeClass("hidden");
|
||||
} else {
|
||||
$p.removeClass("hidden");
|
||||
$unp.addClass("hidden");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
|
@ -0,0 +1,194 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_event_form" model="ir.ui.view">
|
||||
<field name="name">view_event_form</field>
|
||||
<field name="model">event.event</field>
|
||||
<field name="inherit_id" ref="event.view_event_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//notebook" position="inside">
|
||||
<page string="Tarifs">
|
||||
<group colspan="4">
|
||||
<field name="product_ids">
|
||||
<tree string="Payments" editable="top">
|
||||
<field name="product_id"/>
|
||||
<field name="price"/>
|
||||
<field name="max_qty"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Layout add nav and footer -->
|
||||
|
||||
<record id="header_website_event" model="ir.ui.view">
|
||||
<field name="name">header_website_event</field>
|
||||
<field name="inherit_id" ref="website.header"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="(//li)[last()]" position="after">
|
||||
<li class="pull-right"><a href="/event">Events</a></li>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
<record id="footer_website_event" model="ir.ui.view">
|
||||
<field name="name">footer_website_event</field>
|
||||
<field name="inherit_id" ref="website.footer"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//a[@href='/page/website.contactus']" position="after">
|
||||
<li><a href="/event">Events</a></li>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Page -->
|
||||
<template id="button">
|
||||
<t t-if="event_id.register_avail">
|
||||
<span t-if="event_id.register_avail == 9999" class="label pull-right">No ticket available.</span>
|
||||
<span t-if="event_id.register_avail != 9999" t-att-class="'label pull-right label-%%s' %% (event_id.register_avail <= 10 and 'warning' or 'info')">
|
||||
<t t-if="event_id.register_avail <= 10">Only</t>
|
||||
<t t-esc="event_id.register_avail"/>
|
||||
<t t-if="event_id.register_avail > 1">tickets </t>
|
||||
<t t-if="event_id.register_avail == 1">ticket </t>
|
||||
available.
|
||||
</span>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="index">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
<script type="text/javascript" src="/website_event/static/src/js/website_event.js"></script>
|
||||
<t t-raw="head"/>
|
||||
</t>
|
||||
<t t-set="title">Events</t>
|
||||
<div class="container mt48">
|
||||
<div class="row">
|
||||
<div class="span4 css_noprint">
|
||||
<ul class="nav nav-list">
|
||||
<li class="nav-header">Date</li>
|
||||
<t t-foreach="dates" t-as="date">
|
||||
<li t-att-class="searches.get('date') == date[0] and 'active' or ''">
|
||||
<a t-att-href="'/event/%%s&date=%%s' %% (search_path, date[0])"><t t-esc="date[1]"/> <small t-if="date[3]">(<t t-esc="date[3]"/>)</small></a>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
<ul class="nav nav-list">
|
||||
<li class="nav-header">Category</li>
|
||||
<t t-foreach="types">
|
||||
<li t-if="type" t-att-class="searches.get('type') == str(type[0]) and 'active' or ''">
|
||||
<a t-att-href="'/event/%%s&type=%%s' %% (search_path, type[0])"><t t-esc="type[1]"/> <small>(<t t-esc="type_count"/>)</small></a>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
<ul class="nav nav-list">
|
||||
<li class="nav-header">Location</li>
|
||||
<t t-foreach="countries">
|
||||
<li t-if="country_id" t-att-class="searches.get('country') == str(country_id[0]) and 'active' or ''">
|
||||
<a t-att-href="'/event/%%s&country=%%s' %% (search_path, country_id[0])"><t t-esc="country_id[1]"/><small>(<t t-esc="country_id_count"/>)</small></a>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="span8">
|
||||
<ul class="media-list mt32">
|
||||
<t t-foreach="event_ids" t-as="event_id">
|
||||
<li class="media thumbnail">
|
||||
<div class="media-body">
|
||||
<t t-call="website_event.button"/>
|
||||
<h4 class="media-heading"><a t-att-href="'/event/%%s' %% event_id.id"><span t-field="event_id.name"> </span></a></h4>
|
||||
<a t-if="editable" href="#" t-att-data-id="event_id.id" class="pull-right">
|
||||
<span t-att-class="'label label-success js_unpublish %%s' %% (not event_id.website_published and 'hidden' or '')">Click to Unpublish</span>
|
||||
<span t-att-class="'label label-important js_publish %%s' %% (event_id.website_published and 'hidden' or '')">Click to Publish</span>
|
||||
</a>
|
||||
<div>
|
||||
<span t-field="event_id.type">: </span>
|
||||
<t t-if="event_id.user_id">
|
||||
Organized by: <span t-field="event_id.user_id"> </span>
|
||||
</t>
|
||||
</div>
|
||||
<div>
|
||||
<i class="icon-time"></i> <span t-field="event_id.date_begin"> </span> <i>to</i> <span t-field="event_id.date_end"> </span>
|
||||
</div>
|
||||
<div t-if="event_id.country_id">
|
||||
<i class="icon-map-marker"></i> <span t-field="event_id.city"> </span> <span t-field="event_id.zip"> </span>, <span t-field="event_id.country_id"> </span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="detail">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
<script type="text/javascript" src="/website_event/static/src/js/website_event.js"></script>
|
||||
<t t-raw="head"/>
|
||||
</t>
|
||||
<t t-set="title">Events</t>
|
||||
<div class="container mt48">
|
||||
<div class="row">
|
||||
<div class="span4 css_noprint">
|
||||
<h4>When & Where</h4>
|
||||
<img t-att-src="google_map_url"/>
|
||||
<address>
|
||||
<h4 t-field="event_id.address_id">Name</h4><br/>
|
||||
<span t-field="event_id.street"/><br/>
|
||||
<span t-field="event_id.city"/>, <span t-field="event_id.zip"/><br/>
|
||||
<span t-field="event_id.country_id"> </span><br/>
|
||||
<i class="icon-time"></i> <span t-field="event_id.date_begin"> </span><br/>
|
||||
<i class="icon-time"></i> <span t-field="event_id.date_end"> </span><br/>
|
||||
<br/>
|
||||
<t t-if="event_id.user_id">
|
||||
Organized by: <span t-field="event_id.user_id"/><br/>
|
||||
<span>&#x2706; <span t-field="event_id.user_id.phone"></span></span><br/>
|
||||
<i class="icon-envelope"></i> <span t-field="event_id.user_id.email"></span>
|
||||
</t>
|
||||
</address>
|
||||
</div>
|
||||
<div class="span8">
|
||||
<div class="media-body">
|
||||
<t t-call="website_event.button"/>
|
||||
<h4 class="media-heading"><a t-att-href="'/event/%%s' %% event_id.id"><span t-field="event_id.name"> </span></a></h4>
|
||||
<a t-if="editable" href="#" t-att-data-id="event_id.id" class="pull-right">
|
||||
<span t-att-class="'label label-success js_unpublish %%s' %% (not event_id.website_published and 'hidden' or '')">Click to Unpublish</span>
|
||||
<span t-att-class="'label label-important js_publish %%s' %% (event_id.website_published and 'hidden' or '')">Click to Publish</span>
|
||||
</a>
|
||||
<h4>Ticket Information</h4>
|
||||
<form t-att-action="'/event/%%s/add_cart' %% event_id.id" method="post">
|
||||
<div t-foreach="event_id.product_ids" t-as="prod">
|
||||
<span t-field="prod.product_id"/>
|
||||
<span t-field="prod.price"/>
|
||||
<span t-field="prod.qty"/>
|
||||
<span t-field="prod.max_qty"/>
|
||||
<select t-att-name="'product[%%s]' %% prod.id">
|
||||
<t t-foreach="range(0,10)" t-as="nb">
|
||||
<option t-esc="nb"/>
|
||||
</t>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Order Now</button>
|
||||
</form>
|
||||
<h4>Event Details</h4>
|
||||
<div t-field="event_id.description_website"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
</data>
|
||||
</openerp>
|
|
@ -11,6 +11,8 @@ OpenERP Blog
|
|||
'depends': ['website', 'hr'],
|
||||
'data': [
|
||||
'views/website_hr.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'security/website_hr.xml',
|
||||
],
|
||||
'qweb': ['static/src/xml/*.xml'],
|
||||
'installable': True,
|
||||
|
|
|
@ -1,19 +1,38 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from openerp.addons.web import http
|
||||
from openerp.addons.web.http import request
|
||||
from openerp.addons.website import website
|
||||
|
||||
class website_hr(website):
|
||||
class website_hr(http.Controller):
|
||||
|
||||
@website.route(['/team'], type='http', auth="admin")
|
||||
def blog(self, cr, uid, **post):
|
||||
@http.route(['/hr'], type='http', auth="public")
|
||||
def blog(self, **post):
|
||||
website = request.registry['website']
|
||||
hr_obj = request.registry['hr.employee']
|
||||
employee_ids = hr_obj.search(request.cr, request.uid, [(1, "=", 1)])
|
||||
values = website.get_rendering_context({
|
||||
'employee_ids': hr_obj.browse(request.cr, request.uid, employee_ids)
|
||||
})
|
||||
return website.render("website_hr.index", values)
|
||||
|
||||
employee_ids = hr_obj.search(cr, uid, [(1, "=", 1)])
|
||||
values = {
|
||||
'res_company': request.registry['res.company'].browse(cr, uid, 1),
|
||||
'employee_ids': hr_obj.browse(cr, uid, employee_ids),
|
||||
}
|
||||
@http.route(['/hr/publish'], type='http', auth="public")
|
||||
def publish(self, **post):
|
||||
obj_id = int(post['id'])
|
||||
data_obj = request.registry['hr.employee']
|
||||
|
||||
html = self.render(cr, uid, "website_hr.index", values)
|
||||
return html
|
||||
obj = data_obj.browse(request.cr, request.uid, obj_id)
|
||||
data_obj.write(request.cr, request.uid, [obj_id], {'website_published': not obj.website_published})
|
||||
obj = data_obj.browse(request.cr, request.uid, obj_id)
|
||||
|
||||
return obj.website_published and "1" or "0"
|
||||
|
||||
@http.route(['/hr/publish_contact'], type='http', auth="public")
|
||||
def publish_contact(self, **post):
|
||||
obj_id = int(post['id'])
|
||||
data_obj = request.registry['hr.employee']
|
||||
|
||||
obj = data_obj.browse(request.cr, request.uid, obj_id)
|
||||
data_obj.write(request.cr, request.uid, [obj_id], {'website_published_on_contact_form': not obj.website_published_on_contact_form})
|
||||
obj = data_obj.browse(request.cr, request.uid, obj_id)
|
||||
|
||||
return obj.website_published_on_contact_form and "1" or "0"
|
||||
|
|
|
@ -6,6 +6,7 @@ from openerp.osv import osv, fields
|
|||
class hr(osv.osv):
|
||||
_inherit = 'hr.employee'
|
||||
_columns = {
|
||||
'website_important': fields.boolean('Publish', help="Publish also on contact form"),
|
||||
'website_published': fields.boolean('Available in the website'),
|
||||
'website_published_on_contact_form': fields.boolean('Publish', help="Publish also on contact form"),
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_hr_employee_public,hr.employee.public,hr.model_hr_employee,base.group_public,1,0,0,0
|
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="hr_employee_public" model="ir.rule">
|
||||
<field name="name">hr_employee: Public</field>
|
||||
<field name="model_id" ref="hr.model_hr_employee"/>
|
||||
<field name="domain_force">[('website_published', '=', True)]</field>
|
||||
<field name="groups" eval="[(4, ref('base.group_public'))]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
<field name="perm_unlink" eval="False"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,3 +1,34 @@
|
|||
$(document).ready(function () {
|
||||
|
||||
$(document).on('click', '.js_publish, .js_unpublish', function (e) {
|
||||
e.preventDefault();
|
||||
var $link = $(this).parent();
|
||||
$link.find('.js_publish, .js_unpublish').addClass("hidden");
|
||||
var $unp = $link.find(".js_unpublish");
|
||||
var $p = $link.find(".js_publish");
|
||||
$.post('/hr/publish', {'id': $link.data('id')}, function (result) {
|
||||
if (+result) {
|
||||
$p.addClass("hidden");
|
||||
$unp.removeClass("hidden");
|
||||
} else {
|
||||
$p.removeClass("hidden");
|
||||
$unp.addClass("hidden");
|
||||
}
|
||||
});
|
||||
});
|
||||
$(document).on('click', '.js_publish_contact, .js_unpublish_contact', function (e) {
|
||||
e.preventDefault();
|
||||
var $link = $(this).parent();
|
||||
$link.find('.js_publish_contact, .js_unpublish_contact').addClass("hidden");
|
||||
var $unp = $link.find(".js_unpublish_contact");
|
||||
var $p = $link.find(".js_publish_contact");
|
||||
$.post('/hr/publish_contact', {'id': $link.data('id')}, function (result) {
|
||||
if (+result) {
|
||||
$p.addClass("hidden");
|
||||
$unp.removeClass("hidden");
|
||||
} else {
|
||||
$p.removeClass("hidden");
|
||||
$unp.addClass("hidden");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
|
@ -4,13 +4,13 @@
|
|||
|
||||
<!-- Layout add nav and footer -->
|
||||
|
||||
<record id="footer_hr_mail" model="ir.ui.view">
|
||||
<record id="footer_website_hr" model="ir.ui.view">
|
||||
<field name="name">footer_website_hr</field>
|
||||
<field name="inherit_id" ref="website.footer"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//a[@href='/page/website.contactus']" position="after">
|
||||
<li><a href="/team">Team</a></li>
|
||||
<li><a href="/hr">Team</a></li>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
|
@ -21,27 +21,42 @@
|
|||
<template id="index">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
<script type="text/javascript" src="/website_mail/static/src/js/blog.js"></script>
|
||||
<link rel='stylesheet' href='/website_mail/static/src/css/blog.css'/>
|
||||
<script type="text/javascript" src="/website_hr/static/src/js/hr.js"></script>
|
||||
<t t-raw="head"/>
|
||||
</t>
|
||||
<t t-set="title">Team</t>
|
||||
<div class="container mt48">
|
||||
<ul class="media-list">
|
||||
<t t-foreach="employee_ids">
|
||||
<!-- TODO: check qweb iteration -->
|
||||
<li class="media pull-left">
|
||||
<div t-att-class="'media-body %%s' %% (website_important and 'css_important' or '')">
|
||||
<a href="#" t-att-data-id="id" class="js_important pull-right" groups="group_website_mail_manager">
|
||||
<span class="label label-success">Unpublish</span>
|
||||
<span class="label label-important">Publish</span>
|
||||
<div class="container">
|
||||
<div class="thumbnails">
|
||||
<t t-foreach="employee_ids" t-as="employee_id">
|
||||
<div class="span4 mt16">
|
||||
<div class="media thumbnail">
|
||||
<a class="pull-left" href="#">
|
||||
<img class="media-object" t-att-src="'data:image/png;base64,%%s' %% employee_id.image_small"/>
|
||||
</a>
|
||||
<t t-raw="image"/>
|
||||
<t t-raw="name"/>
|
||||
<div class="media-body">
|
||||
<t t-if="editable">
|
||||
<div class="pull-right">
|
||||
<a href="#" t-att-data-id="employee_id.id">
|
||||
<span t-att-class="'label label-success js_unpublish %%s' %% (not employee_id.website_published and 'hidden' or '')">Click to Unpublish</span>
|
||||
<span t-att-class="'label label-important js_publish %%s' %% (employee_id.website_published and 'hidden' or '')">Click to Publish</span>
|
||||
</a><br/>
|
||||
<a href="#" t-att-data-id="employee_id.id">
|
||||
<span t-att-class="'label label-success js_unpublish_contact %%s' %% (not employee_id.website_published and 'hidden' or '')">hidden on Contacts</span>
|
||||
<span t-att-class="'label label-important js_publish_contact %%s' %% (employee_id.website_published and 'hidden' or '')">display in Contacts</span>
|
||||
</a>
|
||||
</div>
|
||||
</t>
|
||||
<h5 class="media-heading"><t t-esc="employee_id.name"/></h5>
|
||||
<div t-record="employee_id" t-field="department_id"> </div>
|
||||
<div t-record="employee_id" t-field="job_id"> </div>
|
||||
<div t-record="employee_id" t-field="work_location"> </div>
|
||||
<div t-record="employee_id" t-field="work_phone"> </div>
|
||||
<div t-record="employee_id" t-field="work_email"> </div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</t>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
|
|
@ -1,40 +1,34 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import openerp
|
||||
from openerp.addons.web import http
|
||||
from openerp.addons.web.http import request
|
||||
from openerp.addons.website.controllers.main import template_values
|
||||
import base64
|
||||
import tempfile
|
||||
|
||||
from urllib import quote_plus
|
||||
|
||||
class website_hr_recruitment(http.Controller):
|
||||
|
||||
@http.route(['/career'], type='http', auth="admin")
|
||||
def career(self, *arg, **post):
|
||||
values = template_values()
|
||||
@http.route(['/career'], type='http', auth="public")
|
||||
def career(self, **post):
|
||||
website = request.registry['website']
|
||||
jobpost_ids = request.registry['hr.job'].search(request.cr, request.uid, [("state", "=", 'open')])
|
||||
values.update({
|
||||
'res_job': request.registry['hr.job'].browse(request.cr, request.uid, jobpost_ids),
|
||||
'res_company': request.registry['res.company'].browse(request.cr, request.uid, 1)
|
||||
values = website.get_rendering_context({
|
||||
'res_job': request.registry['hr.job'].browse(request.cr, request.uid, jobpost_ids)
|
||||
})
|
||||
html = request.registry.get("ir.ui.view").render(request.cr, request.uid, "website_hr_recruitment.career", values)
|
||||
html = website.render("website_hr_recruitment.career", values)
|
||||
return html
|
||||
|
||||
@http.route(['/job/detail/<id>'], type='http', auth="admin")
|
||||
@http.route(['/job/detail/<id>'], type='http', auth="public")
|
||||
def detail(self, id=0):
|
||||
values = template_values()
|
||||
id = id and int(id) or 0
|
||||
values.update({
|
||||
'job': request.registry['hr.job'].browse(request.cr, request.uid, id),
|
||||
'res_company': request.registry['res.company'].browse(request.cr, request.uid, 1)
|
||||
website = request.registry['website']
|
||||
values = website.get_rendering_context({
|
||||
'job': request.registry['hr.job'].browse(request.cr, request.uid, id)
|
||||
})
|
||||
html = request.registry.get("ir.ui.view").render(request.cr, request.uid, "website_hr_recruitment.detail", values)
|
||||
html = website.render("website_hr_recruitment.detail", values)
|
||||
return html
|
||||
|
||||
@http.route(['/job/success'], type='http', auth="admin")
|
||||
def success(self, *arg, **post):
|
||||
def success(self, **post):
|
||||
id = request.registry['hr.applicant'].create(request.cr, request.uid, post)
|
||||
if post['ufile']:
|
||||
attachment_values = {
|
||||
|
@ -46,11 +40,10 @@ class website_hr_recruitment(http.Controller):
|
|||
'res_id': id
|
||||
}
|
||||
request.registry['ir.attachment'].create(request.cr, request.uid, attachment_values)
|
||||
values = template_values()
|
||||
values.update({
|
||||
'jobid': post['job_id'],
|
||||
'res_company': request.registry['res.company'].browse(request.cr, request.uid, 1)
|
||||
website = request.registry['website']
|
||||
values = website.get_rendering_context({
|
||||
'jobid': post['job_id']
|
||||
})
|
||||
html = request.registry.get("ir.ui.view").render(request.cr, request.uid, "website_hr_recruitment.thankyou", values)
|
||||
html = website.render("website_hr_recruitment.thankyou", values)
|
||||
return html
|
||||
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<t t-foreach="res_job" t-as="job">
|
||||
<tr>
|
||||
<td>
|
||||
<a t-att-href="'/job/detail/%%s' %% job.id"><span class="lead" t-record="job" t-field="name"><t t-esc="job.name"/></span></a><br/>
|
||||
<a t-att-href="'/job/detail/%%s' %% job.id"><span class="lead"><t t-esc="job.name"/></span></a><br/>
|
||||
<span t-if="job.department_id"><t t-esc="job.department_id.name"/></span>
|
||||
<span><t t-esc="job.post_date"/></span>
|
||||
</td>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from openerp.addons.web import http
|
||||
from openerp.addons.web.http import request
|
||||
from openerp.addons.website import website
|
||||
import werkzeug
|
||||
from openerp.tools.translate import _
|
||||
from openerp.tools.safe_eval import safe_eval
|
||||
|
@ -10,25 +10,25 @@ import simplejson
|
|||
_months = {1:_("January"), 2:_("February"), 3:_("March"), 4:_("April"), 5:_("May"), 6:_("June"), 7:_("July"), 8:_("August"), 9:_("September"), 10:_("October"), 11:_("November"), 12:_("December")}
|
||||
|
||||
|
||||
class website_mail(website):
|
||||
class website_mail(http.Controller):
|
||||
|
||||
@website.route(['/blog', '/blog/<int:mail_group_id>', '/blog/<int:mail_group_id>/<int:blog_id>'], type='http', auth="admin")
|
||||
def blog(self, cr, uid, mail_group_id=None, blog_id=None, **post):
|
||||
@http.route(['/blog', '/blog/<int:mail_group_id>', '/blog/<int:mail_group_id>/<int:blog_id>'], type='http', auth="public")
|
||||
def blog(self, mail_group_id=None, blog_id=None, **post):
|
||||
website = request.registry['website']
|
||||
group_obj = request.registry['mail.group']
|
||||
message_obj = request.registry['mail.message']
|
||||
|
||||
values = {
|
||||
'res_company': request.registry['res.company'].browse(cr, uid, 1),
|
||||
values = website.get_rendering_context({
|
||||
'blog_ids': None,
|
||||
'blog_id': None,
|
||||
'nav_list': dict(),
|
||||
'prev_date': None,
|
||||
'next_date': None,
|
||||
'mail_group_id': mail_group_id,
|
||||
}
|
||||
})
|
||||
domain = mail_group_id and [("res_id", "=", mail_group_id)] or []
|
||||
|
||||
for group in message_obj.read_group(cr, uid, domain + group_obj.get_public_domain(cr, uid), ['subject', 'date'], groupby="date", orderby="create_date asc"):
|
||||
for group in message_obj.read_group(request.cr, request.uid, domain + group_obj.get_public_blog(request.cr, request.uid), ['subject', 'date'], groupby="date", orderby="create_date asc"):
|
||||
year = group['date'].split(" ")[1]
|
||||
if not values['nav_list'].get(year):
|
||||
values['nav_list'][year] = {'name': year, 'date_count': 0, 'months': []}
|
||||
|
@ -36,57 +36,54 @@ class website_mail(website):
|
|||
values['nav_list'][year]['months'].append(group)
|
||||
|
||||
if post.get('date'):
|
||||
ids = group_obj.get_public_message_ids(cr, uid, domain=domain + [("date", ">", post.get('date'))], order="create_date asc", limit=10)
|
||||
ids = group_obj.get_public_message_ids(request.cr, request.uid, domain=domain + [("date", ">", post.get('date'))], order="create_date asc", limit=10)
|
||||
if ids:
|
||||
values['prev_date'] = message_obj.browse(cr, uid, ids.pop()).date
|
||||
values['prev_date'] = message_obj.browse(request.cr, request.uid, ids.pop()).date
|
||||
domain += [("date", "<=", post.get('date'))]
|
||||
|
||||
message_ids = group_obj.get_public_message_ids(cr, uid, domain=domain, order="create_date desc", limit=11)
|
||||
message_ids = group_obj.get_public_message_ids(request.cr, request.uid, domain=domain, order="create_date desc", limit=11)
|
||||
if message_ids:
|
||||
values['blog_ids'] = message_obj.browse(cr, uid, message_ids)
|
||||
values['blog_ids'] = message_obj.browse(request.cr, request.uid, message_ids)
|
||||
if len(message_ids) > 10:
|
||||
values['next_date'] = values['blog_ids'].pop().date
|
||||
|
||||
if blog_id:
|
||||
values['blog_id'] = message_obj.browse(cr, uid, blog_id)
|
||||
comment_ids = [child_id.id for child_id in values['blog_id'].child_ids]
|
||||
values['comments'] = message_obj.read(cr, uid, comment_ids, ['website_published', 'author_id', 'date', 'body'])
|
||||
values['blog_id'] = message_obj.browse(request.cr, request.uid, blog_id)
|
||||
|
||||
html = self.render(cr, uid, "website_mail.index", values)
|
||||
return html
|
||||
return website.render("website_mail.index", values)
|
||||
|
||||
@website.route(['/blog/nav'], type='http', auth="admin")
|
||||
def nav(self, cr, uid, **post):
|
||||
comment_ids = request.registry['mail.group'].get_public_message_ids(cr, uid, domain=safe_eval(post.get('domain')), order="create_date asc", limit=None)
|
||||
return simplejson.dumps(request.registry['mail.message'].read(cr, uid, comment_ids, ['website_published', 'subject', 'res_id']))
|
||||
@http.route(['/blog/nav'], type='http', auth="public")
|
||||
def nav(self, **post):
|
||||
comment_ids = request.registry['mail.group'].get_public_message_ids(request.cr, request.uid, domain=safe_eval(post.get('domain')), order="create_date asc", limit=None)
|
||||
return simplejson.dumps(request.registry['mail.message'].read(request.cr, request.uid, comment_ids, ['website_published', 'subject', 'res_id']))
|
||||
|
||||
@website.route(['/blog/publish'], type='http', auth="admin")
|
||||
def publish(self, cr, uid, **post):
|
||||
message_id = int(post['message_id'])
|
||||
@http.route(['/blog/publish'], type='http', auth="public")
|
||||
def publish(self, **post):
|
||||
message_id = int(post['id'])
|
||||
message_obj = request.registry['mail.message']
|
||||
|
||||
blog = message_obj.browse(cr, uid, message_id)
|
||||
message_obj.write(cr, uid, [message_id], {'website_published': not blog.website_published})
|
||||
blog = message_obj.browse(cr, uid, message_id)
|
||||
blog = message_obj.browse(request.cr, request.uid, message_id)
|
||||
message_obj.write(request.cr, request.uid, [message_id], {'website_published': not blog.website_published})
|
||||
blog = message_obj.browse(request.cr, request.uid, message_id)
|
||||
|
||||
return blog.website_published and "1" or "0"
|
||||
|
||||
@website.route(['/blog/<int:mail_group_id>/<int:blog_id>/post'], type='http', auth="admin")
|
||||
def blog_post(self, cr, uid, mail_group_id=None, blog_id=None, **post):
|
||||
@http.route(['/blog/<int:mail_group_id>/<int:blog_id>/post'], type='http', auth="public")
|
||||
def blog_post(self, mail_group_id=None, blog_id=None, **post):
|
||||
url = request.httprequest.host_url
|
||||
if post.get('body'):
|
||||
request.session.body = post.get('body')
|
||||
if not self.isloggued():
|
||||
if not request.uid != request.public_uid:
|
||||
return '%s/admin#action=redirect&url=%s/blog/%s/%s/post' % (url, url, mail_group_id, blog_id)
|
||||
|
||||
if 'body' in request.session and request.session.body:
|
||||
request.registry['mail.group'].message_post(cr, uid, mail_group_id,
|
||||
request.registry['mail.group'].message_post(request.cr, request.uid, mail_group_id,
|
||||
body=request.session.body,
|
||||
parent_id=blog_id,
|
||||
website_published=blog_id and True or False,
|
||||
type='comment',
|
||||
subtype='mt_comment',
|
||||
context={'mail_create_nosubscribe': True},
|
||||
context={'mail_create_nosubsrequest.cribe': True},
|
||||
)
|
||||
request.session.body = False
|
||||
|
||||
|
@ -95,14 +92,14 @@ class website_mail(website):
|
|||
else:
|
||||
return werkzeug.utils.redirect("/blog/%s/%s" % (mail_group_id, blog_id))
|
||||
|
||||
@website.route(['/blog/<int:mail_group_id>/new'], type='http', auth="admin")
|
||||
def new_blog_post(self, cr, uid, mail_group_id=None, **post):
|
||||
blog_id = request.registry['mail.group'].message_post(cr, uid, mail_group_id,
|
||||
@http.route(['/blog/<int:mail_group_id>/new'], type='http', auth="public")
|
||||
def new_blog_post(self, mail_group_id=None, **post):
|
||||
blog_id = request.registry['mail.group'].message_post(request.cr, request.uid, mail_group_id,
|
||||
body=_("Blog content.<br/>Please edit this content then you can publish this blog."),
|
||||
subject=_("Blog title"),
|
||||
website_published=False,
|
||||
type='comment',
|
||||
subtype='mt_comment',
|
||||
context={'mail_create_nosubscribe': True},
|
||||
context={'mail_create_nosubsrequest.cribe': True},
|
||||
)
|
||||
return werkzeug.utils.redirect("/blog/%s/%s" % (mail_group_id, blog_id))
|
||||
|
|
|
@ -32,12 +32,12 @@ class mail_message(osv.osv):
|
|||
class mail_group(osv.Model):
|
||||
_inherit = 'mail.group'
|
||||
|
||||
def get_public_domain(self, cr, uid, context=None):
|
||||
def get_public_blog(self, cr, uid, context=None):
|
||||
mail_group_ids = self.search(cr, uid, [('public', '=', 'public')], context=context)
|
||||
return [ ("type", "in", ['comment']),
|
||||
("parent_id", "=", False),
|
||||
("model", "=", 'mail.group'), ("res_id", "in", mail_group_ids)]
|
||||
|
||||
def get_public_message_ids(self, cr, uid, domain=[], order="create_date desc", limit=10, offset=0, context=None):
|
||||
domain += self.get_public_domain(cr, uid, context=context)
|
||||
domain += self.get_public_blog(cr, uid, context=context)
|
||||
return self.pool.get('mail.message').search(cr, uid, domain, order=order, limit=limit, offset=offset, context=context)
|
||||
|
|
|
@ -1,12 +1,3 @@
|
|||
.css_website_mail .media .label-success {
|
||||
display: none;
|
||||
}
|
||||
.css_website_mail .css_published .label-important {
|
||||
display: none;
|
||||
}
|
||||
.css_website_mail .css_published .label-success {
|
||||
display: inline-block;
|
||||
}
|
||||
.css_website_mail .has-error {
|
||||
border-color: red;
|
||||
}
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
@import "compass/css3"
|
||||
|
||||
.css_website_mail
|
||||
.media
|
||||
.label-success
|
||||
display: none
|
||||
.css_published
|
||||
.label-important
|
||||
display: none
|
||||
.label-success
|
||||
display: inline-block
|
||||
.has-error
|
||||
border-color: red
|
||||
.css_nav_month
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
$(document).ready(function () {
|
||||
$('.js_website_mail').on('click', '.js_publish', function (e) {
|
||||
$('.js_website_mail').on('click', '.js_publish, .js_unpublish', function (e) {
|
||||
e.preventDefault();
|
||||
var $media = $(this).parent();
|
||||
$media.toggleClass('css_published');
|
||||
$.post('/blog/publish/', {'message_id': $(this).data('id')}, function (result) {
|
||||
if (+result) $media.addClass('css_published');
|
||||
else $media.removeClass('css_published');
|
||||
var $link = $(this).parent();
|
||||
$link.find('.js_publish, .js_unpublish').addClass("hidden");
|
||||
var $unp = $link.find(".js_unpublish");
|
||||
var $p = $link.find(".js_publish");
|
||||
$.post('/blog/publish', {'id': $link.data('id')}, function (result) {
|
||||
if (+result) {
|
||||
$p.addClass("hidden");
|
||||
$unp.removeClass("hidden");
|
||||
} else {
|
||||
$p.removeClass("hidden");
|
||||
$unp.addClass("hidden");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -45,11 +45,11 @@
|
|||
<t t-raw="head"/>
|
||||
</t>
|
||||
<t t-set="title">Blog</t>
|
||||
<div class="container mt48 css_website_mail js_website_mail">
|
||||
<div class="container mt48 js_website_mail">
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
<ul class="nav nav-list">
|
||||
<a t-if="mail_group_id" t-att-href="'/blog/%%s/new' %% mail_group_id" class="btn" groups="group_website_mail_manager">Add a new Blog</a>
|
||||
<a t-if="mail_group_id and editable" t-att-href="'/blog/%%s/new' %% mail_group_id" class="btn">Add a new Blog</a>
|
||||
<li class="nav-header">BLOG ARCHIVE</li>
|
||||
<!-- TODO: check qweb iteration -->
|
||||
<t t-foreach="nav_list" t-as="year">
|
||||
|
@ -68,31 +68,31 @@
|
|||
</div>
|
||||
<div class="span8" t-if="blog_id">
|
||||
<div class="media">
|
||||
<div t-att-class="'media-body well %%s' %% (blog_id.website_published and 'css_published' or '')">
|
||||
<a href="#" title="Click to publish or unpublish this blog" t-att-data-id="blog_id.id" class="js_publish pull-right" groups="group_website_mail_manager">
|
||||
<span class="label label-success">Unpublish</span>
|
||||
<span class="label label-important">Publish</span>
|
||||
<div class="media-body well">
|
||||
<a href="#" t-att-data-id="blog_id.id" class="pull-right" t-if="editable">
|
||||
<span t-att-class="'label label-success js_unpublish %%s' %% (not blog_id.website_published and 'hidden' or '')">Click to Unpublish</span>
|
||||
<span t-att-class="'label label-important js_publish %%s' %% (blog_id.website_published and 'hidden' or '')">Click to Publish</span>
|
||||
</a>
|
||||
<h3 t-record="blog_id" t-field="subject"></h3>
|
||||
<div t-record="blog_id" t-field="body"></div>
|
||||
<h3 t-field="blog_id.subject"></h3>
|
||||
<div t-field="blog_id.body"></div>
|
||||
<small class="pull-right muted text-right">
|
||||
<div><t t-esc="blog_id.read(['author_id'])[0]['author_id'][1]"/></div>
|
||||
<div><t t-esc="blog_id.date"/></div>
|
||||
<div><t t-field="blog_id.author_id"/></div>
|
||||
<div><t t-field="blog_id.date"/></div>
|
||||
</small>
|
||||
</div>
|
||||
<ul class="media-list">
|
||||
<t t-foreach="comments">
|
||||
<t t-foreach="blog_id.child_ids" t-as="comment">
|
||||
<!-- TODO: check qweb iteration -->
|
||||
<li class="media">
|
||||
<div t-att-class="'media-body %%s' %% (website_published and 'css_published' or '')">
|
||||
<a href="#" title="Click to publish or unpublish this message" t-att-data-id="id" class="js_publish pull-right" groups="group_website_mail_manager">
|
||||
<span class="label label-success">Unpublish</span>
|
||||
<span class="label label-important">Publish</span>
|
||||
<div class="media-body">
|
||||
<a href="#" t-att-data-id="blog_id.id" class="pull-right" t-if="editable">
|
||||
<span t-att-class="'label label-success js_unpublish %%s' %% (not comment.website_published and 'hidden' or '')">Click to Unpublish</span>
|
||||
<span t-att-class="'label label-important js_publish %%s' %% (comment.website_published and 'hidden' or '')">Click to Publish</span>
|
||||
</a>
|
||||
<t t-raw="body"/>
|
||||
<t t-raw="comment.body"/>
|
||||
<small class="pull-right muted text-right">
|
||||
<div><t t-esc="author_id[1]"/></div>
|
||||
<div><t t-esc="date"/></div>
|
||||
<div><t t-esc="comment.author_id"/></div>
|
||||
<div><t t-esc="comment.date"/></div>
|
||||
</small>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -109,25 +109,34 @@
|
|||
<t t-foreach="blog_ids" t-as="blog">
|
||||
<li class="media well">
|
||||
<div t-att-class="'media-body %%s' %% (blog.website_published and 'css_published' or '')">
|
||||
<a href="#" title="Click to publish or unpublish this message" t-att-data-id="blog.id" class="js_publish pull-right" groups="group_website_mail_manager">
|
||||
<span class="label label-success">Unpublish</span>
|
||||
<span class="label label-important">Publish</span>
|
||||
<a href="#" t-att-data-id="blog.id" class="pull-right" t-if="editable">
|
||||
<span t-att-class="'label label-success js_unpublish %%s' %% (not blog.website_published and 'hidden' or '')">Click to Unpublish</span>
|
||||
<span t-att-class="'label label-important js_publish %%s' %% (blog.website_published and 'hidden' or '')">Click to Publish</span>
|
||||
</a>
|
||||
<h4 class="media-heading" ><a t-att-href="'/blog/%%s/%%s' %% (blog.res_id, blog.id)" t-record="blog" t-field="subject"></a></h4>
|
||||
<h4 class="media-heading" ><a t-att-href="'/blog/%%s/%%s' %% (blog.res_id, blog.id)" t-field="blog.subject"></a></h4>
|
||||
<div class="media">
|
||||
<div t-record="blog" t-field="body"></div>
|
||||
<div t-field="blog.body"></div>
|
||||
<small class="pull-left muted text-right" t-if="len(blog.child_ids)">
|
||||
<a t-if="len(blog.child_ids) <= 1" t-att-href="'/blog/%%s/%%s' %% (blog.res_id, blog.id)"><t t-esc="len(blog.child_ids)"/> Message</a>
|
||||
<a t-if="len(blog.child_ids) > 1" t-att-href="'/blog/%%s/%%s' %% (blog.res_id, blog.id)"><t t-esc="len(blog.child_ids)"/> Messages</a>
|
||||
</small>
|
||||
<small class="pull-right muted text-right">
|
||||
<a t-att-href="'/blog/%%s/%%s' %% (blog.res_id, blog.id)">Read more </a>
|
||||
<div><t t-esc="blog.read(['author_id'])[0]['author_id'][1]"/></div>
|
||||
<div><t t-esc="blog.date"/></div>
|
||||
<div><t t-field="blog.author_id"/></div>
|
||||
<div><t t-field="blog.date"/></div>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
<a t-if="prev_date" t-att-href="'?date=%%s' %% (prev_date)" class="pull-left">Newer</a>
|
||||
<a t-if="next_date" t-att-href="'?date=%%s' %% (next_date)" class="pull-right">Older</a>
|
||||
<ul class="pager">
|
||||
<li t-if="next_date" class="previous">
|
||||
<a t-att-href="'?date=%%s' %% (next_date)">&larr; Older</a>
|
||||
</li>
|
||||
<li t-if="prev_date" class="next">
|
||||
<a t-att-href="'?date=%%s' %% (prev_date)">Newer &rarr;</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
import controllers
|
||||
import pricelist
|
||||
import product
|
||||
|
|
|
@ -11,7 +11,9 @@ OpenERP E-Commerce
|
|||
'depends': ['website', 'sale', 'point_of_sale'],
|
||||
'data': [
|
||||
'views/ecommerce.xml',
|
||||
'views/pricelist.xml'
|
||||
'views/pricelist.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'security/ecommerce.xml',
|
||||
],
|
||||
'qweb': ['static/src/xml/*.xml'],
|
||||
'installable': True,
|
||||
|
|
|
@ -1,68 +1,58 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import openerp
|
||||
import simplejson
|
||||
from openerp.osv import osv
|
||||
from openerp.addons.web import http
|
||||
from openerp.addons.web.http import request
|
||||
from openerp.addons.website.controllers.main import template_values
|
||||
|
||||
def get_order(order_id=None):
|
||||
order_obj = request.registry.get('sale.order')
|
||||
# check if order allready exists
|
||||
if order_id:
|
||||
try:
|
||||
order_obj.browse(request.cr, openerp.SUPERUSER_ID, order_id).pricelist_id
|
||||
except:
|
||||
order_id = None
|
||||
if not order_id:
|
||||
fields = [k for k, v in order_obj._columns.items()]
|
||||
order_value = order_obj.default_get(request.cr, openerp.SUPERUSER_ID, fields)
|
||||
order_value['partner_id'] = openerp.SUPERUSER_ID != request.public_uid and \
|
||||
request.registry.get('res.users').browse(request.cr, openerp.SUPERUSER_ID, request.uid).partner_id.id or \
|
||||
None
|
||||
order_value.update(order_obj.onchange_partner_id(request.cr, openerp.SUPERUSER_ID, [], request.uid, context={})['value'])
|
||||
order_id = order_obj.create(request.cr, openerp.SUPERUSER_ID, order_value)
|
||||
return order_obj.browse(request.cr, openerp.SUPERUSER_ID, order_id)
|
||||
|
||||
def get_current_order():
|
||||
order = get_order(request.httprequest.session.get('ecommerce_order_id'))
|
||||
request.httprequest.session['ecommerce_order_id'] = order.id
|
||||
return order
|
||||
|
||||
def get_categories():
|
||||
category_obj = request.registry.get('pos.category')
|
||||
category_ids = category_obj.search(request.cr, openerp.SUPERUSER_ID, [('parent_id', '=', False)])
|
||||
return category_obj.browse(request.cr, openerp.SUPERUSER_ID, category_ids)
|
||||
|
||||
|
||||
class website(osv.osv):
|
||||
_inherit = "website"
|
||||
def get_rendering_context(self, additional_values=None):
|
||||
values = {
|
||||
'website_sale_get_categories': get_categories,
|
||||
'order': get_current_order(),
|
||||
# 'website_sale_get_current_order': get_current_order, # TODO: replace 'order' key in templates
|
||||
}
|
||||
if additional_values:
|
||||
values.update(additional_values)
|
||||
return super(website, self).get_rendering_context(values)
|
||||
|
||||
class Ecommerce(http.Controller):
|
||||
|
||||
def get_cr_uid(self):
|
||||
cr = request.cr
|
||||
uid = request.uid
|
||||
|
||||
if request.session._uid:
|
||||
request.httprequest.session['ecommerce_partner_id'] = False
|
||||
partner_id = request.registry.get('res.users').browse(cr, uid, request.session._uid).partner_id.id
|
||||
else:
|
||||
partner_id = request.httprequest.session.get('ecommerce_partner_id', False)
|
||||
if partner_id and not request.registry.get('res.partner').search(cr, uid, [('id', '=', partner_id)]):
|
||||
partner_id = None
|
||||
return (cr, uid, partner_id)
|
||||
|
||||
def get_categories(self):
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
category_obj = request.registry.get('pos.category')
|
||||
category_ids = category_obj.search(cr, uid, [('parent_id', '=', False)])
|
||||
return category_obj.browse(cr, uid, category_ids)
|
||||
|
||||
def get_order(self, order_id=None):
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
order_obj = request.registry.get('sale.order')
|
||||
# check if order allready exists
|
||||
if order_id:
|
||||
try:
|
||||
order_obj.browse(cr, uid, order_id).pricelist_id
|
||||
except:
|
||||
order_id = None
|
||||
if not order_id:
|
||||
fields = [k for k, v in order_obj._columns.items()]
|
||||
order_value = order_obj.default_get(cr, uid, fields)
|
||||
order_value['partner_id'] = partner_id or request.registry.get('res.users').browse(cr, uid, uid).partner_id.id
|
||||
order_value.update(order_obj.onchange_partner_id(cr, uid, [], uid, context={})['value'])
|
||||
order_id = order_obj.create(cr, uid, order_value)
|
||||
return order_obj.browse(cr, uid, order_id)
|
||||
|
||||
def get_values(self):
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
|
||||
order = self.get_order(request.httprequest.session.get('ecommerce_order'))
|
||||
request.httprequest.session['ecommerce_order'] = order.id
|
||||
|
||||
values = template_values()
|
||||
values.update({
|
||||
'temp': 0,
|
||||
'res_company': request.registry['res.company'].browse(request.cr, 1, 1),
|
||||
'order': order,
|
||||
'categories': self.get_categories(),
|
||||
})
|
||||
return values
|
||||
|
||||
def recommended_product(self, my_pids):
|
||||
if not my_pids:
|
||||
return []
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
|
||||
my_pids = str(my_pids)[1:-1]
|
||||
product_ids = []
|
||||
query = """
|
||||
|
@ -76,99 +66,93 @@ class Ecommerce(http.Controller):
|
|||
ORDER BY COUNT(sol.order_id) DESC
|
||||
LIMIT 8
|
||||
""" % (my_pids, my_pids)
|
||||
cr.execute(query)
|
||||
for p in cr.fetchall():
|
||||
request.cr.execute(query)
|
||||
for p in request.cr.fetchall():
|
||||
product_ids.append(p[0])
|
||||
return request.registry.get('product.product').browse(cr, uid, product_ids)
|
||||
return request.registry.get('product.product').browse(request.cr, request.uid, product_ids)
|
||||
|
||||
@http.route(['/shop', '/shop/category/<cat_id>'], type='http', auth="admin")
|
||||
@http.route(['/shop', '/shop/category/<cat_id>'], type='http', auth="public")
|
||||
def category(self, cat_id=0, offset=0, **post):
|
||||
values = self.get_values()
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
website = request.registry['website']
|
||||
|
||||
domain = []
|
||||
domain = [("sale_ok", "=", True)]
|
||||
if post.get("search"):
|
||||
domain += ['|', '|', ('name', 'ilike', "%%%s%%" % post.get("search")), ('description', 'ilike', "%%%s%%" % post.get("search")), ('pos_categ_id.name', 'ilike', "%%%s%%" % post.get("search"))]
|
||||
domain += ['|', '|', ('name', 'ilike', "%%%s%%" % post.get("search")), ('desrequest.cription', 'ilike', "%%%s%%" % post.get("search")), ('pos_categ_id.name', 'ilike', "%%%s%%" % post.get("search"))]
|
||||
if cat_id:
|
||||
cat_id = cat_id and int(cat_id) or 0
|
||||
domain = [('pos_categ_id.id', 'child_of', cat_id)] + domain
|
||||
|
||||
category_obj = request.registry.get('pos.category')
|
||||
product_obj = request.registry.get('product.product')
|
||||
category_ids = category_obj.search(cr, uid, [('parent_id', '=', False)])
|
||||
product_ids = product_obj.search(cr, uid, domain or [(1, '=', 1)], limit=20, offset=offset)
|
||||
product_ids = product_obj.search(request.cr, request.uid, domain, limit=20, offset=offset)
|
||||
|
||||
values.update({
|
||||
values = website.get_rendering_context({
|
||||
'current_category': cat_id,
|
||||
'categories': category_obj.browse(cr, uid, category_ids),
|
||||
'products': product_obj.browse(cr, uid, product_ids),
|
||||
'products': product_obj.browse(request.cr, request.uid, product_ids),
|
||||
'search': post.get("search"),
|
||||
})
|
||||
html = request.registry.get("ir.ui.view").render(cr, uid, "website_sale.products", values)
|
||||
return html
|
||||
return website.render("website_sale.products", values)
|
||||
|
||||
@http.route(['/shop/product/<product_id>'], type='http', auth="admin")
|
||||
@http.route(['/shop/product/<product_id>'], type='http', auth="public")
|
||||
def product(self, cat_id=0, product_id=0):
|
||||
values = self.get_values()
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
website = request.registry['website']
|
||||
order = get_current_order()
|
||||
|
||||
product_id = product_id and int(product_id) or 0
|
||||
product_obj = request.registry.get('product.product')
|
||||
|
||||
line = [line for line in values['order'].order_line if line.product_id.id == product_id]
|
||||
line = [line for line in order.order_line if line.product_id.id == product_id]
|
||||
quantity = line and int(line[0].product_uom_qty) or 0
|
||||
|
||||
values.update({
|
||||
'product': product_obj.browse(cr, uid, product_id),
|
||||
values = website.get_rendering_context({
|
||||
'product': product_obj.browse(request.cr, request.uid, product_id),
|
||||
'quantity': quantity,
|
||||
'recommended_products': self.recommended_product([product_id]),
|
||||
})
|
||||
html = request.registry.get("ir.ui.view").render(cr, uid, "website_sale.product", values)
|
||||
return html
|
||||
return website.render("website_sale.product", values)
|
||||
|
||||
@http.route(['/shop/mycart'], type='http', auth="admin")
|
||||
@http.route(['/shop/mycart'], type='http', auth="public")
|
||||
def mycart(self, **post):
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
values = self.get_values()
|
||||
website = request.registry['website']
|
||||
order = get_current_order()
|
||||
|
||||
if post.get('code'):
|
||||
pricelist_obj = request.registry.get('product.pricelist')
|
||||
order_obj = request.registry.get('sale.order')
|
||||
pricelist_ids = pricelist_obj.search(cr, uid, [('code', '=', post.get('code'))])
|
||||
pricelist_ids = pricelist_obj.search(request.cr, openerp.SUPERUSER_ID, [('code', '=', post.get('code'))])
|
||||
if pricelist_ids:
|
||||
values["order"].write({'pricelist_id': pricelist_ids[0]})
|
||||
order.write({'pricelist_id': pricelist_ids[0]})
|
||||
|
||||
my_pids = [line.product_id.id for line in values['order'].order_line]
|
||||
values["recommended_products"] = self.recommended_product(my_pids)
|
||||
my_pids = [line.product_id.id for line in order.order_line]
|
||||
values = website.get_rendering_context({
|
||||
"recommended_products": self.recommended_product(my_pids)
|
||||
})
|
||||
|
||||
html = request.registry.get("ir.ui.view").render(cr, uid, "website_sale.mycart", values)
|
||||
return html
|
||||
return website.render("website_sale.mycart", values)
|
||||
|
||||
@http.route(['/shop/add_cart'], type='http', auth="admin")
|
||||
@http.route(['/shop/add_cart'], type='http', auth="public")
|
||||
def add_cart(self, product_id=0, remove=False):
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
values = self.get_values()
|
||||
website = request.registry['website']
|
||||
values = website.get_rendering_context()
|
||||
context = {}
|
||||
|
||||
order_obj = request.registry.get('sale.order')
|
||||
order_line_obj = request.registry.get('sale.order.line')
|
||||
user_obj = request.registry.get('res.users')
|
||||
|
||||
product_id = product_id and int(product_id) or 0
|
||||
order = values['order']
|
||||
order = get_current_order()
|
||||
|
||||
quantity = 0
|
||||
|
||||
# values initialisation
|
||||
order_line_ids = order_line_obj.search(cr, uid, [('order_id', '=', order.id), ('product_id', '=', product_id)], context=context)
|
||||
values = {}
|
||||
order_line_ids = order_line_obj.search(request.cr, openerp.SUPERUSER_ID, [('order_id', '=', order.id), ('product_id', '=', product_id)], context=context)
|
||||
if order_line_ids:
|
||||
order_line = order_line_obj.read(cr, uid, order_line_ids, [], context=context)[0]
|
||||
order_line = order_line_obj.read(request.cr, openerp.SUPERUSER_ID, order_line_ids, [], context=context)[0]
|
||||
quantity = order_line['product_uom_qty'] + (remove and -1 or 1)
|
||||
if quantity <= 0:
|
||||
order_line_obj.unlink(cr, uid, order_line_ids, context=context)
|
||||
order_line_obj.unlink(request.cr, openerp.SUPERUSER_ID, order_line_ids, context=context)
|
||||
else:
|
||||
fields = [k for k, v in order_line_obj._columns.items()]
|
||||
values = order_line_obj.default_get(cr, uid, fields, context=context)
|
||||
values = order_line_obj.default_get(request.cr, openerp.SUPERUSER_ID, fields, context=context)
|
||||
quantity = 1
|
||||
values['product_uom_qty'] = quantity
|
||||
values['product_id'] = product_id
|
||||
|
@ -177,28 +161,29 @@ class Ecommerce(http.Controller):
|
|||
# change and record value
|
||||
if quantity:
|
||||
pricelist_id = order.pricelist_id and order.pricelist_id.id or False
|
||||
values.update(order_line_obj.product_id_change(cr, uid, [], pricelist_id, product_id,
|
||||
partner_id=partner_id or request.registry.get('res.users').browse(cr, uid, uid).partner_id.id,
|
||||
values.update(order_line_obj.product_id_change(request.cr, openerp.SUPERUSER_ID, [], pricelist_id, product_id,
|
||||
partner_id=user_obj.browse(request.cr, openerp.SUPERUSER_ID, request.uid).partner_id.id,
|
||||
context=context)['value'])
|
||||
if order_line_ids:
|
||||
order_line_obj.write(cr, uid, order_line_ids, values, context=context)
|
||||
order_line_obj.write(request.cr, openerp.SUPERUSER_ID, order_line_ids, values, context=context)
|
||||
else:
|
||||
order_line_id = order_line_obj.create(cr, uid, values, context=context)
|
||||
order_line_id = order_line_obj.create(request.cr, openerp.SUPERUSER_ID, values, context=context)
|
||||
order.write({'order_line': [(4, order_line_id)]}, context=context)
|
||||
|
||||
html = request.registry.get("ir.ui.view").render(cr, uid, "website_sale.total", self.get_values())
|
||||
|
||||
html = website.render("website_sale.total", values)
|
||||
return simplejson.dumps({"quantity": quantity, "totalHTML": html})
|
||||
|
||||
@http.route(['/shop/remove_cart'], type='http', auth="admin")
|
||||
@http.route(['/shop/remove_cart'], type='http', auth="public")
|
||||
def remove_cart(self, product_id=0):
|
||||
return self.add_cart(product_id=product_id, remove=True)
|
||||
|
||||
@http.route(['/shop/checkout'], type='http', auth="admin")
|
||||
@http.route(['/shop/checkout'], type='http', auth="public")
|
||||
def checkout(self, **post):
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
values = self.get_values()
|
||||
order = values['order']
|
||||
website = request.registry['website']
|
||||
values = website.get_rendering_context({
|
||||
'partner': False
|
||||
})
|
||||
order = get_current_order()
|
||||
|
||||
if order.state != 'draft':
|
||||
return self.confirmed(**post)
|
||||
|
@ -211,41 +196,37 @@ class Ecommerce(http.Controller):
|
|||
country_state_obj = request.registry.get('res.country.state')
|
||||
payment_obj = request.registry.get('portal.payment.acquirer')
|
||||
|
||||
values['partner'] = False
|
||||
|
||||
if post.get("login"):
|
||||
user_id = user_obj.login(cr, post.get("login"), post.get("password"))
|
||||
partner_id = user_obj.browse(cr, uid, user_id).partner_id.id
|
||||
|
||||
if partner_id:
|
||||
values['partner'] = partner_obj.browse(cr, uid, partner_id)
|
||||
shipping_ids = partner_obj.search(cr, uid, [("parent_id", "=", partner_id), ('type', "=", 'delivery')])
|
||||
if request.uid != request.public_uid:
|
||||
values['partner'] = user_obj.browse(request.cr, request.uid, request.uid).partner_id
|
||||
shipping_ids = partner_obj.search(request.cr, request.uid, [("parent_id", "=", values['partner'].id), ('type', "=", 'delivery')])
|
||||
values['shipping'] = None
|
||||
if shipping_ids:
|
||||
values['shipping'] = partner_obj.browse(cr, uid, shipping_ids[0])
|
||||
values['shipping'] = partner_obj.browse(request.cr, request.uid, shipping_ids[0])
|
||||
|
||||
values['countries'] = country_obj.browse(cr, uid, country_obj.search(cr, uid, [(1, "=", 1)]))
|
||||
values['states'] = country_state_obj.browse(cr, uid, country_state_obj.search(cr, uid, [(1, "=", 1)]))
|
||||
values['countries'] = country_obj.browse(request.cr, openerp.SUPERUSER_ID, country_obj.search(request.cr, openerp.SUPERUSER_ID, [(1, "=", 1)]))
|
||||
values['states'] = country_state_obj.browse(request.cr, openerp.SUPERUSER_ID, country_state_obj.search(request.cr, openerp.SUPERUSER_ID, [(1, "=", 1)]))
|
||||
|
||||
payment_ids = payment_obj.search(cr, uid, [('visible', '=', True)])
|
||||
values['payments'] = payment_obj.browse(cr, uid, payment_ids)
|
||||
payment_ids = payment_obj.search(request.cr, openerp.SUPERUSER_ID, [('visible', '=', True)])
|
||||
values['payments'] = payment_obj.browse(request.cr, openerp.SUPERUSER_ID, payment_ids)
|
||||
for payment in values['payments']:
|
||||
content = payment_obj.render(cr, uid, payment.id, order, order.name, order.pricelist_id.currency_id, order.amount_total)
|
||||
content = payment_obj.render(request.cr, openerp.SUPERUSER_ID, payment.id, order, order.name, order.pricelist_id.currency_id, order.amount_total)
|
||||
payment._content = content
|
||||
|
||||
return request.registry.get("ir.ui.view").render(cr, uid, "website_sale.checkout", values)
|
||||
return website.render("website_sale.checkout", values)
|
||||
|
||||
@http.route(['/shop/confirm_order'], type='http', auth="admin")
|
||||
@http.route(['/shop/confirm_order'], type='http', auth="public")
|
||||
def confirm_order(self, **post):
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
values = self.get_values()
|
||||
order = get_current_order()
|
||||
|
||||
json = {'error': [], 'validation': False}
|
||||
partner_obj = request.registry.get('res.partner')
|
||||
user_obj = request.registry.get('res.users')
|
||||
|
||||
if values['order'].state != 'draft':
|
||||
if order.state != 'draft':
|
||||
json['validation'] = True
|
||||
return json
|
||||
if not values['order'].order_line:
|
||||
if not order.order_line:
|
||||
json['error'].append("empty_cart")
|
||||
return json
|
||||
|
||||
|
@ -262,10 +243,10 @@ class Ecommerce(http.Controller):
|
|||
# search or create company
|
||||
company_id = None
|
||||
if post['company']:
|
||||
company_ids = partner_obj.search(cr, uid, [("name", "ilike", post['company']), ('is_company', '=', True)])
|
||||
company_ids = partner_obj.search(request.cr, openerp.SUPERUSER_ID, [("name", "ilike", post['company']), ('is_company', '=', True)])
|
||||
company_id = company_ids and company_ids[0] or None
|
||||
if not company_id:
|
||||
company_id = partner_obj.create(cr, uid, {'name': post['company'], 'is_company': True})
|
||||
company_id = partner_obj.create(request.cr, openerp.SUPERUSER_ID, {'name': post['company'], 'is_company': True})
|
||||
|
||||
partner_value = {
|
||||
'fax': post['fax'],
|
||||
|
@ -279,10 +260,11 @@ class Ecommerce(http.Controller):
|
|||
'country_id': post['country_id'],
|
||||
'state_id': post['state_id'],
|
||||
}
|
||||
if partner_id:
|
||||
partner_obj.write(cr, uid, [partner_id], partner_value)
|
||||
if request.uid != request.public_uid:
|
||||
partner_id = user_obj.browse(request.cr, request.uid, request.uid).partner_id.id
|
||||
partner_obj.write(request.cr, request.uid, [partner_id], partner_value)
|
||||
else:
|
||||
partner_id = partner_obj.create(cr, uid, partner_value)
|
||||
partner_id = partner_obj.create(request.cr, openerp.SUPERUSER_ID, partner_value)
|
||||
|
||||
shipping_id = None
|
||||
if 'shipping_name' in post:
|
||||
|
@ -300,12 +282,12 @@ class Ecommerce(http.Controller):
|
|||
}
|
||||
domain = [(key, '_id' in key and '=' or 'ilike', '_id' in key and int(value) or value)
|
||||
for key, value in shipping_value.items() if key in required_field + ["type", "parent_id"]]
|
||||
shipping_ids = partner_obj.search(cr, uid, domain)
|
||||
shipping_ids = partner_obj.search(request.cr, openerp.SUPERUSER_ID, domain)
|
||||
if shipping_ids:
|
||||
shipping_id = shipping_ids[0]
|
||||
partner_obj.write(cr, uid, [shipping_id], shipping_value)
|
||||
partner_obj.write(request.cr, openerp.SUPERUSER_ID, [shipping_id], shipping_value)
|
||||
else:
|
||||
shipping_id = partner_obj.create(cr, uid, shipping_value)
|
||||
shipping_id = partner_obj.create(request.cr, openerp.SUPERUSER_ID, shipping_value)
|
||||
|
||||
order_value = {
|
||||
'state': 'progress',
|
||||
|
@ -313,33 +295,41 @@ class Ecommerce(http.Controller):
|
|||
'partner_invoice_id': partner_id,
|
||||
'partner_shipping_id': shipping_id or partner_id
|
||||
}
|
||||
order_value.update(request.registry.get('sale.order').onchange_partner_id(cr, uid, [], uid, context={})['value'])
|
||||
values['order'].write(order_value)
|
||||
order_value.update(request.registry.get('sale.order').onchange_partner_id(request.cr, openerp.SUPERUSER_ID, [], request.uid, context={})['value'])
|
||||
order.write(order_value)
|
||||
|
||||
json['validation'] = True
|
||||
return simplejson.dumps(json)
|
||||
|
||||
@http.route(['/shop/confirmed'], type='http', auth="admin")
|
||||
@http.route(['/shop/confirmed'], type='http', auth="public")
|
||||
def confirmed(self, **post):
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
website = request.registry['website']
|
||||
|
||||
if request.httprequest.session.get('ecommerce_order'):
|
||||
order = self.get_order(request.httprequest.session.get('ecommerce_order'))
|
||||
if request.httprequest.session.get('ecommerce_order_id'):
|
||||
order = get_current_order()
|
||||
if order.state != 'draft':
|
||||
request.httprequest.session['ecommerce_order_old'] = order.id
|
||||
request.httprequest.session['ecommerce_order'] = None
|
||||
request.httprequest.session['ecommerce_order_id_old'] = order.id
|
||||
request.httprequest.session['ecommerce_order_id'] = None
|
||||
|
||||
order_old = self.get_order(request.httprequest.session.get('ecommerce_order_old'))
|
||||
order_old = get_order(request.httprequest.session.get('ecommerce_order_id_old'))
|
||||
if not order_old.order_line:
|
||||
return self.mycart(**post)
|
||||
|
||||
values = template_values()
|
||||
values.update({
|
||||
values = website.get_rendering_context({
|
||||
'temp': 0,
|
||||
'res_company': request.registry['res.company'].browse(request.cr, 1, 1),
|
||||
'order': order_old,
|
||||
'categories': self.get_categories(),
|
||||
})
|
||||
return request.registry.get("ir.ui.view").render(cr, uid, "website_sale.confirmed", values)
|
||||
return website.render("website_sale.confirmed", values)
|
||||
|
||||
@http.route(['/shop/publish'], type='http', auth="public")
|
||||
def publish(self, **post):
|
||||
product_id = int(post['id'])
|
||||
product_obj = request.registry['product.product']
|
||||
|
||||
product = product_obj.browse(request.cr, request.uid, product_id)
|
||||
product_obj.write(request.cr, request.uid, [product_id], {'website_published': not product.website_published})
|
||||
product = product_obj.browse(request.cr, request.uid, product_id)
|
||||
|
||||
return product.website_published and "1" or "0"
|
||||
|
||||
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from openerp.osv import osv, fields
|
||||
|
||||
|
||||
class product_pricelist(osv.osv):
|
||||
_inherit = "product.product"
|
||||
_columns = {
|
||||
'website_published': fields.boolean('Available in the website'),
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="product_product_public" model="ir.rule">
|
||||
<field name="name">product: Public product</field>
|
||||
<field name="model_id" ref="product.model_product_product"/>
|
||||
<field name="domain_force">[('website_published', '=', True), ("sale_ok", "=", True)]</field>
|
||||
<field name="groups" eval="[(4, ref('base.group_public'))]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
<field name="perm_unlink" eval="False"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,3 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_product_product_public,product.product.public,product.model_product_product,base.group_public,1,0,0,0
|
||||
access_point_of_sale_category_public,point_of_sale.category.public,point_of_sale.model_pos_category,base.group_public,1,0,0,0
|
|
|
@ -1,4 +1,21 @@
|
|||
$(document).ready(function () {
|
||||
$('.oe_ecommerce').on('click', '.js_publish, .js_unpublish', function (e) {
|
||||
e.preventDefault();
|
||||
var $link = $(this).parent();
|
||||
$link.find('.js_publish, .js_unpublish').addClass("hidden");
|
||||
var $unp = $link.find(".js_unpublish");
|
||||
var $p = $link.find(".js_publish");
|
||||
$.post('/shop/publish', {'id': $link.data('id')}, function (result) {
|
||||
if (+result) {
|
||||
$p.addClass("hidden");
|
||||
$unp.removeClass("hidden");
|
||||
} else {
|
||||
$p.removeClass("hidden");
|
||||
$unp.addClass("hidden");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.oe_ecommerce').on('click', '.oe_product .btn, .oe_product_detail .btn', function (e) {
|
||||
var $button = $(e.currentTarget);
|
||||
var $product = $button.parents('.oe_product:first, .oe_product_detail:first');
|
||||
|
|
|
@ -16,6 +16,31 @@
|
|||
</data>
|
||||
</field>
|
||||
</record>
|
||||
<record id="header_ecommerce" model="ir.ui.view">
|
||||
<field name="name">header_ecommerce</field>
|
||||
<field name="inherit_id" ref="website.header"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="(//li)[last()]" position="after">
|
||||
<li class="pull-right"><a href="/shop/mycart"><i class="icon-shopping-cart icon-large" style="position: absolute;"></i>&nbsp; &nbsp; &nbsp; My cart</a></li>
|
||||
<li class="pull-right"><a href="/shop">Shop</a></li>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_normal_form_view" model="ir.ui.view">
|
||||
<field name="name">product.normal.form.inherit</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="stock.view_normal_procurement_locations_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="sale" position="before">
|
||||
<group name="pos" string="Website">
|
||||
<field name="website_published"/>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Page Shop -->
|
||||
|
||||
|
@ -31,7 +56,7 @@
|
|||
<div class="row">
|
||||
<div class="span4 css_noprint">
|
||||
<ul class="nav nav-list">
|
||||
<t t-foreach="categories" t-as="category">
|
||||
<t t-foreach="website_sale_get_categories()" t-as="category">
|
||||
<t t-call="website_sale.categories_recursive"/>
|
||||
</t>
|
||||
</ul>
|
||||
|
@ -49,7 +74,7 @@
|
|||
|
||||
<template id="categories_recursive">
|
||||
<li t-att-class="category.id == current_category and 'active' or ''">
|
||||
<a t-att-href="'/shop/category/%%s' %% category.id"><span t-record="category" t-field="name"><t t-esc="category.name"/></span></a>
|
||||
<a t-att-href="'/shop/category/%%s' %% category.id"><span t-field="category.name"><t t-esc="category.name"/></span></a>
|
||||
<ul t-if="category.child_id" class="nav nav-list">
|
||||
<t t-foreach="category.child_id" t-as="category">
|
||||
<t t-call="website_sale.categories_recursive"/>
|
||||
|
@ -82,16 +107,19 @@
|
|||
|
||||
<template id="product_card">
|
||||
<div class="media oe_product span3">
|
||||
<a t-att-href="'/shop/product/%%s' %% product.id"><h4 class="media-heading"><span t-record="product" t-field="name"><t t-esc="product.name"/></span></h4></a>
|
||||
<a t-att-href="'/shop/product/%%s' %% product.id"><h4 class="media-heading"><span t-field="product.name"><t t-esc="product.name"/></span></h4></a>
|
||||
<a class="pull-left" t-att-href="'/shop/product/%%s' %% product.id"><img class="media-object" t-att-src="'data:image/png;base64,' + product.image"/></a>
|
||||
<div class="media-body">
|
||||
<div class="oe_ecommerce_description" t-record="product" t-field="description_sale"><t t-esc="product.description_sale"/></div>
|
||||
<div class="oe_ecommerce_price"><span><span t-record="product" t-field="list_price"><t t-esc="product.list_price"/></span>€</span></div>
|
||||
<div class="oe_ecommerce_description" t-field="product.description_sale"><t t-esc="product.description_sale"/></div>
|
||||
<div class="oe_ecommerce_price"><span><span t-field="product.list_price"><t t-esc="product.list_price"/></span>€</span></div>
|
||||
<div class="oe_button_cart">
|
||||
<button t-att-class="'btn btn-small btn-inverse %%s' %% (not quantity and 'oe_hidden' or '')" t-att-data-id="product.id">Remove one</button>
|
||||
<button t-att-class="'btn btn-small %%s' %% (quantity and 'btn-success' or 'btn-primary')" t-att-data-id="product.id">Add to cart
|
||||
<span class="oe_txt">(<span class="oe_quantity"><t t-esc="quantity"/></span>)</span>
|
||||
</button>
|
||||
<div class="alert mb0" t-if="editable and not product.website_published">Product not published</div>
|
||||
<t t-if="product.website_published">
|
||||
<button t-att-class="'btn btn-small btn-inverse %%s' %% (not quantity and 'oe_hidden' or '')" t-att-data-id="product.id">Remove one</button>
|
||||
<button t-att-class="'btn btn-small %%s' %% (quantity and 'btn-success' or 'btn-primary')" t-att-data-id="product.id">Add to cart
|
||||
<span class="oe_txt">(<span class="oe_quantity"><t t-esc="quantity"/></span>)</span>
|
||||
</button>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -113,7 +141,11 @@
|
|||
<t t-set="title">Product</t>
|
||||
<t t-set="shop_content">
|
||||
<div class="oe_product_detail">
|
||||
<h1><span t-record="product" t-field="name"><t t-esc="product.name"/></span></h1>
|
||||
<a href="#" t-att-data-id="product.id" class="pull-right" t-if="editable">
|
||||
<span t-att-class="'label label-success js_unpublish %%s' %% (not product.website_published and 'hidden' or '')">Click to Unpublish</span>
|
||||
<span t-att-class="'label label-important js_publish %%s' %% (product.website_published and 'hidden' or '')">Click to Publish</span>
|
||||
</a>
|
||||
<h1 t-field="product.name"></h1>
|
||||
<div class="oe_button_cart">
|
||||
<button t-att-class="'btn btn-inverse %%s' %% (not quantity and 'oe_hidden' or '')" t-att-data-id="product.id">Remove one</button>
|
||||
<button t-att-class="'btn %%s' %% (quantity and 'btn-success' or 'btn-primary')" t-att-data-id="product.id">Add to cart
|
||||
|
@ -121,8 +153,8 @@
|
|||
</button>
|
||||
</div>
|
||||
<img class="media-object" t-att-src="'data:image/png;base64,' + product.image"/>
|
||||
<div t-record="product" t-field="description_sale"><t t-esc="product.description_sale"/></div>
|
||||
<div class="oe_ecommerce_price" t-record="product" t-field="list_price"><t t-esc="product.list_price"/> €</div>
|
||||
<div t-field="product.description_sale"></div>
|
||||
<div class="oe_ecommerce_price" t-field="product.list_price"><t t-esc="product.list_price"/> €</div>
|
||||
<t t-call="website_sale.product_recommended"/>
|
||||
</div>
|
||||
</t>
|
||||
|
|
Loading…
Reference in New Issue