Merge remote-tracking branch 'odoo/master' into master-autocompletion-ged
This commit is contained in:
commit
18da121ae2
|
@ -57,7 +57,7 @@ class base_gengo_translations(osv.osv_memory):
|
|||
def init(self, cr):
|
||||
icp = self.pool['ir.config_parameter']
|
||||
if not icp.get_param(cr, SUPERUSER_ID, self.GENGO_KEY, default=None):
|
||||
icp.set_param(cr, SUPERUSER_ID, self.GENGO_KEY, str(uuid.uuid4()))
|
||||
icp.set_param(cr, SUPERUSER_ID, self.GENGO_KEY, str(uuid.uuid4()), groups=['base.group_website_designer', 'base.group_website_publisher'])
|
||||
|
||||
def get_gengo_key(self, cr):
|
||||
icp = self.pool['ir.config_parameter']
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<p>Thanks,</p>
|
||||
|
||||
<pre>
|
||||
${ctx['partner_id'].user_id and ctx['partner_id'].user_id.signature or ''}
|
||||
${ctx['partner_id'].user_id and ctx['partner_id'].user_id.signature | safe or ''}
|
||||
</pre>
|
||||
% if not ctx['partner_id'].user_id:
|
||||
PS: It looks like you do not have an account manager assigned to you, please contact us.
|
||||
|
|
|
@ -174,7 +174,7 @@ class event_event(osv.osv):
|
|||
return [(x, x) for x in pytz.all_timezones]
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Event Name', size=64, required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}),
|
||||
'name': fields.char('Event Name', required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}),
|
||||
'user_id': fields.many2one('res.users', 'Responsible User', readonly=False, states={'done': [('readonly', True)]}),
|
||||
'type': fields.many2one('event.type', 'Type of Event', readonly=False, states={'done': [('readonly', True)]}),
|
||||
'seats_max': fields.integer('Maximum Avalaible Seats', oldname='register_max', help="You can for each event define a maximum registration level. If you have too much registrations you are not able to confirm your event. (put 0 to ignore this rule )", readonly=True, states={'draft': [('readonly', False)]}),
|
||||
|
|
|
@ -174,10 +174,10 @@ class google_service(osv.osv_memory):
|
|||
return self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='http://www.openerp.com?NoBaseUrl', context=context)
|
||||
|
||||
def get_client_id(self, cr, uid, service, context=None):
|
||||
return self.pool.get('ir.config_parameter').get_param(cr, uid, 'google_%s_client_id' % (service,), default=False, context=context)
|
||||
return self.pool.get('ir.config_parameter').get_param(cr, SUPERUSER_ID, 'google_%s_client_id' % (service,), default=False, context=context)
|
||||
|
||||
def get_client_secret(self, cr, uid, service, context=None):
|
||||
return self.pool.get('ir.config_parameter').get_param(cr, uid, 'google_%s_client_secret' % (service,), default=False, context=context)
|
||||
return self.pool.get('ir.config_parameter').get_param(cr, SUPERUSER_ID, 'google_%s_client_secret' % (service,), default=False, context=context)
|
||||
|
||||
def get_uri_oauth(self, a=''): # a = optional action
|
||||
return "https://accounts.google.com/o/oauth2/%s" % (a,)
|
||||
|
|
|
@ -13,8 +13,8 @@ class calendar_config_settings(osv.TransientModel):
|
|||
def set_calset(self,cr,uid,ids,context=None) :
|
||||
params = self.pool['ir.config_parameter']
|
||||
myself = self.browse(cr,uid,ids[0],context=context)
|
||||
params.set_param(cr, uid, 'google_calendar_client_id', myself.cal_client_id or '', context=None)
|
||||
params.set_param(cr, uid, 'google_calendar_client_secret', myself.cal_client_secret or '', context=None)
|
||||
params.set_param(cr, uid, 'google_calendar_client_id', myself.cal_client_id or '', groups=['base.group_system'], context=None)
|
||||
params.set_param(cr, uid, 'google_calendar_client_secret', myself.cal_client_secret or '', groups=['base.group_system'], context=None)
|
||||
|
||||
|
||||
def get_default_all(self,cr,uid,ids,context=None):
|
||||
|
|
|
@ -240,7 +240,7 @@ class base_config_settings(osv.TransientModel):
|
|||
}
|
||||
_defaults = {
|
||||
'google_drive_uri': lambda s, cr, uid, c: s.pool['google.service']._get_google_token_uri(cr, uid, 'drive', scope=s.pool['google.drive.config'].get_google_scope(), context=c),
|
||||
'google_drive_authorization_code': lambda s, cr, uid, c: s.pool['ir.config_parameter'].get_param(cr, uid, 'google_drive_authorization_code', context=c),
|
||||
'google_drive_authorization_code': lambda s, cr, uid, c: s.pool['ir.config_parameter'].get_param(cr, SUPERUSER_ID, 'google_drive_authorization_code', context=c),
|
||||
}
|
||||
|
||||
def set_google_authorization_code(self, cr, uid, ids, context=None):
|
||||
|
@ -249,5 +249,5 @@ class base_config_settings(osv.TransientModel):
|
|||
auth_code = config.google_drive_authorization_code
|
||||
if auth_code and auth_code != ir_config_param.get_param(cr, uid, 'google_drive_authorization_code', context=context):
|
||||
refresh_token = self.pool['google.service'].generate_refresh_token(cr, uid, 'drive', config.google_drive_authorization_code, context=context)
|
||||
ir_config_param.set_param(cr, uid, 'google_drive_authorization_code', auth_code)
|
||||
ir_config_param.set_param(cr, uid, 'google_drive_refresh_token', refresh_token)
|
||||
ir_config_param.set_param(cr, uid, 'google_drive_authorization_code', auth_code, groups=['base.group_system'])
|
||||
ir_config_param.set_param(cr, uid, 'google_drive_refresh_token', refresh_token, groups=['base.group_system'])
|
||||
|
|
|
@ -5,11 +5,13 @@
|
|||
<record id="config_google_drive_client_id" model="ir.config_parameter">
|
||||
<field name="key">google_drive_client_id</field>
|
||||
<field name="value">598905559630.apps.googleusercontent.com</field>
|
||||
<field name="group_ids" eval="[(4, ref('base.group_user'))]" />
|
||||
</record>
|
||||
|
||||
<record id="config_google_drive_client_secret" model="ir.config_parameter">
|
||||
<field name="key">google_drive_client_secret</field>
|
||||
<field name="value">vTmou73c-njP-1qCxm7qx7QE</field>
|
||||
<field name="group_ids" eval="[(4, ref('base.group_system'))]" />
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
.oe_systray #oe_attendance_sign_in_out_icon {
|
||||
font-color: white;
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
|
||||
.openerp .oe_attendance_status {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
display: inline-block;
|
||||
}
|
||||
.openerp .oe_attendance_signin {
|
||||
float: right;
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
background: url(/hr_attendance/static/src/img/emp-out32.png);
|
||||
cursor: pointer;
|
||||
}
|
||||
.openerp .oe_attendance_signin:hover {
|
||||
background: url(/hr_attendance/static/src/img/emp-out-disable32.png);
|
||||
}
|
||||
.openerp .oe_attendance_status.oe_attendance_signed .oe_attendance_signin {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.openerp .oe_attendance_signout {
|
||||
float:right;
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
background: url(/hr_attendance/static/src/img/emp-in32.png);
|
||||
cursor: pointer;
|
||||
}
|
||||
.openerp .oe_attendance_signout:hover {
|
||||
background: url(/hr_attendance/static/src/img/emp-in-disable32.png);
|
||||
}
|
||||
.openerp .oe_attendance_status.oe_attendance_nosigned .oe_attendance_signout {
|
||||
display: none;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.0 KiB |
|
@ -14,15 +14,14 @@ openerp.hr_attendance = function (instance) {
|
|||
start: function() {
|
||||
var self = this;
|
||||
var tmp = function() {
|
||||
this.$el.toggleClass("oe_attendance_nosigned", ! this.get("signed_in"));
|
||||
this.$el.toggleClass("oe_attendance_signed", this.get("signed_in"));
|
||||
var $sign_in_out_icon = this.$('#oe_attendance_sign_in_out_icon');
|
||||
$sign_in_out_icon.toggleClass("fa-sign-in", ! this.get("signed_in"));
|
||||
$sign_in_out_icon.toggleClass("fa-sign-out", this.get("signed_in"));
|
||||
};
|
||||
this.on("change:signed_in", this, tmp);
|
||||
_.bind(tmp, this)();
|
||||
this.$(".oe_attendance_signin").click(function() {
|
||||
self.do_update_attendance();
|
||||
});
|
||||
this.$(".oe_attendance_signout").click(function() {
|
||||
this.$(".oe_attendance_sign_in_out").click(function(ev) {
|
||||
ev.preventDefault();
|
||||
self.do_update_attendance();
|
||||
});
|
||||
this.$el.tooltip({
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
<template>
|
||||
<t t-name="AttendanceSlider">
|
||||
<div class="oe_attendance_status oe_attendance_nosigned" data-toggle="tooltip">
|
||||
<div class="oe_attendance_signin"></div>
|
||||
<div class="oe_attendance_signout"></div>
|
||||
</div>
|
||||
<li class="oe_attendance_status" data-toggle="tooltip">
|
||||
<a href="#" class="oe_attendance_sign_in_out">
|
||||
<i id="oe_attendance_sign_in_out_icon" class="fa fa-sign-in"/>
|
||||
</a>
|
||||
</li>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<data>
|
||||
<template id="assets_backend" name="hr_attendance assets" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<link rel="stylesheet" href="/hr_attendance/static/src/css/slider.css"/>
|
||||
<script type="text/javascript" src="/hr_attendance/static/src/js/attendance.js"></script>
|
||||
<link rel="stylesheet" href="/hr_attendance/static/src/css/attendance.css"/>
|
||||
</xpath>
|
||||
</template>
|
||||
</data>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<p>If you want more details, feel free to contact us by phone.</p>
|
||||
<p>Kind regards,</p>
|
||||
<br/>
|
||||
${object.user_id and object.user_id.signature or ''}]]></field>
|
||||
${object.user_id and object.user_id.signature | safe or ''}]]></field>
|
||||
</record>
|
||||
|
||||
<record id="applicant_interest" model="email.template">
|
||||
|
@ -51,7 +51,7 @@
|
|||
If I do not answer, please let me a message with some schedules to call you back.</p>
|
||||
<p>Kind regards,</p>
|
||||
<br/>
|
||||
${object.user_id.signature}]]></field>
|
||||
${object.user_id.signature | safe}]]></field>
|
||||
</record>
|
||||
|
||||
<!-- HR Recruitment Source -->
|
||||
|
|
|
@ -11,11 +11,9 @@
|
|||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
/* button */
|
||||
|
||||
.openerp .oe_topbar_imbutton {
|
||||
cursor: pointer;
|
||||
.oe_systray #oe_topbar_im_icon {
|
||||
color: white;
|
||||
}
|
||||
.openerp .oe_topbar_item.oe_topbar_imbutton .oe_e {
|
||||
position: relative;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
im.appendTo(instance.client.$el);
|
||||
var button = new instance.im.ImTopButton(this);
|
||||
button.on("clicked", im, im.switch_display);
|
||||
button.appendTo(instance.webclient.$el.find('.oe_systray'));
|
||||
button.appendTo(window.$('.oe_systray'));
|
||||
});
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
|
@ -36,7 +36,8 @@
|
|||
events: {
|
||||
"click": "clicked",
|
||||
},
|
||||
clicked: function() {
|
||||
clicked: function(ev) {
|
||||
ev.preventDefault();
|
||||
this.trigger("clicked");
|
||||
},
|
||||
});
|
||||
|
@ -80,7 +81,7 @@
|
|||
});
|
||||
},
|
||||
calc_box: function() {
|
||||
var $topbar = instance.client.$(".navbar"); // .oe_topbar is replaced with .navbar of bootstrap3
|
||||
var $topbar = window.$('#oe_main_menu_navbar'); // .oe_topbar is replaced with .navbar of bootstrap3
|
||||
var top = $topbar.offset().top + $topbar.height();
|
||||
top = Math.max(top - $(window).scrollTop(), 0);
|
||||
this.$el.css("top", top);
|
||||
|
|
|
@ -14,9 +14,11 @@
|
|||
</div>
|
||||
</t>
|
||||
<t t-name="ImTopButton">
|
||||
<div t-att-title='_t("Display Instant Messaging")' class="oe_topbar_item oe_topbar_imbutton">
|
||||
<span class="oe_e">+</span>
|
||||
</div>
|
||||
<li t-att-title='_t("Display Instant Messaging")'>
|
||||
<a href="#">
|
||||
<i id="oe_topbar_imbutton_icon" class="fa fa-comments-o"/>
|
||||
</a>
|
||||
</li>
|
||||
</t>
|
||||
<t t-name="UserWidget">
|
||||
<div class="oe_im_user">
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
# l10n_pl module improved for Poland
|
||||
# by Grzegorz Grzelak grzegorz.grzelak@openglobe.pl
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -23,25 +23,31 @@
|
|||
{
|
||||
'name' : 'Poland - Accounting',
|
||||
'version' : '1.0',
|
||||
'author' : 'Grzegorz Grzelak (Cirrus)',
|
||||
'website': 'http://www.cirrus.pl',
|
||||
'author' : 'Grzegorz Grzelak (OpenGLOBE)',
|
||||
'website': 'http://www.openglobe.pl',
|
||||
'category' : 'Localization/Account Charts',
|
||||
'description': """
|
||||
This is the module to manage the accounting chart and taxes for Poland in OpenERP.
|
||||
==================================================================================
|
||||
|
||||
To jest moduł do tworzenia wzorcowego planu kont i podstawowych ustawień do podatków
|
||||
VAT 0%, 7% i 22%. Moduł ustawia też konta do kupna i sprzedaży towarów zakładając,
|
||||
że wszystkie towary są w obrocie hurtowym.
|
||||
To jest moduł do tworzenia wzorcowego planu kont, podatków, obszarów podatkowych i
|
||||
rejestrów podatkowych. Moduł ustawia też konta do kupna i sprzedaży towarów
|
||||
zakładając, że wszystkie towary są w obrocie hurtowym.
|
||||
|
||||
Niniejszy moduł jest przeznaczony dla odoo 8.0.
|
||||
Wewnętrzny numer wersji OpenGLOBE 1.01
|
||||
""",
|
||||
'depends' : ['account', 'base_iban', 'base_vat', 'account_chart'],
|
||||
'demo' : [],
|
||||
'data' : ['account_tax_code.xml','account_chart.xml',
|
||||
'account_tax.xml','l10n_chart_pl_wizard.xml'
|
||||
'data' : ['account_tax_code.xml',
|
||||
'account_chart.xml',
|
||||
'account_tax.xml',
|
||||
'fiscal_position.xml',
|
||||
'country_pl.xml',
|
||||
'l10n_chart_pl_wizard.xml'
|
||||
],
|
||||
'auto_install': False,
|
||||
'installable': True,
|
||||
'images': ['images/config_chart_l10n_pl.jpeg','images/l10n_pl_chart.jpeg'],
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,126 +1,588 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record id="tax_vat_23_due" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT-23%(23.0%)</field>
|
||||
<field name="amount">0.230000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="chart222030100"/>
|
||||
<field name="account_paid_id" ref="chart222030100"/>
|
||||
<field name="base_code_id" ref="vat_code_base_due"/>
|
||||
<field name="tax_code_id" ref="vat_code_due_tva"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_base_due"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_due_tva"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="tax_vat_8_due" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT-8%(8.0%)</field>
|
||||
<field name="amount">0.080000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="chart222030200"/>
|
||||
<field name="account_paid_id" ref="chart222030200"/>
|
||||
<field name="base_code_id" ref="vat_code_base_due"/>
|
||||
<field name="tax_code_id" ref="vat_code_due_tva"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_base_due"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_due_tva"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="tax_vat_5_due" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT-5%(5.0%)</field>
|
||||
<field name="amount">0.050000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="chart222030400"/>
|
||||
<field name="account_paid_id" ref="chart222030400"/>
|
||||
<field name="base_code_id" ref="vat_code_base_due"/>
|
||||
<field name="tax_code_id" ref="vat_code_due_tva"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_base_due"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_due_tva"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="tax_vat_0_due" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT-0%(0.0%)</field>
|
||||
<field name="amount">0.000000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="chart222030300"/>
|
||||
<field name="account_paid_id" ref="chart222030300"/>
|
||||
<field name="base_code_id" ref="vat_code_base_due"/>
|
||||
<field name="tax_code_id" ref="vat_code_due_tva"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_base_due"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_due_tva"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
<record id="tax_vat_23_recivable" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT naliczony-23%(23.0%)</field>
|
||||
<field name="amount">0.230000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="chart222020100"/>
|
||||
<field name="account_paid_id" ref="chart222020100"/>
|
||||
<field name="base_code_id" ref="vat_code_receivable_net"/>
|
||||
<field name="tax_code_id" ref="vat_code_payable"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_receivable_net"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="tax_vat_8_recivable" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT naliczony-8%(8.0%)</field>
|
||||
<field name="amount">0.080000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="chart222020200"/>
|
||||
<field name="account_paid_id" ref="chart222020200"/>
|
||||
<field name="base_code_id" ref="vat_code_receivable_net"/>
|
||||
<field name="tax_code_id" ref="vat_code_payable"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_receivable_net"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="tax_vat_5_recivable" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT naliczony-5%(5.0%)</field>
|
||||
<field name="amount">0.050000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="chart222020400"/>
|
||||
<field name="account_paid_id" ref="chart222020200"/>
|
||||
<field name="base_code_id" ref="vat_code_receivable_net"/>
|
||||
<field name="tax_code_id" ref="vat_code_payable"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_receivable_net"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="tax_vat_0_recivable" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT naliczony-0%(0.0%)</field>
|
||||
<field name="amount">0.000000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="chart222020300"/>
|
||||
<field name="account_paid_id" ref="chart222020300"/>
|
||||
<field name="base_code_id" ref="vat_code_receivable_net"/>
|
||||
<field name="tax_code_id" ref="vat_code_payable"/>
|
||||
<field name="ref_base_code_id" ref="vat_code_receivable_net"/>
|
||||
<field name="ref_tax_code_id" ref="vat_code_payable"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
# VAT kraj należny (sprzedaż)
|
||||
|
||||
<record id="vs_kraj_23" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT-23%</field>
|
||||
<field name="description">V23</field>
|
||||
<field name="amount">0.230000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="sequence" eval="0"/>
|
||||
<field name="account_collected_id" ref="chart22030400"/>
|
||||
<field name="account_paid_id" ref="chart22030400"/>
|
||||
<field name="base_code_id" ref="p_dost_kraj_22"/>
|
||||
<field name="tax_code_id" ref="v_dost_kraj_22"/>
|
||||
<field name="ref_base_code_id" ref="p_dost_kraj_22"/>
|
||||
<field name="ref_tax_code_id" ref="v_dost_kraj_22"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="vs_kraj_22" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT-22%</field>
|
||||
<field name="description">V22</field>
|
||||
<field name="amount">0.220000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="chart22030100"/>
|
||||
<field name="account_paid_id" ref="chart22030100"/>
|
||||
<field name="base_code_id" ref="p_dost_kraj_22"/>
|
||||
<field name="tax_code_id" ref="v_dost_kraj_22"/>
|
||||
<field name="ref_base_code_id" ref="p_dost_kraj_22"/>
|
||||
<field name="ref_tax_code_id" ref="v_dost_kraj_22"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="vs_kraj_8" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT-8%</field>
|
||||
<field name="description">V8</field>
|
||||
<field name="amount">0.080000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="chart22030500"/>
|
||||
<field name="account_paid_id" ref="chart22030500"/>
|
||||
<field name="base_code_id" ref="p_dost_kraj_7"/>
|
||||
<field name="tax_code_id" ref="v_dost_kraj_7"/>
|
||||
<field name="ref_base_code_id" ref="p_dost_kraj_7"/>
|
||||
<field name="ref_tax_code_id" ref="v_dost_kraj_7"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="vs_kraj_7" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT-7%</field>
|
||||
<field name="description">V7</field>
|
||||
<field name="amount">0.070000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="chart22030200"/>
|
||||
<field name="account_paid_id" ref="chart22030200"/>
|
||||
<field name="base_code_id" ref="p_dost_kraj_7"/>
|
||||
<field name="tax_code_id" ref="v_dost_kraj_7"/>
|
||||
<field name="ref_base_code_id" ref="p_dost_kraj_7"/>
|
||||
<field name="ref_tax_code_id" ref="v_dost_kraj_7"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="vs_kraj_5" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT-5%</field>
|
||||
<field name="description">V5</field>
|
||||
<field name="amount">0.050000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="chart22030600"/>
|
||||
<field name="account_paid_id" ref="chart22030600"/>
|
||||
<field name="base_code_id" ref="p_dost_kraj_3"/>
|
||||
<field name="tax_code_id" ref="v_dost_kraj_3"/>
|
||||
<field name="ref_base_code_id" ref="p_dost_kraj_3"/>
|
||||
<field name="ref_tax_code_id" ref="v_dost_kraj_3"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="vs_kraj_3" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT-3%</field>
|
||||
<field name="description">V3</field>
|
||||
<field name="amount">0.030000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="chart22030300"/>
|
||||
<field name="account_paid_id" ref="chart22030300"/>
|
||||
<field name="base_code_id" ref="p_dost_kraj_3"/>
|
||||
<field name="tax_code_id" ref="v_dost_kraj_3"/>
|
||||
<field name="ref_base_code_id" ref="p_dost_kraj_3"/>
|
||||
<field name="ref_tax_code_id" ref="v_dost_kraj_3"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
<record id="vs_kraj_0" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT-0%</field>
|
||||
<field name="description">V0</field>
|
||||
<field name="amount">0.000000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="base_code_id" ref="p_dost_kraj_0"/>
|
||||
<field name="ref_base_code_id" ref="p_dost_kraj_0"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="vs_kraj_zw" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT-ZW</field>
|
||||
<field name="description">VZW</field>
|
||||
<field name="amount">0.000000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="base_code_id" ref="p_dost_kraj_zw"/>
|
||||
<field name="ref_base_code_id" ref="p_dost_kraj_zw"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
<record id="vs_kraj_usl_23" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT usł-23%</field>
|
||||
<field name="description">VU23</field>
|
||||
<field name="amount">0.230000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="chart22030400"/>
|
||||
<field name="account_paid_id" ref="chart22030400"/>
|
||||
<field name="base_code_id" ref="p_dost_kraj_22"/>
|
||||
<field name="tax_code_id" ref="v_dost_kraj_22"/>
|
||||
<field name="ref_base_code_id" ref="p_dost_kraj_22"/>
|
||||
<field name="ref_tax_code_id" ref="v_dost_kraj_22"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="vs_kraj_usl_22" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT usł-22%</field>
|
||||
<field name="description">VU22</field>
|
||||
<field name="amount">0.220000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_collected_id" ref="chart22030100"/>
|
||||
<field name="account_paid_id" ref="chart22030100"/>
|
||||
<field name="base_code_id" ref="p_dost_kraj_22"/>
|
||||
<field name="tax_code_id" ref="v_dost_kraj_22"/>
|
||||
<field name="ref_base_code_id" ref="p_dost_kraj_22"/>
|
||||
<field name="ref_tax_code_id" ref="v_dost_kraj_22"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
|
||||
# VAT kraj naliczony
|
||||
|
||||
<record id="vz_kraj_23" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT naliczony-23%</field>
|
||||
<field name="description">Z23</field>
|
||||
<field name="amount">0.230000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="sequence" eval="0"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="chart22020400"/>
|
||||
<field name="account_paid_id" ref="chart22020400"/>
|
||||
<field name="base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="ref_tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="vz_kraj_22" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT naliczony-22%</field>
|
||||
<field name="description">Z22</field>
|
||||
<field name="amount">0.220000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="chart22020100"/>
|
||||
<field name="account_paid_id" ref="chart22020100"/>
|
||||
<field name="base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="ref_tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="vz_kraj_8" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT naliczony-8%</field>
|
||||
<field name="description">Z8</field>
|
||||
<field name="amount">0.080000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="chart22020500"/>
|
||||
<field name="account_paid_id" ref="chart22020500"/>
|
||||
<field name="base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="ref_tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="vz_kraj_7" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT naliczony-7%</field>
|
||||
<field name="description">Z7</field>
|
||||
<field name="amount">0.070000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="chart22020200"/>
|
||||
<field name="account_paid_id" ref="chart22020200"/>
|
||||
<field name="base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="ref_tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="vz_kraj_5" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT naliczony-5%</field>
|
||||
<field name="description">Z5</field>
|
||||
<field name="amount">0.050000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="chart22020600"/>
|
||||
<field name="account_paid_id" ref="chart22020600"/>
|
||||
<field name="base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="ref_tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="vz_kraj_3" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT naliczony-3%</field>
|
||||
<field name="description">Z3</field>
|
||||
<field name="amount">0.030000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="chart22020300"/>
|
||||
<field name="account_paid_id" ref="chart22020300"/>
|
||||
<field name="base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="ref_tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
<record id="vz_kraj_0" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT naliczony-0%</field>
|
||||
<field name="description">Z0</field>
|
||||
<field name="amount">0.000000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="ref_tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="vz_kraj_zw" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT naliczony-ZW</field>
|
||||
<field name="description">ZZW</field>
|
||||
<field name="amount">0.000000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="ref_tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
<record id="vz_kraj_usl_23" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT usł nalicz-23%</field>
|
||||
<field name="description">ZU23</field>
|
||||
<field name="amount">0.230000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="chart22020400"/>
|
||||
<field name="account_paid_id" ref="chart22020400"/>
|
||||
<field name="base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="ref_tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
<record id="vz_kraj_usl_22" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT usł nalicz-22%</field>
|
||||
<field name="description">ZU22</field>
|
||||
<field name="amount">0.220000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_collected_id" ref="chart22020100"/>
|
||||
<field name="account_paid_id" ref="chart22020100"/>
|
||||
<field name="base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="ref_tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
<field name="ref_tax_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
|
||||
# Unia
|
||||
#===========================================================
|
||||
|
||||
<record id="vs_unia" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Dost tow. unia</field>
|
||||
<field name="description">UDT</field>
|
||||
<field name="amount">0.000000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="base_code_id" ref="p_dost_wspol"/>
|
||||
<field name="ref_base_code_id" ref="p_dost_wspol"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
<record id="vz_unia" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Nab tow unia</field>
|
||||
<field name="description">UNT</field>
|
||||
<field name="amount">0.23</field>
|
||||
<field name="type">percent</field>
|
||||
<field eval="True" name="child_depend"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="base_code_id" ref="p_wew_wspol_nab_tow"/>
|
||||
<field name="ref_base_code_id" ref="p_wew_wspol_nab_tow"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
<record id="vz_unia_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Nab tow unia 1</field>
|
||||
<field name="description">UNT1</field>
|
||||
<field name="amount" eval="1.00"/>
|
||||
<field name="sequence" eval="100"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="parent_id" ref="vz_unia"/>
|
||||
<field name="account_collected_id" ref="chart22020400"/>
|
||||
<field name="account_paid_id" ref="chart22020400"/>
|
||||
<field name="tax_code_id" eval="v_wew_wspol_nab_tow"/>
|
||||
<field name="ref_tax_code_id" eval="v_wew_wspol_nab_tow"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
</record>
|
||||
<record id="vz_unia_2" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Nab tow unia 2</field>
|
||||
<field name="description">UNT2</field>
|
||||
<field name="amount" eval="-1.00"/>
|
||||
<field name="sequence" eval="110"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="parent_id" ref="vz_unia"/>
|
||||
<field name="account_collected_id" ref="chart22040300"/>
|
||||
<field name="account_paid_id" ref="chart22040300"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
</record>
|
||||
|
||||
|
||||
# Eksport / Import
|
||||
#================================================
|
||||
|
||||
<record id="vs_eksp_tow" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Eksp Tow</field>
|
||||
<field name="description">EXT</field>
|
||||
<field name="amount">0.000000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="base_code_id" ref="p_eksport"/>
|
||||
<field name="ref_base_code_id" ref="p_eksport"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
<record id="vz_imp_tow" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Imp Tow</field>
|
||||
<field name="description">IMT</field>
|
||||
<field name="amount">0.23</field>
|
||||
<field name="type">percent</field>
|
||||
<field eval="True" name="child_depend"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="base_code_id" ref="p_import_tow_art33a"/>
|
||||
<field name="ref_base_code_id" ref="p_import_tow_art33a"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
<record id="vz_imp_tow_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Imp Tow 1</field>
|
||||
<field name="description">IMT1</field>
|
||||
<field name="amount" eval="1.00"/>
|
||||
<field name="sequence" eval="200"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="parent_id" ref="vz_imp_tow"/>
|
||||
<field name="account_collected_id" ref="chart22020400"/>
|
||||
<field name="account_paid_id" ref="chart22020400"/>
|
||||
<field name="tax_code_id" eval="v_import_tow_art33a"/>
|
||||
<field name="ref_tax_code_id" eval="v_import_tow_art33a"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
</record>
|
||||
<record id="vz_imp_tow_2" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Imp Tow 2</field>
|
||||
<field name="description">IMT2</field>
|
||||
<field name="amount" eval="-1.00"/>
|
||||
<field name="sequence" eval="210"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="parent_id" ref="vz_imp_tow"/>
|
||||
<field name="account_collected_id" ref="chart22040300"/>
|
||||
<field name="account_paid_id" ref="chart22040300"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
</record>
|
||||
|
||||
<record id="vs_ekspu" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Eksp Usł</field>
|
||||
<field name="description">EXU</field>
|
||||
<field name="amount">0.000000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="base_code_id" ref="p_dost_poza_kraj"/>
|
||||
<field name="ref_base_code_id" ref="p_dost_poza_kraj"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
<record id="vs_dostu" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Świad Usł</field>
|
||||
<field name="description">UDU</field>
|
||||
<field name="amount">0.000000</field>
|
||||
<field name="type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="base_code_id" ref="p_us_poza_kraj_art100"/>
|
||||
<field name="ref_base_code_id" ref="p_us_poza_kraj_art100"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
<record id="vz_impu" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Imp Usł</field>
|
||||
<field name="description">IMU</field>
|
||||
<field name="amount">0.23</field>
|
||||
<field name="type">percent</field>
|
||||
<field eval="True" name="child_depend"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="base_code_id" ref="p_import_uslug"/>
|
||||
<field name="ref_base_code_id" ref="p_import_uslug"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
<record id="vz_impu_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Imp Usł 1</field>
|
||||
<field name="description">IMU1</field>
|
||||
<field name="amount" eval="1.00"/>
|
||||
<field name="sequence" eval="200"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="parent_id" ref="vz_impu"/>
|
||||
<field name="account_collected_id" ref="chart22020400"/>
|
||||
<field name="account_paid_id" ref="chart22020400"/>
|
||||
<field name="tax_code_id" eval="v_import_uslug"/>
|
||||
<field name="ref_tax_code_id" eval="v_import_uslug"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
</record>
|
||||
<record id="vz_impu_2" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Imp Usł 2</field>
|
||||
<field name="description">IMU2</field>
|
||||
<field name="amount" eval="-1.00"/>
|
||||
<field name="sequence" eval="210"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="parent_id" ref="vz_impu"/>
|
||||
<field name="account_collected_id" ref="chart22040300"/>
|
||||
<field name="account_paid_id" ref="chart22040300"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
</record>
|
||||
|
||||
<record id="vz_nabu" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Nab Usł</field>
|
||||
<field name="description">UNU</field>
|
||||
<field name="amount">0.23</field>
|
||||
<field name="type">percent</field>
|
||||
<field eval="True" name="child_depend"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="base_code_id" ref="p_import_uslug_art28b"/>
|
||||
<field name="ref_base_code_id" ref="p_import_uslug_art28b"/>
|
||||
<field name="ref_base_sign" eval="-1"/>
|
||||
</record>
|
||||
|
||||
<record id="vz_nabu_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Nab Usł 1</field>
|
||||
<field name="description">UNU1</field>
|
||||
<field name="amount" eval="1.00"/>
|
||||
<field name="sequence" eval="200"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="parent_id" ref="vz_nabu"/>
|
||||
<field name="account_collected_id" ref="chart22020400"/>
|
||||
<field name="account_paid_id" ref="chart22020400"/>
|
||||
<field name="tax_code_id" eval="v_import_uslug_art28b"/>
|
||||
<field name="ref_tax_code_id" eval="v_import_uslug_art28b"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
</record>
|
||||
<record id="vz_nabu_2" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">Nab Usł 2</field>
|
||||
<field name="description">UNU2</field>
|
||||
<field name="amount" eval="-1.00"/>
|
||||
<field name="sequence" eval="210"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="parent_id" ref="vz_nabu"/>
|
||||
<field name="account_collected_id" ref="chart22040300"/>
|
||||
<field name="account_paid_id" ref="chart22040300"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
</record>
|
||||
|
||||
# Leasing pojazdu
|
||||
#================================================
|
||||
|
||||
<record id="vp_leas" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT - leasing pojazdu</field>
|
||||
<field name="description">VLP</field>
|
||||
<field name="amount">1.00</field>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="type">percent</field>
|
||||
<field eval="True" name="child_depend"/>
|
||||
<field name="type_tax_use">all</field>
|
||||
</record>
|
||||
|
||||
<record id="vp_leas_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT - leasing pojazdu 60% x 23%</field>
|
||||
<field name="description">VLP-1</field>
|
||||
<field name="amount" eval="0.1380"/>
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="parent_id" ref="vp_leas"/>
|
||||
<field name="account_collected_id" ref="chart22020400"/>
|
||||
<field name="account_paid_id" ref="chart22020400"/>
|
||||
<field name="base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="ref_base_code_id" ref="p_nab_tow_usluga"/>
|
||||
<field name="ref_tax_code_id" ref="v_nab_tow_usluga"/>
|
||||
<field name="type_tax_use">all</field>
|
||||
</record>
|
||||
|
||||
<record id="vp_leas_2" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
<field name="name">VAT - leasing pojazdu 40% x 23%</field>
|
||||
<field name="description">VLP-2</field>
|
||||
<field name="amount" eval="0.092000"/>
|
||||
<field name="sequence" eval="20"/>
|
||||
<field name="type">percent</field>
|
||||
<field name="parent_id" ref="vp_leas"/>
|
||||
<field name="account_collected_id" ref="chart76140000"/>
|
||||
<field name="account_paid_id" ref="chart76140000"/>
|
||||
<field name="type_tax_use">all</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
|
|
|
@ -5,43 +5,391 @@
|
|||
#
|
||||
# Tax Code Template Configuration
|
||||
#
|
||||
<record model="account.tax.code.template" id="vat_code_tax">
|
||||
<field name="name">Podatek</field>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="vat_code_balance_net">
|
||||
<field name="name">Różnica podatku do zapłacenia</field>
|
||||
<field name="parent_id" ref="vat_code_tax"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="vat_code_due_tva">
|
||||
<field name="name">Podatek należny (Podatek do zapłacenia)</field>
|
||||
<field name="parent_id" ref="vat_code_balance_net"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="vat_code_payable">
|
||||
<field name="name">Podatek naliczony (Podatek do odliczenia)</field>
|
||||
<field name="parent_id" ref="vat_code_balance_net"/>
|
||||
<field eval="-1" name="sign"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="vat_code_base_net">
|
||||
<field name="name">Podstawy podatku</field>
|
||||
<field name="parent_id" ref="vat_code_tax"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="tax_code">
|
||||
<field name="name">Rejestr główny</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.tax.code.template" id="vat_code_base_due">
|
||||
<field name="name">Podstawa dla podatku przy sprzedaży</field>
|
||||
<field name="parent_id" ref="vat_code_base_net"/>
|
||||
</record>
|
||||
# E group
|
||||
# =======================================================================================
|
||||
|
||||
<record model="account.tax.code.template" id="v_do_przen">
|
||||
<field name="name">Podatek - Do przeniesienia</field>
|
||||
<field name="code">E - 55</field>
|
||||
<field name="info">Kwota do przeniesienia na następny okres rozliczeniowy</field>
|
||||
<field name="parent_id" ref="tax_code"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_nadwyzka">
|
||||
<field name="name">Podatek - Nadwyżka naliczonego nad należnym</field>
|
||||
<field name="code">E - 50</field>
|
||||
<field name="info">Nadwyżka podatku naliczonego nad należnym</field>
|
||||
<field name="parent_id" ref="v_do_przen"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_wplata_do_us">
|
||||
<field name="name">Podatek - Do wpłaty do US</field>
|
||||
<field name="code">E - 48</field>
|
||||
<field name="info">Kwota podatku podlegająca wpłacie do urzędu skarbowego</field>
|
||||
<field name="parent_id" ref="v_nadwyzka"/>
|
||||
<field name="sign" eval="-1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_zakup_kas">
|
||||
<field name="name">Podatek - Wydatek na kasy rejestrujące</field>
|
||||
<field name="code">E - 46</field>
|
||||
<field name="info">Kwota wydatkowana na zakup kas rejestrujących, do odliczenia w danym okresie rozliczeniowym</field>
|
||||
<field name="parent_id" ref="v_wplata_do_us"/>
|
||||
<field name="sign" eval="-1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_zaniechanie">
|
||||
<field name="name">Podatek - Objęty zaniechaniem poboru</field>
|
||||
<field name="code">E - 47</field>
|
||||
<field name="info">Kwota podatku objęta zaniechaniem poboru</field>
|
||||
<field name="parent_id" ref="v_wplata_do_us"/>
|
||||
<field name="sign" eval="-1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_zakup_kas_okres">
|
||||
<field name="name">Podatek - Wydatek na kasy do zwrotu w tym okresie</field>
|
||||
<field name="code">E - 49</field>
|
||||
<field name="info">Kwota wydatkowana na zakup kas rejestrujących, przysługująca do zwrotu w danym okresie rozliczeniowym</field>
|
||||
<field name="parent_id" ref="v_nadwyzka"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_net">
|
||||
<field name="name">Podstawa dla podatku przy zakupach</field>
|
||||
<field name="parent_id" ref="vat_code_base_net"/>
|
||||
<field eval="-1" name="sign"/>
|
||||
</record>
|
||||
<record model="account.tax.code.template" id="v_do_zwrotu">
|
||||
<field name="name">Podatek - Do zwrotu</field>
|
||||
<field name="code">E - 51</field>
|
||||
<field name="info">Kwota do zwrotu na rachunek wskazany przez podatnika</field>
|
||||
<field name="parent_id" ref="v_do_przen"/>
|
||||
<field name="sign" eval="-1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_do_zwrotu_25">
|
||||
<field name="name">Podatek - Do zwrotu 25 dni</field>
|
||||
<field name="code">E - 52</field>
|
||||
<field name="info">W tym kwota do zwrotu w terminie 25 dni</field>
|
||||
<field name="parent_id" ref="v_do_zwrotu"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_do_zwrotu_60">
|
||||
<field name="name">Podatek - Do zwrotu 60 dni</field>
|
||||
<field name="code">E - 53</field>
|
||||
<field name="info">W tym kwota do zwrotu w terminie 60 dni</field>
|
||||
<field name="parent_id" ref="v_do_zwrotu"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_do_zwrotu_180">
|
||||
<field name="name">Podatek - Do zwrotu 180 dni</field>
|
||||
<field name="code">E - 54</field>
|
||||
<field name="info">W tym kwota do zwrotu w terminie 180 dni</field>
|
||||
<field name="parent_id" ref="v_do_zwrotu"/>
|
||||
</record>
|
||||
|
||||
|
||||
# C group
|
||||
#================================================================================
|
||||
|
||||
<record model="account.tax.code.template" id="p_razem_c">
|
||||
<field name="name">Podstawa - Razem C</field>
|
||||
<field name="code">C.RAZEM - 35</field>
|
||||
<field name="info">Poz 35 = suma kwot z poz 10, 11, 13, 15, 17, 19, 21, 22, 23, 25, 27 i 31</field>
|
||||
<field name="parent_id" ref="tax_code"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_razem_c">
|
||||
<field name="name">Podatek - Razem C</field>
|
||||
<field name="code">C.RAZEM - 36</field>
|
||||
<field name="info">Poz 36 = suma kwot z poz 16, 18, 20, 24, 26, 28, 32, 33, pomniejszona o kwotę z pozycji 34</field>
|
||||
<field name="parent_id" ref="v_wplata_do_us"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<record model="account.tax.code.template" id="p_dost_kraj_zw">
|
||||
<field name="name">Podstawa - Dostawa towarów/usług, kraj, zwolnione</field>
|
||||
<field name="code">C.01 - 10</field>
|
||||
<field name="info">Dostawa towarów oraz świadczenie usług na terytorium kraju, zwolnione od podatku</field>
|
||||
<field name="parent_id" ref="p_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_dost_poza_kraj">
|
||||
<field name="name">Podstawa - Dostawa towarów/usług, poza kraj</field>
|
||||
<field name="code">C.02 - 11</field>
|
||||
<field name="info">Dostawa towarów oraz świadczenie usług poza terytorium kraju</field>
|
||||
<field name="parent_id" ref="p_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
<field name="notprintable" eval="1" />
|
||||
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_us_poza_kraj_art100">
|
||||
<field name="name">Podstawa - W tym usługi art 100.1.4</field>
|
||||
<field name="code">C.02a - 12</field>
|
||||
<field name="info">W tym świadczenie usług, o których mowa w art 100 ust. 1 pkt 4 ustawy. Do Dostawa towarów oraz świadczenie usług poza terytorium kraju</field>
|
||||
<field name="parent_id" ref="p_dost_poza_kraj"/>
|
||||
<field name="sign" eval="1" />
|
||||
<field name="notprintable" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_dost_kraj_0">
|
||||
<field name="name">Podstawa - Dostawa towarów/usług, kraj, 0%</field>
|
||||
<field name="code">C.03 - 13</field>
|
||||
<field name="info">Dostawa towarów oraz świadczenie usług na terytorium kraju, opodatkowane stawką 0%</field>
|
||||
<field name="parent_id" ref="p_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_dost_kraj_0_art129">
|
||||
<field name="name">Podstawa - W tym towary art 129</field>
|
||||
<field name="code">C.03a - 14</field>
|
||||
<field name="info">W tym dostawa towarów, o której mowa w art. 129 ustawy. Do Dostawa towarów oraz świadczenie usług na terytorium kraju, opodatkowane stawką 0%</field>
|
||||
<field name="parent_id" ref="p_dost_kraj_0"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_dost_kraj_3">
|
||||
<field name="name">Podstawa - Dostawa towarów/usług, kraj, 3% lub 5%</field>
|
||||
<field name="code">C.04 - 15</field>
|
||||
<field name="info">Dostawa towarów oraz świadczenie usług na terytorium kraju, opodatkowane stawką 3% albo 5%</field>
|
||||
<field name="parent_id" ref="p_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_dost_kraj_3">
|
||||
<field name="name">Podatek - Dostawa towarów/usług, kraj, 3% lub 5%</field>
|
||||
<field name="code">C.04 - 16</field>
|
||||
<field name="info">Dostawa towarów oraz świadczenie usług na terytorium kraju, opodatkowane stawką 3% albo 5%</field>
|
||||
<field name="parent_id" ref="v_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_dost_kraj_7">
|
||||
<field name="name">Podstawa - Dostawa towarów/usług, kraj, 7% lub 8%</field>
|
||||
<field name="code">C.05 - 17</field>
|
||||
<field name="info">Dostawa towarów oraz świadczenie usług na terytorium kraju, opodatkowane stawką 7% albo 8%</field>
|
||||
<field name="parent_id" ref="p_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_dost_kraj_7">
|
||||
<field name="name">Podatek - Dostawa towarów/usług, kraj, 7% lub 8%</field>
|
||||
<field name="code">C.05 - 18</field>
|
||||
<field name="info">Dostawa towarów oraz świadczenie usług na terytorium kraju, opodatkowane stawką 7% albo 8%</field>
|
||||
<field name="parent_id" ref="v_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_dost_kraj_22">
|
||||
<field name="name">Podstawa - Dostawa towarów/usług, kraj, 22% lub 23%</field>
|
||||
<field name="code">C.06 - 19</field>
|
||||
<field name="info">Dostawa towarów oraz świadczenie usług na terytorium kraju, opodatkowane stawką 22% albo 23%</field>
|
||||
<field name="parent_id" ref="p_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_dost_kraj_22">
|
||||
<field name="name">Podatek - Dostawa towarów/usług, kraj, 22% lub 23%</field>
|
||||
<field name="code">C.06 - 20</field>
|
||||
<field name="info">Dostawa towarów oraz świadczenie usług na terytorium kraju, opodatkowane stawką 22% albo 23%</field>
|
||||
<field name="parent_id" ref="v_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_dost_wspol">
|
||||
<field name="name">Podstawa - Wew-wspól dostawa towarów</field>
|
||||
<field name="code">C.07 - 21</field>
|
||||
<field name="info">Wewnątrzwspólnotowa dostawa towarów</field>
|
||||
<field name="parent_id" ref="p_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
<field name="notprintable" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_eksport">
|
||||
<field name="name">Podstawa - Eksport towarów</field>
|
||||
<field name="code">C.08 - 22</field>
|
||||
<field name="info">Eksport towarów</field>
|
||||
<field name="parent_id" ref="p_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
<field name="notprintable" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_wew_wspol_nab_tow">
|
||||
<field name="name">Podstawa - Wewn-wspól. nabycie towarów</field>
|
||||
<field name="code">C.09 - 23</field>
|
||||
<field name="info">Wewnątrzwspólnotowe nabycie towarów</field>
|
||||
<field name="parent_id" ref="p_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_wew_wspol_nab_tow">
|
||||
<field name="name">Podatek - Wewn-wspól. nabycie towarów</field>
|
||||
<field name="code">C.09 - 24</field>
|
||||
<field name="info">Wewnątrzwspólnotowe nabycie towarów</field>
|
||||
<field name="parent_id" ref="v_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_import_tow_art33a">
|
||||
<field name="name">Podstawa - Import towarów art. 33a</field>
|
||||
<field name="code">C.10 - 25</field>
|
||||
<field name="info">Import towarów, podlegający rozliczeniu zgodnie z art 33a ustawy</field>
|
||||
<field name="parent_id" ref="p_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_import_tow_art33a">
|
||||
<field name="name">Podatek - Import towarów art. 33a</field>
|
||||
<field name="code">C.10 - 26</field>
|
||||
<field name="info">Import towarów, podlegający rozliczeniu zgodnie z art 33a ustawy</field>
|
||||
<field name="parent_id" ref="v_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_import_uslug">
|
||||
<field name="name">Podstawa - Import usług</field>
|
||||
<field name="code">C.11 - 27</field>
|
||||
<field name="info">Import usług</field>
|
||||
<field name="parent_id" ref="p_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_import_uslug">
|
||||
<field name="name">Podatek - Import usług</field>
|
||||
<field name="code">C.11 - 28</field>
|
||||
<field name="info">Import usług</field>
|
||||
<field name="parent_id" ref="v_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_import_uslug_art28b">
|
||||
<field name="name">Podstawa - W tym nabycie wg art 28b</field>
|
||||
<field name="code">C.11a - 29</field>
|
||||
<field name="info">W tym nabycie od podatników podatku od wartości dodanej usług, do których stosuje się art 28b ustawy</field>
|
||||
<field name="parent_id" ref="p_import_uslug"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_import_uslug_art28b">
|
||||
<field name="name">Podatek - W tym nabycie wg art 28b</field>
|
||||
<field name="code">C.11a - 30</field>
|
||||
<field name="info">W tym nabycie od podatników podatku od wartości dodanej usług, do których stosuje się art 28b ustawy</field>
|
||||
<field name="parent_id" ref="v_import_uslug"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_dost_tow_podat_nabywca">
|
||||
<field name="name">Podstawa - Dostawa towarów, podatnik nabywca</field>
|
||||
<field name="code">C.12 - 31</field>
|
||||
<field name="info">Dostawa towarów, dla której podatnikiem jest nabywca</field>
|
||||
<field name="parent_id" ref="p_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_dost_tow_podat_nabywca">
|
||||
<field name="name">Podatek - Dostawa towarów, podatnik nabywca</field>
|
||||
<field name="code">C.12 - 32</field>
|
||||
<field name="info">Dostawa towarów, dla której podatnikiem jest nabywca</field>
|
||||
<field name="parent_id" ref="v_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_spis_z_natury">
|
||||
<field name="name">Podatek - Ze spisu z natury art 14.5</field>
|
||||
<field name="code">C.13 - 33</field>
|
||||
<field name="info">Kwota podatku należnego od towarów i usług objętych spisem z natury, o którym mowa w art.14 ust.5 ustawy</field>
|
||||
<field name="parent_id" ref="v_razem_c"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_nab_transp_termin">
|
||||
<field name="name">Podatek - Wew.wspól. nabycie środk. transp. termin</field>
|
||||
<field name="code">C.14 - 34</field>
|
||||
<field name="info">Kwota podatku należnego od wewnątrzwspólnotowego nabycia środków transportu, wykazanego w poz.34, podlegająca wpłacie w terminie, o którym mowa w art.103 ust.3 w związku z ust.4 ustawy</field>
|
||||
<field name="parent_id" ref="v_razem_c"/>
|
||||
<field name="sign" eval="-1" />
|
||||
</record>
|
||||
|
||||
# D group
|
||||
# =======================================================================================
|
||||
|
||||
<record model="account.tax.code.template" id="p_razem_d">
|
||||
<field name="name">Podstawa - Razem D</field>
|
||||
<field name="code">D.RAZEM - 00</field>
|
||||
<field name="info">Poz nieistniejąca = suma kwot z poz 49 i 51</field>
|
||||
<field name="parent_id" ref="tax_code"/>
|
||||
<field name="sign" eval="1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_razem_d">
|
||||
<field name="name">Podatek - Razem D</field>
|
||||
<field name="code">D.03 - 45</field>
|
||||
<field name="info">Razem kwota podatku naliczonego do odliczenia</field>
|
||||
<field name="parent_id" ref="v_wplata_do_us"/>
|
||||
<field name="sign" eval="-1" />
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_nadwyzka_z_poprz">
|
||||
<field name="name">Podatek - Nadwyżka z poprzedniej deklaracji</field>
|
||||
<field name="code">D.01 - 37</field>
|
||||
<field name="info">Kwota nadwyżki z poprzedniej deklaracji</field>
|
||||
<field name="parent_id" ref="v_razem_d"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_nal_spis">
|
||||
<field name="name">Podatek - Naliczony ze spisu z natury, art.113</field>
|
||||
<field name="code">D.01 - 38</field>
|
||||
<field name="info">Kwota podatku naliczonego wynikającego ze spisu z natury, o którym mowa w art.113 ust.5 ustawy</field>
|
||||
<field name="parent_id" ref="v_razem_d"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_nab_tow_usluga_st">
|
||||
<field name="name">Podstawa - Nabycie towarów i usług ś.trwałe</field>
|
||||
<field name="code">D.02 - 39</field>
|
||||
<field name="info">Nabycie towarów i usług zaliczanych u podatnika do środków trwałych</field>
|
||||
<field name="parent_id" ref="p_razem_d"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_nab_tow_usluga_st">
|
||||
<field name="name">Podatek - Nabycie towarów i usług ś.trwałe</field>
|
||||
<field name="code">D.02 - 40</field>
|
||||
<field name="info">Nabycie towarów i usług zaliczanych u podatnika do środków trwałych</field>
|
||||
<field name="parent_id" ref="v_razem_d"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="p_nab_tow_usluga">
|
||||
<field name="name">Podstawa - Nabycie towarów i usług pozostałych</field>
|
||||
<field name="code">D.02 - 41</field>
|
||||
<field name="info">Nabycie towarów i usług pozostałych</field>
|
||||
<field name="parent_id" ref="p_razem_d"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_nab_tow_usluga">
|
||||
<field name="name">Podatek - Nabycie towarów i usług pozostałych</field>
|
||||
<field name="code">D.02 - 42</field>
|
||||
<field name="info">Nabycie towarów i usług pozostałych</field>
|
||||
<field name="parent_id" ref="v_razem_d"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_korekta_st">
|
||||
<field name="name">Podatek - Korekta naliczonego od nabycia ś.trwałych</field>
|
||||
<field name="code">D.03 - 43</field>
|
||||
<field name="info">Korekta podatku naliczonego od nabycia środków trwałych</field>
|
||||
<field name="parent_id" ref="v_razem_d"/>
|
||||
</record>
|
||||
|
||||
<record model="account.tax.code.template" id="v_korekta_poz">
|
||||
<field name="name">Podatek - Korekta naliczonego od pozostałych nabyć</field>
|
||||
<field name="code">D.03 - 44</field>
|
||||
<field name="info">Korekta podatku naliczonego od pozostałych nabyć</field>
|
||||
<field name="parent_id" ref="v_razem_d"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record model='res.country.state' id='CA01'>
|
||||
<field name='name'>mazowieckie</field>
|
||||
<field name='code'>MZ</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA02'>
|
||||
<field name='name'>dolnośląskie</field>
|
||||
<field name='code'>DS</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA03'>
|
||||
<field name='name'>lubelskie</field>
|
||||
<field name='code'>LU</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA04'>
|
||||
<field name='name'>kujawsko-pomorskie</field>
|
||||
<field name='code'>KS</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA05'>
|
||||
<field name='name'>lubuskie</field>
|
||||
<field name='code'>LB</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA06'>
|
||||
<field name='name'>łódzkie</field>
|
||||
<field name='code'>LD</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA07'>
|
||||
<field name='name'>małopolskie</field>
|
||||
<field name='code'>MA</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA08'>
|
||||
<field name='name'>opolskie</field>
|
||||
<field name='code'>OP</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA09'>
|
||||
<field name='name'>podkarpackie</field>
|
||||
<field name='code'>PK</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA10'>
|
||||
<field name='name'>podlaskie</field>
|
||||
<field name='code'>PD</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA11'>
|
||||
<field name='name'>pomorskie</field>
|
||||
<field name='code'>PM</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA12'>
|
||||
<field name='name'>śląskie</field>
|
||||
<field name='code'>SL</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA13'>
|
||||
<field name='name'>świętokrzyskie</field>
|
||||
<field name='code'>SK</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA14'>
|
||||
<field name='name'>warmińsko-mazurskie</field>
|
||||
<field name='code'>WN</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA15'>
|
||||
<field name='name'>wielkopolskie</field>
|
||||
<field name='code'>WP</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
<record model='res.country.state' id='CA16'>
|
||||
<field name='name'>zachodniopomorskie</field>
|
||||
<field name='code'>ZP</field>
|
||||
<field search="[('code','=','PL')]" model='res.country' name='country_id'/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,247 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<!-- Fiscal Position Templates -->
|
||||
|
||||
<record id="fiscal_position_template_1" model="account.fiscal.position.template">
|
||||
<field name="name">Kraj</field>
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
</record>
|
||||
|
||||
<record id="fiscal_position_template_2" model="account.fiscal.position.template">
|
||||
<field name="name">Wspólnota</field>
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
</record>
|
||||
|
||||
<record id="fiscal_position_template_3" model="account.fiscal.position.template">
|
||||
<field name="name">Import/Eksport</field>
|
||||
<field name="chart_template_id" ref="pl_chart_template"/>
|
||||
</record>
|
||||
|
||||
<!-- Fiscal Position Tax Templates -->
|
||||
|
||||
<!-- Wspólnota -->
|
||||
<!-- Sprzedaż -->
|
||||
<record id="fiscal_position_tax_template_1a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vs_kraj_23" />
|
||||
<field name="tax_dest_id" ref="vs_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_1" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vs_kraj_22" />
|
||||
<field name="tax_dest_id" ref="vs_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_2a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vs_kraj_8" />
|
||||
<field name="tax_dest_id" ref="vs_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_2" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vs_kraj_7" />
|
||||
<field name="tax_dest_id" ref="vs_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_3a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vs_kraj_5" />
|
||||
<field name="tax_dest_id" ref="vs_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_3" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vs_kraj_3" />
|
||||
<field name="tax_dest_id" ref="vs_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_4" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vs_kraj_0" />
|
||||
<field name="tax_dest_id" ref="vs_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_5" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vs_kraj_zw" />
|
||||
<field name="tax_dest_id" ref="vs_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_6a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vs_kraj_usl_23" />
|
||||
<field name="tax_dest_id" ref="vs_dostu" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_6" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vs_kraj_usl_22" />
|
||||
<field name="tax_dest_id" ref="vs_dostu" />
|
||||
</record>
|
||||
|
||||
# Zakup
|
||||
|
||||
<record id="fiscal_position_tax_template_11a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vz_kraj_23" />
|
||||
<field name="tax_dest_id" ref="vz_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_11" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vz_kraj_22" />
|
||||
<field name="tax_dest_id" ref="vz_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_12a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vz_kraj_8" />
|
||||
<field name="tax_dest_id" ref="vz_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_12" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vz_kraj_7" />
|
||||
<field name="tax_dest_id" ref="vz_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_13a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vz_kraj_5" />
|
||||
<field name="tax_dest_id" ref="vz_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_13" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vz_kraj_3" />
|
||||
<field name="tax_dest_id" ref="vz_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_14" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vz_kraj_0" />
|
||||
<field name="tax_dest_id" ref="vz_unia" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_15" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vz_kraj_zw" />
|
||||
<field name="tax_dest_id" ref="vz_unia" />
|
||||
</record>
|
||||
|
||||
<record id="fiscal_position_tax_template_16a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vz_kraj_usl_23" />
|
||||
<field name="tax_dest_id" ref="vz_nabu" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_16" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_2" />
|
||||
<field name="tax_src_id" ref="vz_kraj_usl_22" />
|
||||
<field name="tax_dest_id" ref="vz_nabu" />
|
||||
</record>
|
||||
|
||||
|
||||
# Eksport / Import
|
||||
#====================================================
|
||||
|
||||
|
||||
# Sprzedaż
|
||||
|
||||
<record id="fiscal_position_tax_template_21a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vs_kraj_23" />
|
||||
<field name="tax_dest_id" ref="vs_eksp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_21" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vs_kraj_22" />
|
||||
<field name="tax_dest_id" ref="vs_eksp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_22a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vs_kraj_8" />
|
||||
<field name="tax_dest_id" ref="vs_eksp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_22" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vs_kraj_7" />
|
||||
<field name="tax_dest_id" ref="vs_eksp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_23a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vs_kraj_5" />
|
||||
<field name="tax_dest_id" ref="vs_eksp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_23" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vs_kraj_3" />
|
||||
<field name="tax_dest_id" ref="vs_eksp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_24" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vs_kraj_0" />
|
||||
<field name="tax_dest_id" ref="vs_eksp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_25" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vs_kraj_zw" />
|
||||
<field name="tax_dest_id" ref="vs_eksp_tow" />
|
||||
</record>
|
||||
|
||||
<record id="fiscal_position_tax_template_26a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vs_kraj_usl_23" />
|
||||
<field name="tax_dest_id" ref="vs_ekspu" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_26" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vs_kraj_usl_22" />
|
||||
<field name="tax_dest_id" ref="vs_ekspu" />
|
||||
</record>
|
||||
|
||||
|
||||
# Zakupy
|
||||
|
||||
|
||||
<record id="fiscal_position_tax_template_31a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vz_kraj_23" />
|
||||
<field name="tax_dest_id" ref="vz_imp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_31" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vz_kraj_22" />
|
||||
<field name="tax_dest_id" ref="vz_imp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_32a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vz_kraj_8" />
|
||||
<field name="tax_dest_id" ref="vz_imp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_32" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vz_kraj_7" />
|
||||
<field name="tax_dest_id" ref="vz_imp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_33a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vz_kraj_5" />
|
||||
<field name="tax_dest_id" ref="vz_imp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_33" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vz_kraj_3" />
|
||||
<field name="tax_dest_id" ref="vz_imp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_34" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vz_kraj_0" />
|
||||
<field name="tax_dest_id" ref="vz_imp_tow" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_35" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vz_kraj_zw" />
|
||||
<field name="tax_dest_id" ref="vz_imp_tow" />
|
||||
</record>
|
||||
|
||||
<record id="fiscal_position_tax_template_36a" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vz_kraj_usl_23" />
|
||||
<field name="tax_dest_id" ref="vz_impu" />
|
||||
</record>
|
||||
<record id="fiscal_position_tax_template_36" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_3" />
|
||||
<field name="tax_src_id" ref="vz_kraj_usl_22" />
|
||||
<field name="tax_dest_id" ref="vz_impu" />
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -119,11 +119,10 @@ class mail_notification(osv.Model):
|
|||
# add user signature
|
||||
user = self.pool.get("res.users").browse(cr, SUPERUSER_ID, [user_id], context=context)[0]
|
||||
if user.signature:
|
||||
signature = plaintext2html(user.signature)
|
||||
signature = user.signature
|
||||
else:
|
||||
signature = "--<br />%s" % user.name
|
||||
footer = tools.append_content_to_html(footer, signature, plaintext=False, container_tag='p')
|
||||
|
||||
footer = tools.append_content_to_html(footer, signature, plaintext=False)
|
||||
# add company signature
|
||||
if user.company_id.website:
|
||||
website_url = ('http://%s' % user.company_id.website) if not user.company_id.website.lower().startswith(('http:', 'https:')) \
|
||||
|
|
|
@ -1,29 +1,7 @@
|
|||
/* ------------ TOPBAR MAIL BUTTON --------------- */
|
||||
|
||||
/* FIXME this css is not very pretty because it uses a
|
||||
* 'button' element wich comes with a lot of inappropriate
|
||||
* styling. Entypo is also a headache to center properly
|
||||
* */
|
||||
|
||||
.openerp .oe_topbar_item.oe_topbar_compose_full_email{
|
||||
padding: 0px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.openerp .oe_topbar_item.oe_topbar_compose_full_email button{
|
||||
position: relative;
|
||||
top: -3px; /* centering entypo ... urgh */
|
||||
box-sizing: border-box;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
.oe_systray #oe_topbar_compose_full_email_icon {
|
||||
color: white;
|
||||
background: none;
|
||||
text-shadow: 0px 1px 2px black;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
border-radius: 0px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
/* ---- GENERIC FOR MAIL-RELATED STUFF ---- */
|
||||
|
|
|
@ -12,7 +12,9 @@ openerp_announcement = function(instance) {
|
|||
}
|
||||
var self = this;
|
||||
var config_parameter = new instance.web.Model('ir.config_parameter');
|
||||
var $bar = this.$el.find('.announcement_bar');
|
||||
$(openerp.qweb.render('WebClient.announcement_bar')).prependTo($('body'));
|
||||
var $bar = $('#announcement_bar_table');
|
||||
|
||||
return config_parameter.call('get_param', ['database.uuid', false]).then(function(dbuuid) {
|
||||
if (!dbuuid) {
|
||||
return;
|
||||
|
|
|
@ -1996,11 +1996,12 @@ openerp.mail = function (session) {
|
|||
template:'mail.ComposeMessageTopButton',
|
||||
|
||||
start: function () {
|
||||
this.$('button').on('click', this.on_compose_message );
|
||||
this.$el.on('click', this.on_compose_message);
|
||||
this._super();
|
||||
},
|
||||
|
||||
on_compose_message: function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
var action = {
|
||||
type: 'ir.actions.act_window',
|
||||
|
@ -2021,7 +2022,8 @@ openerp.mail = function (session) {
|
|||
this._super.apply(this, arguments);
|
||||
this.update_promise.then(function() {
|
||||
var mail_button = new session.web.ComposeMessageTopButton();
|
||||
mail_button.appendTo(session.webclient.$el.find('.oe_systray'));
|
||||
mail_button.appendTo(session.webclient.$el.parents().find('.oe_systray'));
|
||||
openerp.web.bus.trigger('resize'); // Re-trigger the reflow logic
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,12 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-extend="WebClient">
|
||||
<t t-jquery="table.oe_webclient" t-operation="prepend">
|
||||
<td colspan="2" class="announcement_bar">
|
||||
<span class="message"></span>
|
||||
<span class="url"><a href="https://services.openerp.com/openerp-enterprise/ab/register" target="_blank"></a></span>
|
||||
<span class="close"></span>
|
||||
</td>
|
||||
<t t-name="WebClient.announcement_bar">
|
||||
<div class="openerp" id="announcement_bar_table">
|
||||
<table class="oe_webclient">
|
||||
<tr>
|
||||
<td colspan="2" class="announcement_bar">
|
||||
<span class="message"></span>
|
||||
<span class="url">
|
||||
<a href="https://services.openerp.com/openerp-enterprise/ab/register" target="_blank"></a>
|
||||
</span>
|
||||
<span class="close"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
||||
|
|
|
@ -340,9 +340,11 @@
|
|||
render of the button on the user bar for open wizard compose message
|
||||
-->
|
||||
<t t-name="mail.ComposeMessageTopButton">
|
||||
<div title='Compose new Message' class="oe_topbar_item oe_topbar_compose_full_email">
|
||||
<button class="oe_e">%</button>
|
||||
</div>
|
||||
<li title='Compose new Message'>
|
||||
<a href="#">
|
||||
<i id="oe_topbar_compose_full_email_icon" class="fa fa-envelope-o"/>
|
||||
</a>
|
||||
</li>
|
||||
</t>
|
||||
|
||||
<!-- mail.thread.message.vote
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
from openerp.addons.mail.mail_mail import mail_mail
|
||||
from openerp.addons.mail.mail_thread import mail_thread
|
||||
from openerp.addons.mail.tests.common import TestMail
|
||||
from openerp.tools import mute_logger, email_split
|
||||
from openerp.tools import mute_logger, email_split, html2plaintext
|
||||
from openerp.tools.mail import html_sanitize
|
||||
|
||||
|
||||
class test_mail(TestMail):
|
||||
|
||||
def test_000_alias_setup(self):
|
||||
|
@ -474,7 +473,7 @@ class test_mail(TestMail):
|
|||
'message_post: notification email body alternative should contain the body')
|
||||
self.assertNotIn('<p>', sent_email['body_alternative'],
|
||||
'message_post: notification email body alternative still contains html')
|
||||
self.assertIn(user_raoul.signature, sent_email['body_alternative'],
|
||||
self.assertIn(html2plaintext(user_raoul.signature), sent_email['body_alternative'],
|
||||
'message_post: notification email body alternative should contain the sender signature')
|
||||
self.assertFalse(sent_email['references'],
|
||||
'message_post: references should be False when sending a message that is not a reply')
|
||||
|
@ -545,7 +544,7 @@ class test_mail(TestMail):
|
|||
'message_post: notification email body alternative should contain the body')
|
||||
self.assertNotIn('<p>', sent_email['body_alternative'],
|
||||
'message_post: notification email body alternative still contains html')
|
||||
self.assertIn(user_raoul.signature, sent_email['body_alternative'],
|
||||
self.assertIn(html2plaintext(user_raoul.signature), sent_email['body_alternative'],
|
||||
'message_post: notification email body alternative should contain the sender signature')
|
||||
self.assertIn(msg_message_id, sent_email['references'],
|
||||
'message_post: notification email references lacks parent message message_id')
|
||||
|
|
|
@ -29,7 +29,7 @@ def get_sys_logs(self, cr, uid):
|
|||
pool = openerp.registry(cr.dbname)
|
||||
|
||||
dbuuid = pool.get('ir.config_parameter').get_param(cr, uid, 'database.uuid')
|
||||
db_create_date = pool.get('ir.config_parameter').get_param(cr, uid, 'database.create_date')
|
||||
db_create_date = pool.get('ir.config_parameter').get_param(cr, SUPERUSER_ID, 'database.create_date')
|
||||
limit_date = datetime.datetime.now()
|
||||
limit_date = limit_date - datetime.timedelta(15)
|
||||
limit_date_str = limit_date.strftime(misc.DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
|
|
|
@ -9,9 +9,10 @@
|
|||
<record model="ir.ui.view" id="membership_product_search_form_view">
|
||||
<field name="name">membership.product.search.form</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="priority">50</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Membership Products">
|
||||
<field name="name" filter_domain="['|',('name','ilike',self),('code','ilike',self)]" string="Membership Product"/>
|
||||
<field name="name" string="Membership Product"/>
|
||||
<filter string="Inactive" icon="terp-gdu-smart-failing" domain="[('active','=',0)]"/>
|
||||
<field name="categ_id" operator="child_of"/>
|
||||
<group expand='0' string='Group by...'>
|
||||
|
|
|
@ -41,10 +41,17 @@ class product_template(osv.osv):
|
|||
return res
|
||||
|
||||
_columns = {
|
||||
"bom_ids": fields.one2many('mrp.bom', 'product_tmpl_id','Bill of Materials'),
|
||||
'bom_ids': fields.one2many('mrp.bom', 'product_tmpl_id','Bill of Materials'),
|
||||
'bom_count': fields.function(_bom_orders_count, string='# Bill of Material', type='integer', multi="_bom_order_count"),
|
||||
'mo_count': fields.function(_bom_orders_count_mo, string='# Manufacturing Orders', type='integer'),
|
||||
'produce_delay': fields.float('Manufacturing Lead Time', help="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."),
|
||||
'track_production': fields.boolean('Track Manufacturing Lots', help="Forces to specify a Serial Number for all moves containing this product and generated by a Manufacturing Order"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
"produce_delay": 1,
|
||||
}
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not default:
|
||||
default = {}
|
||||
|
@ -63,14 +70,8 @@ class product_product(osv.osv):
|
|||
return res
|
||||
|
||||
_columns = {
|
||||
"produce_delay": fields.float('Manufacturing Lead Time', help="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."),
|
||||
'track_production': fields.boolean('Track Manufacturing Lots', help="Forces to specify a Serial Number for all moves containing this product and generated by a Manufacturing Order"),
|
||||
'mo_count': fields.function(_bom_orders_count, string='# Manufacturing Orders', type='integer'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
"produce_delay": 1,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -523,6 +523,25 @@ class pos_order(osv.osv):
|
|||
_description = "Point of Sale"
|
||||
_order = "id desc"
|
||||
|
||||
def _order_fields(self, cr, uid, ui_order, context=None):
|
||||
return {
|
||||
'name': ui_order['name'],
|
||||
'user_id': ui_order['user_id'] or False,
|
||||
'session_id': ui_order['pos_session_id'],
|
||||
'lines': ui_order['lines'],
|
||||
'pos_reference':ui_order['name'],
|
||||
'partner_id': ui_order['partner_id'] or False,
|
||||
}
|
||||
|
||||
def _payment_fields(self, cr, uid, ui_paymentline, context=None):
|
||||
return {
|
||||
'amount': ui_paymentline['amount'] or 0.0,
|
||||
'payment_date': ui_paymentline['name'],
|
||||
'statement_id': ui_paymentline['statement_id'],
|
||||
'payment_name': ui_paymentline.get('note',False),
|
||||
'journal': ui_paymentline['journal_id'],
|
||||
}
|
||||
|
||||
def create_from_ui(self, cr, uid, orders, context=None):
|
||||
# Keep only new orders
|
||||
submitted_references = [o['data']['name'] for o in orders]
|
||||
|
@ -536,23 +555,9 @@ class pos_order(osv.osv):
|
|||
to_invoice = tmp_order['to_invoice']
|
||||
order = tmp_order['data']
|
||||
|
||||
order_id = self.create(cr, uid, {
|
||||
'name': order['name'],
|
||||
'user_id': order['user_id'] or False,
|
||||
'session_id': order['pos_session_id'],
|
||||
'lines': order['lines'],
|
||||
'pos_reference':order['name'],
|
||||
'partner_id': order['partner_id'] or False
|
||||
}, context)
|
||||
order_id = self.create(cr, uid, self._order_fields(cr, uid, order, context=context),context)
|
||||
for payments in order['statement_ids']:
|
||||
payment = payments[2]
|
||||
self.add_payment(cr, uid, order_id, {
|
||||
'amount': payment['amount'] or 0.0,
|
||||
'payment_date': payment['name'],
|
||||
'statement_id': payment['statement_id'],
|
||||
'payment_name': payment.get('note', False),
|
||||
'journal': payment['journal_id']
|
||||
}, context=context)
|
||||
self.add_payment(cr, uid, order_id, self._payment_fields(cr, uid, payments[2], context=context), context=context)
|
||||
|
||||
if order['amount_return']:
|
||||
session = self.pool.get('pos.session').browse(cr, uid, order['pos_session_id'], context=context)
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
<field name="partner_id" ref="partner_demo_portal"/>
|
||||
<field name="login">portal</field>
|
||||
<field name="password">portal</field>
|
||||
<field name="signature">--
|
||||
Mr Demo Portal</field>
|
||||
<field name="signature"><![CDATA[<span>--<br/>
|
||||
Mr Demo Portal</span>]]></field>
|
||||
<!-- Avoid auto-including this user in any default group -->
|
||||
<field name="groups_id" eval="[(5,)]"/>
|
||||
</record>
|
||||
|
|
|
@ -816,10 +816,8 @@ class product_product(osv.osv):
|
|||
uom.id, product.list_price, context['uom'])
|
||||
else:
|
||||
res[product.id] = product.list_price
|
||||
price_extra = 0.0
|
||||
for variant_id in product.attribute_value_ids:
|
||||
price_extra += variant_id.price_extra
|
||||
res[product.id] = (res[product.id] or 0.0) + price_extra
|
||||
res[product.id] = res[product.id] + product.price_extra
|
||||
|
||||
return res
|
||||
|
||||
def _get_partner_code_name(self, cr, uid, ids, product, partner_id, context=None):
|
||||
|
|
|
@ -283,15 +283,30 @@
|
|||
<record id="product_kanban_view" model="ir.ui.view">
|
||||
<field name="name">Product Kanban</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="inherit_id" ref="product.product_template_kanban_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="attribute_value_ids"/>
|
||||
</field>
|
||||
<xpath expr="//img[@class='oe_kanban_image']" position="replace">
|
||||
<img t-att-src="kanban_image('product.product', 'image_small', record.id.value)" class="oe_kanban_image"/>
|
||||
</xpath>
|
||||
<kanban>
|
||||
<field name="image_small"/>
|
||||
<field name="lst_price"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_vignette oe_semantic_html_override">
|
||||
<a type="open"><img t-att-src="kanban_image('product.product', 'image_small', record.id.value)" class="oe_kanban_image"/></a>
|
||||
<div class="oe_kanban_details">
|
||||
<h4>
|
||||
<a type="open">
|
||||
<field name="name"/>
|
||||
<field name="attribute_value_ids"/>
|
||||
</a>
|
||||
</h4>
|
||||
<div name="tags"/>
|
||||
<ul>
|
||||
<li>Price: <field name="lst_price"></field></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
@ -343,7 +358,7 @@
|
|||
<div class="oe_right">
|
||||
<button class="oe_inline oe_stat_button" string="Variant Prices" name="%(product.variants_template_action)d" type="action" icon="fa-strikethrough"/>
|
||||
<button class="oe_inline oe_stat_button" name="%(product.product_variant_action)d" type="action" icon="fa-sitemap">
|
||||
<field string="List of Variants" name="product_variant_count" widget="statinfo" />
|
||||
<field string="Variants" name="product_variant_count" widget="statinfo" />
|
||||
</button>
|
||||
</div>
|
||||
</field>
|
||||
|
@ -361,7 +376,7 @@
|
|||
<field name="product_variant_ids"/>
|
||||
</field>
|
||||
<h4 position="after">
|
||||
<a name="%(product.product_variant_action)d" type="action" t-if="!record.is_product_variant.raw_value & record.product_variant_count.raw_value>1">
|
||||
<a name="%(product.product_variant_action)d" type="action">
|
||||
<t t-esc="record.product_variant_count.value"/> Variants
|
||||
</a>
|
||||
</h4>
|
||||
|
|
|
@ -25,14 +25,13 @@
|
|||
</record>
|
||||
|
||||
<!-- Product -->
|
||||
<record id="product_normal_form_view" model="ir.ui.view">
|
||||
<field name="name">product.normal.form</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
||||
<record id="product_template_form_view" model="ir.ui.view">
|
||||
<field name="name">product.template.form</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_manager" position="after">
|
||||
<field name="intrastat_id"
|
||||
attrs="{'readonly': [('is_product_variant', '=', False)]}"/>
|
||||
<field name="intrastat_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -510,7 +510,11 @@ class Home(http.Controller):
|
|||
if request.session.uid:
|
||||
if kw.get('redirect'):
|
||||
return werkzeug.utils.redirect(kw.get('redirect'), 303)
|
||||
return request.render('web.webclient_bootstrap')
|
||||
if not request.uid:
|
||||
request.uid = request.session.uid
|
||||
|
||||
menu_data = request.registry['ir.ui.menu'].load_menus(request.cr, request.uid, context=request.context)
|
||||
return request.render('web.webclient_bootstrap', qcontext={'menu_data': menu_data})
|
||||
else:
|
||||
return login_redirect()
|
||||
|
||||
|
@ -892,70 +896,6 @@ class Session(http.Controller):
|
|||
|
||||
class Menu(http.Controller):
|
||||
|
||||
@http.route('/web/menu/get_user_roots', type='json', auth="user")
|
||||
def get_user_roots(self):
|
||||
""" Return all root menu ids visible for the session user.
|
||||
|
||||
:return: the root menu ids
|
||||
:rtype: list(int)
|
||||
"""
|
||||
s = request.session
|
||||
Menus = s.model('ir.ui.menu')
|
||||
menu_domain = [('parent_id', '=', False)]
|
||||
|
||||
return Menus.search(menu_domain, 0, False, False, request.context)
|
||||
|
||||
@http.route('/web/menu/load', type='json', auth="user")
|
||||
def load(self):
|
||||
""" Loads all menu items (all applications and their sub-menus).
|
||||
|
||||
:return: the menu root
|
||||
:rtype: dict('children': menu_nodes)
|
||||
"""
|
||||
Menus = request.session.model('ir.ui.menu')
|
||||
|
||||
fields = ['name', 'sequence', 'parent_id', 'action']
|
||||
menu_root_ids = self.get_user_roots()
|
||||
menu_roots = Menus.read(menu_root_ids, fields, request.context) if menu_root_ids else []
|
||||
menu_root = {
|
||||
'id': False,
|
||||
'name': 'root',
|
||||
'parent_id': [-1, ''],
|
||||
'children': menu_roots,
|
||||
'all_menu_ids': menu_root_ids,
|
||||
}
|
||||
if not menu_roots:
|
||||
return menu_root
|
||||
|
||||
# menus are loaded fully unlike a regular tree view, cause there are a
|
||||
# limited number of items (752 when all 6.1 addons are installed)
|
||||
menu_ids = Menus.search([('id', 'child_of', menu_root_ids)], 0, False, False, request.context)
|
||||
menu_items = Menus.read(menu_ids, fields, request.context)
|
||||
# adds roots at the end of the sequence, so that they will overwrite
|
||||
# equivalent menu items from full menu read when put into id:item
|
||||
# mapping, resulting in children being correctly set on the roots.
|
||||
menu_items.extend(menu_roots)
|
||||
menu_root['all_menu_ids'] = menu_ids # includes menu_root_ids!
|
||||
|
||||
# make a tree using parent_id
|
||||
menu_items_map = dict(
|
||||
(menu_item["id"], menu_item) for menu_item in menu_items)
|
||||
for menu_item in menu_items:
|
||||
if menu_item['parent_id']:
|
||||
parent = menu_item['parent_id'][0]
|
||||
else:
|
||||
parent = False
|
||||
if parent in menu_items_map:
|
||||
menu_items_map[parent].setdefault(
|
||||
'children', []).append(menu_item)
|
||||
|
||||
# sort by sequence a tree using parent_id
|
||||
for menu_item in menu_items:
|
||||
menu_item.setdefault('children', []).sort(
|
||||
key=operator.itemgetter('sequence'))
|
||||
|
||||
return menu_root
|
||||
|
||||
@http.route('/web/menu/load_needaction', type='json', auth="user")
|
||||
def load_needaction(self, menu_ids):
|
||||
""" Loads needaction counters for specific menu ids.
|
||||
|
|
|
@ -366,7 +366,6 @@
|
|||
|
||||
// change - shortcut for .bind("change", handler) or .trigger("change")
|
||||
fn.change = function change(handler) {
|
||||
console.log('change test');
|
||||
var $this = $(this);
|
||||
return handler ? $this.bind(CHANGE, handler) : $this.trigger(CHANGE);
|
||||
};
|
||||
|
|
|
@ -20,6 +20,25 @@
|
|||
font-style: normal;
|
||||
}
|
||||
|
||||
#oe_main_menu_navbar {
|
||||
min-height: 34px;
|
||||
z-index: 1001;
|
||||
border-radius: 0;
|
||||
}
|
||||
#oe_main_menu_navbar li a, #oe_main_menu_navbar li button {
|
||||
padding: 4px 8px 4px 8px;
|
||||
margin-top: 2px;
|
||||
font-size: 13px;
|
||||
}
|
||||
#oe_main_menu_navbar .oe_topbar_avatar {
|
||||
max-height: 18px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#oe_main_menu_navbar.navbar {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.openerp {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
@ -32,7 +51,12 @@
|
|||
*/
|
||||
}
|
||||
.openerp.openerp_webclient_container {
|
||||
height: 100%;
|
||||
height: calc(100% - 34px);
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.openerp.openerp_webclient_container {
|
||||
height: calc(100% - 52px);
|
||||
}
|
||||
}
|
||||
.openerp :-moz-placeholder {
|
||||
color: #afafb6 !important;
|
||||
|
@ -461,7 +485,7 @@
|
|||
background-image: -webkit-radial-gradient(circle, #eeeeee 0%, #cccccc 40%, #bbbbbb 100%);
|
||||
background-image: -moz-radial-gradient(#eeeeee 0%, #cccccc 40%, #bbbbbb 100%);
|
||||
background-image: -ms-radial-gradient(#eeeeee 0%, #cccccc 40%, #bbbbbb 100%);
|
||||
background-image: radial-gradient(#eeeeee 0%, #cccccc 40%, #bbbbbb 100%);
|
||||
background-image: radial-gradient(circle, #eeeeee 0%, #cccccc 40%, #bbbbbb 100%);
|
||||
}
|
||||
.openerp .oe_kanban_status_green {
|
||||
background: green;
|
||||
|
@ -469,7 +493,7 @@
|
|||
background-image: -webkit-radial-gradient(circle, #55dd55 0%, #44aa44 40%, #339933 100%);
|
||||
background-image: -moz-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%);
|
||||
background-image: -ms-radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%);
|
||||
background-image: radial-gradient(#55dd55 0%, #44aa44 40%, #339933 100%);
|
||||
background-image: radial-gradient(circle, #55dd55 0%, #44aa44 40%, #339933 100%);
|
||||
}
|
||||
.openerp .oe_kanban_status_red {
|
||||
background: red;
|
||||
|
@ -477,7 +501,7 @@
|
|||
background-image: -webkit-radial-gradient(circle, #ee7777 0%, #cc3333 40%, #bb0808 100%);
|
||||
background-image: -moz-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%);
|
||||
background-image: -ms-radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%);
|
||||
background-image: radial-gradient(#ee7777 0%, #cc3333 40%, #bb0808 100%);
|
||||
background-image: radial-gradient(circle, #ee7777 0%, #cc3333 40%, #bb0808 100%);
|
||||
}
|
||||
.openerp .btn-group.kanban_state {
|
||||
padding-top: 8px;
|
||||
|
@ -822,7 +846,7 @@
|
|||
background-image: -moz-linear-gradient(top, #fc8787, maroon);
|
||||
background-image: -ms-linear-gradient(top, #fc8787, maroon);
|
||||
background-image: -o-linear-gradient(top, #fc8787, maroon);
|
||||
background-image: linear-gradient(to bottom, #fc8787, maroon);
|
||||
background-image: linear-gradient(to bottom, #fc8787, #800000);
|
||||
}
|
||||
.openerp .navbar .oe_topbar_anonymous_login a {
|
||||
display: block;
|
||||
|
@ -925,49 +949,8 @@
|
|||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
.openerp .navbar-nav {
|
||||
float: left;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
}
|
||||
.openerp .navbar-nav > li {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
float: left;
|
||||
display: block;
|
||||
color: #eeeeee;
|
||||
}
|
||||
.openerp .navbar-nav > li > a {
|
||||
display: block;
|
||||
padding: 5px 10px 26px !important;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
text-decoration: none;
|
||||
color: #eeeeee !important;
|
||||
vertical-align: top;
|
||||
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||
-webkit-transition: all 0.2s ease-out;
|
||||
-moz-transition: all 0.2s ease-out;
|
||||
-ms-transition: all 0.2s ease-out;
|
||||
-o-transition: all 0.2s ease-out;
|
||||
transition: all 0.2s ease-out;
|
||||
}
|
||||
.openerp .navbar-nav > li > a:hover {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
text-shadow: black 0px 0px 3px;
|
||||
color: white;
|
||||
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset;
|
||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset;
|
||||
}
|
||||
.openerp .navbar-nav > li > .active {
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
text-shadow: black 0px 0px 3px;
|
||||
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset;
|
||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset;
|
||||
.openerp .nav li a {
|
||||
padding: 6px 8px 4px 8px;
|
||||
}
|
||||
.openerp .oe_user_menu {
|
||||
float: right;
|
||||
|
@ -981,13 +964,6 @@
|
|||
.openerp .oe_user_menu .oe_dropdown_menu {
|
||||
right: -1px;
|
||||
}
|
||||
.openerp .oe_systray > div {
|
||||
float: left;
|
||||
padding: 0 4px 0 4px;
|
||||
}
|
||||
.openerp .oe_systray {
|
||||
float: right;
|
||||
}
|
||||
.openerp .oe_leftbar {
|
||||
display: none;
|
||||
width: 220px;
|
||||
|
@ -3018,34 +2994,6 @@
|
|||
font-size: 95%;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
.openerp .navbar {
|
||||
min-height: 32px;
|
||||
margin-bottom: 0px;
|
||||
border: none;
|
||||
z-index: 1;
|
||||
position: static;
|
||||
background-color: #414141;
|
||||
background-color: #454343;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626));
|
||||
background-image: -webkit-linear-gradient(top, #646060, #262626);
|
||||
background-image: -moz-linear-gradient(top, #646060, #262626);
|
||||
background-image: -ms-linear-gradient(top, #646060, #262626);
|
||||
background-image: -o-linear-gradient(top, #646060, #262626);
|
||||
background-image: linear-gradient(to bottom, #646060, #262626);
|
||||
}
|
||||
.openerp .navbar-default .navbar-nav li a:hover, .openerp .navbar-default .navbar-nav li a:focus {
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.openerp .navbar-default .navbar-nav .open > a, .openerp .navbar-default .navbar-nav a:hover, .openerp .navbar-default .navbar-nav a:focus {
|
||||
background: rgba(0, 0, 0, 0.3) !important;
|
||||
}
|
||||
.openerp .navbar-default .navbar-nav .dropdown > a .caret {
|
||||
border-top-color: #777777 !important;
|
||||
border-bottom-color: #777777 !important;
|
||||
}
|
||||
.openerp .navbar-nav li a {
|
||||
padding: 4px 32px 4px 12px;
|
||||
}
|
||||
.openerp .oe_navbar .dropdown-menu {
|
||||
font-size: 13px;
|
||||
padding: 4px 0;
|
||||
|
@ -3075,11 +3023,11 @@
|
|||
.openerp .oe_view_manager_new .oe_form_nosheet .oe_form_label {
|
||||
font-weight: normal;
|
||||
}
|
||||
.openerp .nav li > a {
|
||||
padding: 3px 4px 2px 18px;
|
||||
.openerp .nav-pills li > a {
|
||||
padding: 6px 4px 2px 18px;
|
||||
color: #4c4c4c;
|
||||
}
|
||||
.openerp .nav nav-pills.nav-stacked > li > ul {
|
||||
.openerp .nav-pills .nav-stacked > li > ul {
|
||||
padding-left: 16px;
|
||||
}
|
||||
.openerp .nav-pills > li.active > a, .openerp a.list-group-item.active > a {
|
||||
|
|
|
@ -55,7 +55,7 @@ $sheet-padding: 16px
|
|||
background-image: -webkit-radial-gradient(circle, $gradient)
|
||||
background-image: -moz-radial-gradient($gradient)
|
||||
background-image: -ms-radial-gradient($gradient)
|
||||
background-image: radial-gradient($gradient)
|
||||
background-image: radial-gradient(circle, $gradient)
|
||||
|
||||
@mixin radius($radius: 5px)
|
||||
-moz-border-radius: $radius
|
||||
|
@ -143,6 +143,21 @@ $sheet-padding: 16px
|
|||
|
||||
// }}}
|
||||
|
||||
#oe_main_menu_navbar
|
||||
min-height: 34px
|
||||
z-index: 1001
|
||||
border-radius: 0
|
||||
li a, li button
|
||||
padding: 4px 8px 4px 8px
|
||||
margin-top: 2px
|
||||
font-size: 13px
|
||||
.oe_topbar_avatar
|
||||
max-height: 18px
|
||||
width: auto
|
||||
|
||||
#oe_main_menu_navbar.navbar
|
||||
margin-bottom: 0px
|
||||
|
||||
.openerp
|
||||
// Global style {{{
|
||||
padding: 0
|
||||
|
@ -152,7 +167,10 @@ $sheet-padding: 16px
|
|||
font-size: 13px
|
||||
background: white
|
||||
&.openerp_webclient_container
|
||||
height: 100%
|
||||
height: calc(100% - 34px)
|
||||
@media (max-width: 768px)
|
||||
&.openerp_webclient_container
|
||||
height: calc(100% - 52px)
|
||||
// }}}
|
||||
//Placeholder style{{{
|
||||
\:-moz-placeholder
|
||||
|
@ -713,7 +731,6 @@ $sheet-padding: 16px
|
|||
display: none
|
||||
// }}}
|
||||
// Top Menu {{{
|
||||
|
||||
.navbar
|
||||
.oe_topbar_anonymous_login
|
||||
background-color: #dc5f59
|
||||
|
@ -788,37 +805,8 @@ $sheet-padding: 16px
|
|||
// So why aren't the buttons oe_topbar_items ? This sad state of affairs
|
||||
// is a leftover from an uncomplete refactoring when the left and top menu
|
||||
// were merged. You are welcome to refactor and clean this up
|
||||
.navbar-nav
|
||||
float: left
|
||||
padding: 0
|
||||
margin: 0
|
||||
font-size: 13px
|
||||
> li
|
||||
list-style-type: none
|
||||
padding: 0
|
||||
margin: 0
|
||||
float: left
|
||||
display: block
|
||||
color: #eeeeee
|
||||
> a
|
||||
display: block
|
||||
padding: 5px 10px 26px !important
|
||||
line-height: 20px
|
||||
height: 20px
|
||||
text-decoration: none
|
||||
color: #eee !important
|
||||
vertical-align: top
|
||||
text-shadow: 0 1px 1px rgba(0,0,0,0.2)
|
||||
@include transition(all 0.2s ease-out)
|
||||
&:hover
|
||||
background: rgba(0,0,0,0.2)
|
||||
text-shadow: black 0px 0px 3px
|
||||
color: white
|
||||
@include box-shadow(0 1px 2px rgba(0,0,0,0.4) inset)
|
||||
> .active
|
||||
background: rgba(0,0,0,0.30)
|
||||
text-shadow: black 0px 0px 3px
|
||||
@include box-shadow(0 1px 2px rgba(0,0,0,0.4) inset)
|
||||
.nav li a
|
||||
padding: 6px 8px 4px 8px
|
||||
|
||||
.oe_user_menu
|
||||
float: right
|
||||
|
@ -830,12 +818,6 @@ $sheet-padding: 16px
|
|||
.oe_dropdown_menu
|
||||
right: -1px
|
||||
|
||||
.oe_systray > div
|
||||
float: left
|
||||
padding: 0 4px 0 4px
|
||||
.oe_systray
|
||||
float: right
|
||||
|
||||
// }}}
|
||||
// Webclient.leftbar {{{
|
||||
.oe_leftbar
|
||||
|
@ -2429,28 +2411,6 @@ $sheet-padding: 16px
|
|||
line-height: 1.2em
|
||||
// }}}
|
||||
// Bootstrap HACKS {{{
|
||||
.navbar
|
||||
min-height: 32px
|
||||
margin-bottom: 0px
|
||||
border: none
|
||||
z-index: 1
|
||||
position: static
|
||||
background-color: #414141
|
||||
@include vertical-gradient(#646060, #262626)
|
||||
.navbar-default
|
||||
.navbar-nav
|
||||
li
|
||||
a:hover,a:focus
|
||||
background: rgba(0, 0, 0, 0.3)
|
||||
.open > a,a:hover,a:focus
|
||||
background: rgba(0, 0, 0, 0.3) !important
|
||||
.dropdown > a .caret
|
||||
border-top-color: #777 !important
|
||||
border-bottom-color: #777 !important
|
||||
.navbar-nav
|
||||
li
|
||||
a
|
||||
padding: 4px 32px 4px 12px
|
||||
.oe_navbar .dropdown-menu
|
||||
font-size: 13px
|
||||
padding: 4px 0
|
||||
|
@ -2473,11 +2433,11 @@ $sheet-padding: 16px
|
|||
font-weight: normal
|
||||
|
||||
// Customize bootstrap3 for leftbar
|
||||
.nav
|
||||
.nav-pills
|
||||
li > a
|
||||
padding: 3px 4px 2px 18px
|
||||
padding: 6px 4px 2px 18px
|
||||
color: #4c4c4c
|
||||
nav-pills.nav-stacked > li > ul
|
||||
.nav-stacked > li > ul
|
||||
padding-left: 16px
|
||||
.nav-pills > li.active,a.list-group-item.active
|
||||
> a
|
||||
|
|
|
@ -734,51 +734,52 @@ instance.web.ChangePassword = instance.web.Widget.extend({
|
|||
instance.web.client_actions.add("change_password", "instance.web.ChangePassword");
|
||||
|
||||
instance.web.Menu = instance.web.Widget.extend({
|
||||
template: 'Menu',
|
||||
init: function() {
|
||||
var self = this;
|
||||
this._super.apply(this, arguments);
|
||||
this.has_been_loaded = $.Deferred();
|
||||
this.is_bound = $.Deferred();
|
||||
this.maximum_visible_links = 'auto'; // # of menu to show. 0 = do not crop, 'auto' = algo
|
||||
this.data = {data:{children:[]}};
|
||||
this.on("menu_loaded", this, function (menu_data) {
|
||||
self.reflow();
|
||||
this.on("menu_bound", this, function() {
|
||||
// launch the fetch of needaction counters, asynchronous
|
||||
if (!_.isEmpty(menu_data.all_menu_ids)) {
|
||||
this.do_load_needaction(menu_data.all_menu_ids);
|
||||
var $all_menus = self.$el.parents('body').find('.oe_webclient').find('[data-menu]');
|
||||
var all_menu_ids = _.map($all_menus, function (menu) {return parseInt($(menu).attr('data-menu'), 10);});
|
||||
if (!_.isEmpty(all_menu_ids)) {
|
||||
this.do_load_needaction(all_menu_ids);
|
||||
}
|
||||
});
|
||||
var lazyreflow = _.debounce(this.reflow.bind(this), 200);
|
||||
instance.web.bus.on('resize', this, function() {
|
||||
self.$el.height(0);
|
||||
lazyreflow();
|
||||
});
|
||||
},
|
||||
start: function() {
|
||||
this._super.apply(this, arguments);
|
||||
this.$secondary_menus = this.getParent().$el.find('.oe_secondary_menus_container');
|
||||
this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click);
|
||||
return this.do_reload();
|
||||
return this.bind_menu();
|
||||
},
|
||||
do_reload: function() {
|
||||
var self = this;
|
||||
return this.rpc("/web/menu/load", {}).done(function(r) {
|
||||
self.menu_loaded(r);
|
||||
});
|
||||
self.bind_menu();
|
||||
},
|
||||
menu_loaded: function(data) {
|
||||
bind_menu: function() {
|
||||
var self = this;
|
||||
this.data = {data: data};
|
||||
this.renderElement();
|
||||
this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this }));
|
||||
this.$secondary_menus = this.$el.parents().find('.oe_secondary_menus_container')
|
||||
this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click);
|
||||
this.$el.on('click', 'a[data-menu]', this.on_top_menu_click);
|
||||
// Hide second level submenus
|
||||
this.$secondary_menus.find('.oe_menu_toggler').siblings('.oe_secondary_submenu').hide();
|
||||
if (self.current_menu) {
|
||||
self.open_menu(self.current_menu);
|
||||
}
|
||||
this.trigger('menu_loaded', data);
|
||||
this.has_been_loaded.resolve();
|
||||
this.trigger('menu_bound');
|
||||
|
||||
var lazyreflow = _.debounce(this.reflow.bind(this), 200);
|
||||
instance.web.bus.on('resize', this, function() {
|
||||
if (parseInt(self.$el.parent().css('width')) <= 768 ) {
|
||||
lazyreflow('all_outside');
|
||||
} else {
|
||||
lazyreflow();
|
||||
}
|
||||
});
|
||||
instance.web.bus.trigger('resize');
|
||||
|
||||
this.is_bound.resolve();
|
||||
},
|
||||
do_load_needaction: function (menu_ids) {
|
||||
var self = this;
|
||||
|
@ -803,30 +804,48 @@ instance.web.Menu = instance.web.Widget.extend({
|
|||
},
|
||||
/**
|
||||
* Reflow the menu items and dock overflowing items into a "More" menu item.
|
||||
* Automatically called when 'menu_loaded' event is triggered and on window resizing.
|
||||
* Automatically called when 'menu_bound' event is triggered and on window resizing.
|
||||
*
|
||||
* @param {string} behavior If set to 'all_outside', all the items are displayed. If set to
|
||||
* 'all_inside', all the items are hidden under the more item. If not set, only the
|
||||
* overflowing items are hidden.
|
||||
*/
|
||||
reflow: function() {
|
||||
reflow: function(behavior) {
|
||||
var self = this;
|
||||
this.$el.height('auto').show();
|
||||
var $more_container = this.$('#menu_more_container').hide();
|
||||
var $more = this.$('#menu_more');
|
||||
$more.children('li').insertBefore($more_container);
|
||||
var $toplevel_items = this.$el.children('li').not($more_container).hide();
|
||||
var $systray = this.$el.parents().find('.oe_systray');
|
||||
|
||||
$more.children('li').insertBefore($more_container); // Pull all the items out of the more menu
|
||||
|
||||
// 'all_outside' beahavior should display all the items, so hide the more menu and exit
|
||||
if (behavior === 'all_outside') {
|
||||
this.$el.find('li').show();
|
||||
$more_container.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
var $toplevel_items = this.$el.find('li').not($more_container).not($systray.find('li')).hide();
|
||||
$toplevel_items.each(function() {
|
||||
// In all inside mode, we do not compute to know if we must hide the items, we hide them all
|
||||
if (behavior === 'all_inside') {
|
||||
return false;
|
||||
}
|
||||
var remaining_space = self.$el.parent().width() - $more_container.outerWidth();
|
||||
self.$el.parent().children(':visible').each(function() {
|
||||
remaining_space -= $(this).outerWidth();
|
||||
});
|
||||
|
||||
if ($(this).width() > remaining_space) {
|
||||
return false;
|
||||
}
|
||||
$(this).show();
|
||||
});
|
||||
$more.append($toplevel_items.filter(':hidden').show());
|
||||
$more_container.toggle(!!$more.children().length);
|
||||
$more_container.toggle(!!$more.children().length || behavior === 'all_inside');
|
||||
// Hide toplevel item if there is only one
|
||||
var $toplevel = this.$el.children("li:visible");
|
||||
if ($toplevel.length === 1) {
|
||||
if ($toplevel.length === 1 && behavior != 'all_inside') {
|
||||
$toplevel.hide();
|
||||
}
|
||||
},
|
||||
|
@ -853,7 +872,7 @@ instance.web.Menu = instance.web.Widget.extend({
|
|||
|
||||
// Activate current main menu
|
||||
this.$el.find('.active').removeClass('active');
|
||||
$main_menu.addClass('active');
|
||||
$main_menu.parent().addClass('active');
|
||||
|
||||
// Show current sub menu
|
||||
this.$secondary_menus.find('.oe_secondary_menu').hide();
|
||||
|
@ -939,22 +958,19 @@ instance.web.Menu = instance.web.Widget.extend({
|
|||
* @param {Event} ev the jquery event
|
||||
*/
|
||||
on_top_menu_click: function(ev) {
|
||||
ev.preventDefault();
|
||||
var self = this;
|
||||
var id = $(ev.currentTarget).data('menu');
|
||||
var menu_ids = [id];
|
||||
var menu = _.filter(this.data.data.children, function (menu) {return menu.id == id;})[0];
|
||||
function add_menu_ids (menu) {
|
||||
if (menu.children) {
|
||||
_.each(menu.children, function (menu) {
|
||||
menu_ids.push(menu.id);
|
||||
add_menu_ids(menu);
|
||||
});
|
||||
}
|
||||
}
|
||||
add_menu_ids(menu);
|
||||
|
||||
// Fetch the menu leaves ids in order to check if they need a 'needaction'
|
||||
var $secondary_menu = this.$el.parents().find('.oe_secondary_menu[data-menu-parent=' + id + ']');
|
||||
var $menu_leaves = $secondary_menu.children().find('.oe_menu_leaf');
|
||||
var menu_ids = _.map($menu_leaves, function (leave) {return parseInt($(leave).attr('data-menu'), 10);});
|
||||
|
||||
self.do_load_needaction(menu_ids).then(function () {
|
||||
self.trigger("need_action_reloaded");
|
||||
});
|
||||
|
||||
this.on_menu_click(ev);
|
||||
},
|
||||
on_menu_click: function(ev) {
|
||||
|
@ -980,6 +996,7 @@ instance.web.UserMenu = instance.web.Widget.extend({
|
|||
f($(this));
|
||||
}
|
||||
});
|
||||
this.$el.parent().show()
|
||||
},
|
||||
do_update: function () {
|
||||
var self = this;
|
||||
|
@ -1001,6 +1018,8 @@ instance.web.UserMenu = instance.web.Widget.extend({
|
|||
}
|
||||
var avatar_src = self.session.url('/web/binary/image', {model:'res.users', field: 'image_small', id: self.session.uid});
|
||||
$avatar.attr('src', avatar_src);
|
||||
|
||||
openerp.web.bus.trigger('resize'); // Re-trigger the reflow logic
|
||||
});
|
||||
};
|
||||
this.update_promise = this.update_promise.then(fct, fct);
|
||||
|
@ -1086,15 +1105,13 @@ instance.web.Client = instance.web.Widget.extend({
|
|||
start: function() {
|
||||
var self = this;
|
||||
return instance.session.session_bind(this.origin).then(function() {
|
||||
var $e = $(QWeb.render(self._template, {widget: self}));
|
||||
self.replaceElement($e);
|
||||
$e.openerpClass();
|
||||
self.bind_events();
|
||||
return self.show_common();
|
||||
});
|
||||
},
|
||||
bind_events: function() {
|
||||
var self = this;
|
||||
$('.oe_systray').show();
|
||||
this.$el.on('mouseenter', '.oe_systray > div:not([data-toggle=tooltip])', function() {
|
||||
$(this).attr('data-toggle', 'tooltip').tooltip().trigger('mouseenter');
|
||||
});
|
||||
|
@ -1146,10 +1163,6 @@ instance.web.Client = instance.web.Widget.extend({
|
|||
});
|
||||
|
||||
instance.web.WebClient = instance.web.Client.extend({
|
||||
_template: 'WebClient',
|
||||
events: {
|
||||
'click .oe_logo_edit_admin': 'logo_edit'
|
||||
},
|
||||
init: function(parent, client_options) {
|
||||
this._super(parent);
|
||||
if (client_options) {
|
||||
|
@ -1164,6 +1177,7 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
var self = this;
|
||||
this.on("change:title_part", this, this._title_changed);
|
||||
this._title_changed();
|
||||
|
||||
return $.when(this._super()).then(function() {
|
||||
if (jQuery.deparam !== undefined && jQuery.deparam(jQuery.param.querystring()).kitten !== undefined) {
|
||||
self.to_kitten();
|
||||
|
@ -1227,12 +1241,19 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
show_application: function() {
|
||||
var self = this;
|
||||
self.toggle_bars(true);
|
||||
|
||||
self.update_logo();
|
||||
this.$('.oe_logo_edit_admin').click(function(ev) {
|
||||
self.logo_edit(ev);
|
||||
});
|
||||
|
||||
// Menu is rendered server-side thus we don't want the widget to create any dom
|
||||
self.menu = new instance.web.Menu(self);
|
||||
self.menu.replace(this.$el.find('.oe_menu_placeholder'));
|
||||
self.menu.setElement(this.$el.parents().find('.oe_application_menu_placeholder'));
|
||||
self.menu.start();
|
||||
self.menu.on('menu_click', this, this.on_menu_action);
|
||||
self.user_menu = new instance.web.UserMenu(self);
|
||||
self.user_menu.replace(this.$el.find('.oe_user_menu_placeholder'));
|
||||
self.user_menu.appendTo(this.$el.parents().find('.oe_user_menu_placeholder'));
|
||||
self.user_menu.on('user_logout', self, self.on_logout);
|
||||
self.user_menu.do_update();
|
||||
self.bind_hashchange();
|
||||
|
@ -1250,6 +1271,7 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
},
|
||||
logo_edit: function(ev) {
|
||||
var self = this;
|
||||
ev.preventDefault();
|
||||
self.alive(new instance.web.Model("res.users").get_func("read")(this.session.uid, ["company_id"])).then(function(res) {
|
||||
self.rpc("/web/action/load", { action_id: "base.action_res_company_form" }).done(function(result) {
|
||||
result.res_id = res['company_id'][0];
|
||||
|
@ -1294,7 +1316,7 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
return false;
|
||||
});
|
||||
});
|
||||
$icon.appendTo(self.$('.oe_systray'));
|
||||
$icon.prependTo(window.$('.oe_systray'));
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -1309,7 +1331,6 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
return this.session.session_reload().then(function () {
|
||||
instance.session.load_modules(true).then(
|
||||
self.menu.proxy('do_reload')); });
|
||||
|
||||
},
|
||||
do_notify: function() {
|
||||
var n = this.notification;
|
||||
|
@ -1331,15 +1352,16 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
|
||||
var state = $.bbq.getState(true);
|
||||
if (_.isEmpty(state) || state.action == "login") {
|
||||
self.menu.has_been_loaded.done(function() {
|
||||
self.menu.is_bound.done(function() {
|
||||
new instance.web.Model("res.users").call("read", [self.session.uid, ["action_id"]]).done(function(data) {
|
||||
if(data.action_id) {
|
||||
self.action_manager.do_action(data.action_id[0]);
|
||||
self.menu.open_action(data.action_id[0]);
|
||||
} else {
|
||||
var first_menu_id = self.menu.$el.find("a:first").data("menu");
|
||||
if(first_menu_id)
|
||||
if(first_menu_id) {
|
||||
self.menu.menu_click(first_menu_id);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1353,10 +1375,9 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
if (!_.isEqual(this._current_state, stringstate)) {
|
||||
var state = event.getState(true);
|
||||
if(!state.action && state.menu_id) {
|
||||
self.menu.has_been_loaded.done(function() {
|
||||
self.menu.do_reload().done(function() {
|
||||
self.menu.menu_click(state.menu_id);
|
||||
});
|
||||
self.menu.is_bound.done(function() {
|
||||
self.menu.do_reload();
|
||||
self.menu.menu_click(state.menu_id);
|
||||
});
|
||||
} else {
|
||||
state._push_me = false; // no need to push state back...
|
||||
|
|
|
@ -271,7 +271,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
|||
}
|
||||
action_loaded = this.do_action(state.action, { additional_context: add_context });
|
||||
$.when(action_loaded || null).done(function() {
|
||||
instance.webclient.menu.has_been_loaded.done(function() {
|
||||
instance.webclient.menu.is_bound.done(function() {
|
||||
if (self.inner_action && self.inner_action.id) {
|
||||
instance.webclient.menu.open_action(self.inner_action.id);
|
||||
}
|
||||
|
|
|
@ -294,9 +294,9 @@
|
|||
</div>
|
||||
</t>
|
||||
<t t-name="DatabaseManager.user_menu">
|
||||
<span class="oe_right">
|
||||
<a id="back-to-login" href="#"><span class="oe_topbar_item oe_topbar_name">Back to Login</span></a>
|
||||
</span>
|
||||
<li>
|
||||
<a id="back-to-login" href="#">Back to Login</a>
|
||||
</li>
|
||||
</t>
|
||||
<t t-name="DatabaseManager.menu">
|
||||
<div class="oe_secondary_menu_section">Database Management</div>
|
||||
|
@ -341,52 +341,6 @@
|
|||
</form>
|
||||
</t>
|
||||
|
||||
<t t-name="Menu">
|
||||
<ul class="nav navbar-nav navbar-left" t-if="widget.data">
|
||||
<li t-foreach="widget.data.data.children" t-as="menu">
|
||||
<t t-call="Menu.link"/>
|
||||
</li>
|
||||
<li id="menu_more_container" class="dropdown" style="display: none;">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a>
|
||||
<ul id="menu_more" class="dropdown-menu"></ul>
|
||||
</li>
|
||||
</ul>
|
||||
</t>
|
||||
<t t-name="Menu.secondary">
|
||||
<div t-foreach="widget.data.data.children" t-as="menu" style="display: none" class="oe_secondary_menu" t-att-data-menu-parent="menu.id">
|
||||
<t t-foreach="menu.children" t-as="menu">
|
||||
<div class="oe_secondary_menu_section">
|
||||
<t t-esc="menu.name"/>
|
||||
<!--
|
||||
Shall the section be still clickable ?
|
||||
<t t-call="Menu.link"/>
|
||||
-->
|
||||
</div>
|
||||
<t t-call="Menu.secondary.submenu"/>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="Menu.secondary.submenu">
|
||||
<ul t-if="menu.children.length" class="oe_secondary_submenu nav nav-pills nav-stacked">
|
||||
<li t-foreach="menu.children" t-as="menu">
|
||||
<t t-call="Menu.link"/>
|
||||
<!--<span class="oe_menu_label">8</span>-->
|
||||
<t t-call="Menu.secondary.submenu"/>
|
||||
</li>
|
||||
</ul>
|
||||
</t>
|
||||
<t t-name="Menu.link">
|
||||
<a t-attf-href="#menu_id=#{menu.id}&action=#{menu.action ? menu.action.split(',')[1] : ''}"
|
||||
t-att-class="menu.children.length ? 'oe_menu_toggler' : 'oe_menu_leaf'"
|
||||
t-att-data-menu="menu.id"
|
||||
t-att-data-action-model="menu.action ? menu.action.split(',')[0] : ''"
|
||||
t-att-data-action-id="menu.action ? menu.action.split(',')[1] : ''">
|
||||
<span class="oe_menu_text">
|
||||
<t t-esc="menu.name"/>
|
||||
</span>
|
||||
</a>
|
||||
</t>
|
||||
|
||||
<t t-name="Menu.needaction_counter">
|
||||
<div id="menu_counter" class="badge pull-right">
|
||||
<t t-if="widget.needaction_counter > 99"> 99+ </t>
|
||||
|
@ -395,7 +349,6 @@
|
|||
</t>
|
||||
|
||||
<t t-name="UserMenu">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<img class="oe_topbar_avatar" t-att-data-default-src="_s + '/web/static/src/img/user_menu_avatar.png'"/>
|
||||
|
@ -409,7 +362,6 @@
|
|||
<li><a href="#" data-menu="logout">Log out</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</t>
|
||||
<t t-name="UserMenu.about">
|
||||
|
||||
|
@ -428,40 +380,6 @@
|
|||
|
||||
</t>
|
||||
|
||||
<t t-name="WebClient">
|
||||
<div class="openerp openerp_webclient_container">
|
||||
<table class="oe_webclient">
|
||||
<tr>
|
||||
<td colspan="2" class="navbar navbar-default navbar-static-top oe_navbar" role="navigation">
|
||||
<div class="oe_menu_placeholder"/>
|
||||
<div class="oe_user_menu_placeholder"/>
|
||||
<div class="oe_systray"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="oe_leftbar" valign="top">
|
||||
<div>
|
||||
<t t-set="debug" t-value="__debug__ ? '&debug' : ''"/>
|
||||
<a class="oe_logo" t-attf-href="/web?#{debug}">
|
||||
<span class="oe_logo_edit">Edit Company data</span>
|
||||
<img t-att-src='widget.session.url("/web/binary/company_logo")'/>
|
||||
</a>
|
||||
<div>
|
||||
<div>
|
||||
<div class="oe_secondary_menus_container"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_footer">
|
||||
Powered by <a href="http://www.odoo.com" target="_blank"><span>Odoo</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="oe_application">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="WebClient.timezone_notification">
|
||||
<div class="oe_webclient_timezone_notification">
|
||||
<p>Your user's preference timezone does not match your browser timezone:</p>
|
||||
|
@ -477,9 +395,9 @@
|
|||
</div>
|
||||
</t>
|
||||
<t t-name="WebClient.timezone_systray">
|
||||
<div class="oe_topbar_item oe_timezone_systray" title="Timezone mismatch">
|
||||
<span class="ui-icon ui-state-error ui-icon-alert"/>
|
||||
</div>
|
||||
<li class="oe_topbar_item oe_timezone_systray" title="Timezone mismatch">
|
||||
<a href="#"><i class="fa fa-exclamation-triangle" style="color:red;"></i></a>
|
||||
</li>
|
||||
</t>
|
||||
|
||||
<t t-name="EmbedClient">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import test_js
|
||||
import test_menu
|
||||
# import test_menu
|
||||
import test_serving_base
|
||||
|
|
|
@ -10,15 +10,17 @@ from . import common
|
|||
|
||||
from ..controllers import main
|
||||
|
||||
|
||||
class Placeholder(object):
|
||||
def __init__(self, **kwargs):
|
||||
for k, v in kwargs.iteritems():
|
||||
setattr(self, k, v)
|
||||
|
||||
|
||||
class LoadTest(common.MockRequestCase):
|
||||
def setUp(self):
|
||||
super(LoadTest, self).setUp()
|
||||
self.menu = main.Menu()
|
||||
self.home = main.Home()
|
||||
|
||||
# Have self.request.session.model() return a different mock object for
|
||||
# each model (but always the same mock for a given model name)
|
||||
|
@ -32,17 +34,17 @@ class LoadTest(common.MockRequestCase):
|
|||
|
||||
def tearDown(self):
|
||||
del self.MockMenus
|
||||
del self.menu
|
||||
del self.home
|
||||
super(LoadTest, self).tearDown()
|
||||
|
||||
def test_empty(self):
|
||||
self.MockMenus.search.return_value = []
|
||||
self.MockMenus.read.return_value = []
|
||||
|
||||
root = self.menu.load()
|
||||
root = self.home.load_menus()
|
||||
|
||||
self.MockMenus.search.assert_called_with(
|
||||
[('parent_id','=', False)], 0, False, False,
|
||||
[('parent_id', '=', False)], 0, False, False,
|
||||
req.context)
|
||||
|
||||
self.assertEqual(root['all_menu_ids'], [])
|
||||
|
@ -59,10 +61,10 @@ class LoadTest(common.MockRequestCase):
|
|||
{'id': 2, 'sequence': 3, 'parent_id': False},
|
||||
]
|
||||
|
||||
root = self.menu.load()
|
||||
root = self.home.load_menus()
|
||||
|
||||
self.MockMenus.search.assert_called_with(
|
||||
[('id','child_of', [1, 2, 3])], 0, False, False,
|
||||
[('id', 'child_of', [1, 2, 3])], 0, False, False,
|
||||
req.context)
|
||||
|
||||
self.MockMenus.read.assert_called_with(
|
||||
|
@ -98,10 +100,10 @@ class LoadTest(common.MockRequestCase):
|
|||
{'id': 4, 'sequence': 2, 'parent_id': [2, '']},
|
||||
])
|
||||
|
||||
root = self.menu.load()
|
||||
root = self.home.load_menus()
|
||||
|
||||
self.MockMenus.search.assert_called_with(
|
||||
[('id','child_of', [1])], 0, False, False,
|
||||
[('id', 'child_of', [1])], 0, False, False,
|
||||
req.context)
|
||||
|
||||
self.assertEqual(root['all_menu_ids'], [1, 2, 3, 4])
|
||||
|
@ -131,9 +133,8 @@ class LoadTest(common.MockRequestCase):
|
|||
}]
|
||||
)
|
||||
|
||||
|
||||
class ActionMungerTest(unittest2.TestCase):
|
||||
def setUp(self):
|
||||
self.menu = main.Menu()
|
||||
def test_actual_treeview(self):
|
||||
action = {
|
||||
"views": [[False, "tree"], [False, "form"],
|
||||
|
@ -166,7 +167,6 @@ class ActionMungerTest(unittest2.TestCase):
|
|||
})
|
||||
|
||||
def test_redundant_views(self):
|
||||
|
||||
action = {
|
||||
"views": [[False, "tree"], [False, "form"],
|
||||
[False, "calendar"], [42, "tree"]],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html style="height: 100%">
|
||||
<html style="height: 100%;">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
|
@ -67,11 +67,51 @@
|
|||
$(function() {
|
||||
var s = new openerp.init({{ modules|safe }});
|
||||
var wc = new s.web.WebClient(null, { action: 'database_manager' });
|
||||
wc.appendTo($(document.body));
|
||||
wc.setElement($(document.body));
|
||||
wc.start();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<nav id="oe_main_menu_navbar" class="navbar navbar-inverse" role="navigation">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse" id="oe_main_menu_placeholder">
|
||||
<ul class="nav navbar-nav navbar-right oe_user_menu_placeholder"></ul>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="openerp openerp_webclient_container">
|
||||
<table class="oe_webclient">
|
||||
<tr>
|
||||
<td class="oe_leftbar" valign="top">
|
||||
<div>
|
||||
<a class="oe_logo">
|
||||
<span class="oe_logo_edit">Edit Company data</span>
|
||||
<img src='/web/binary/company_logo'/>
|
||||
</a>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<div class="oe_secondary_menus_container"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="oe_footer">
|
||||
Powered by <a href="http://www.odoo.com" target="_blank"><span>Odoo</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="oe_application">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
|
||||
<script>CFInstall.check({mode: "overlay"});</script>
|
||||
|
|
|
@ -134,6 +134,66 @@
|
|||
</html>
|
||||
</template>
|
||||
|
||||
<template id="web.menu">
|
||||
<ul class="nav navbar-nav navbar-left oe_application_menu_placeholder">
|
||||
<li t-foreach="menu_data['children']" t-as="menu">
|
||||
<t t-call="web.menu_link"/>
|
||||
</li>
|
||||
<li id="menu_more_container" class="dropdown" style="display: none;">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a>
|
||||
<ul id="menu_more" class="dropdown-menu"></ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right oe_user_menu_placeholder" style="display: none;"/>
|
||||
<ul class="nav navbar-nav navbar-right oe_systray" style="display: none;"/>
|
||||
</template>
|
||||
<template id="web.menu_secondary">
|
||||
<a class="oe_logo" t-att-href="'/web/?debug' if debug else '/web'">
|
||||
<span class="oe_logo_edit">Edit Company data</span>
|
||||
<img src='/web/binary/company_logo'/>
|
||||
</a>
|
||||
<div>
|
||||
<div>
|
||||
<div class="oe_secondary_menus_container">
|
||||
<t t-foreach="menu_data['children']" t-as="menu">
|
||||
<div style="display: none" class="oe_secondary_menu" t-att-data-menu-parent="menu['id']">
|
||||
<t t-foreach="menu['children']" t-as="menu">
|
||||
<div class="oe_secondary_menu_section">
|
||||
<t t-esc="menu['name']"/>
|
||||
</div>
|
||||
<t t-call="web.menu_secondary_submenu"/>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_footer">
|
||||
Powered by <a href="http://www.openerp.com" target="_blank"><span>Odoo</span></a>
|
||||
</div>
|
||||
</template>
|
||||
<template id="web.menu_secondary_submenu">
|
||||
<ul t-if="menu['children']" class="oe_secondary_submenu nav nav-pills nav-stacked">
|
||||
<li t-foreach="menu['children']" t-as="menu">
|
||||
<t t-call="web.menu_link"/>
|
||||
<t t-call="web.menu_secondary_submenu"/>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
<template id="web.menu_link">
|
||||
<t t-set="debug_param" t-value="'?&debug=' if debug else ''"/>
|
||||
<a t-att-href="'/web%s#menu_id=%s&action=%s' % (debug_param, menu['id'], menu['action'] and menu['action'].split(',')[1] or '')"
|
||||
t-att-class="'oe_menu_toggler' if menu['children'] else 'oe_menu_leaf'"
|
||||
t-att-data-menu="menu['id']"
|
||||
t-att-data-action-model="menu['action'] and menu['action'].split(',')[0] or ''"
|
||||
t-att-data-action-id="menu['action'] and menu['action'].split(',')[1] or ''">
|
||||
<span class="oe_menu_text">
|
||||
<t t-esc="menu['name']"/>
|
||||
</span>
|
||||
</a>
|
||||
</template>
|
||||
|
||||
<template id="web.webclient_bootstrap" name="Webclient Bootstrap">
|
||||
<t t-call="web.layout">
|
||||
<t t-set="head">
|
||||
|
@ -147,11 +207,37 @@
|
|||
</t>
|
||||
<t t-if="not init">
|
||||
var wc = new s.web.WebClient();
|
||||
wc.appendTo($(document.body));
|
||||
wc.setElement($(document.body));
|
||||
wc.start();
|
||||
</t>
|
||||
});
|
||||
</script>
|
||||
</t>
|
||||
|
||||
<nav id="oe_main_menu_navbar" class="navbar navbar-inverse" role="navigation">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse" id="oe_main_menu_placeholder">
|
||||
<t t-call="web.menu"/>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="openerp openerp_webclient_container">
|
||||
<table class="oe_webclient">
|
||||
<tr>
|
||||
<td class="oe_leftbar" valign="top">
|
||||
<div>
|
||||
<t t-call="web.menu_secondary"/>
|
||||
</div>
|
||||
</td>
|
||||
<td class="oe_application"/>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class web_linkedin_settings(osv.osv_memory):
|
|||
|
||||
def set_linkedin(self, cr, uid, ids, context=None):
|
||||
key = self.browse(cr, uid, ids[0], context)["api_key"] or ""
|
||||
self.pool.get("ir.config_parameter").set_param(cr, uid, "web.linkedin.apikey", key)
|
||||
self.pool.get("ir.config_parameter").set_param(cr, uid, "web.linkedin.apikey", key, groups=['base.group_users'])
|
||||
|
||||
class web_linkedin_fields(osv.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
|
|
@ -21,6 +21,7 @@ OpenERP Website CMS
|
|||
'views/themes.xml',
|
||||
'views/res_config.xml',
|
||||
'views/ir_actions.xml',
|
||||
'views/website_backend_navbar.xml',
|
||||
],
|
||||
'demo': [
|
||||
'data/demo.xml',
|
||||
|
|
|
@ -62,7 +62,7 @@ class ir_http(orm.AbstractModel):
|
|||
self.geo_ip_resolver = GeoIP.open('/usr/share/GeoIP/GeoIP.dat', GeoIP.GEOIP_STANDARD)
|
||||
except ImportError:
|
||||
self.geo_ip_resolver = False
|
||||
if self.geo_ip_resolver:
|
||||
if self.geo_ip_resolver and request.httprequest.remote_addr:
|
||||
record = self.geo_ip_resolver.record_by_addr(request.httprequest.remote_addr) or {}
|
||||
request.session['geoip'] = record
|
||||
|
||||
|
|
|
@ -151,6 +151,7 @@ class view(osv.osv):
|
|||
user_id=self.pool.get("res.users").browse(cr, uid, uid),
|
||||
translatable=context.get('lang') != request.website.default_lang_code,
|
||||
editable=request.website.is_publisher(),
|
||||
menu_data=self.pool['ir.ui.menu'].load_menus(cr, uid, context=context) if request.website.is_user() else None,
|
||||
)
|
||||
|
||||
# add some values
|
||||
|
|
|
@ -243,6 +243,9 @@ class website(osv.osv):
|
|||
is_website_publisher = Access.check(cr, uid, 'ir.ui.view', 'write', False, context)
|
||||
return is_website_publisher
|
||||
|
||||
def is_user(self, cr, uid, ids, context=None):
|
||||
return self.pool['res.users'].has_group(cr, request.uid, 'base.group_user')
|
||||
|
||||
def get_template(self, cr, uid, ids, template, context=None):
|
||||
if isinstance(template, (int, long)):
|
||||
view_id = template
|
||||
|
|
|
@ -29,6 +29,24 @@
|
|||
-ms-filter: "alpha(opacity=50)";
|
||||
}
|
||||
|
||||
#cke_1_top {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#cke_wrapwrap {
|
||||
-moz-box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
#cke_wrapwrap .cke_button {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
#cke_wrapwrap .cke_combo_button {
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
|
||||
/* ---- OpenERP Style ---- {{{ */
|
||||
.oe_website_editorbar {
|
||||
position: fixed;
|
||||
|
@ -115,6 +133,26 @@
|
|||
height: 16px !important;
|
||||
}
|
||||
|
||||
#website-top-edit {
|
||||
width: 100%;
|
||||
}
|
||||
#website-top-edit > ul > li {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#website-top-navbar {
|
||||
min-height: 34px;
|
||||
height: 34px;
|
||||
}
|
||||
#website-top-navbar form {
|
||||
margin: 0;
|
||||
}
|
||||
#website-top-navbar form button, #website-top-navbar form a {
|
||||
padding: 4px 8px 4px 8px;
|
||||
margin-top: 2px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* ---- EDITOR BAR ---- {{{ */
|
||||
table.editorbar-panel {
|
||||
cursor: pointer;
|
||||
|
@ -470,7 +508,7 @@ ul.oe_menu_editor .disclose {
|
|||
.oe_ace_view_editor {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
z-index: 1001;
|
||||
height: 100%;
|
||||
background: #2f3129;
|
||||
color: white;
|
||||
|
|
|
@ -25,6 +25,20 @@
|
|||
+box-shadow(none)
|
||||
-ms-filter: "alpha(opacity=50)"
|
||||
|
||||
#cke_1_top
|
||||
padding: 0
|
||||
|
||||
#cke_wrapwrap
|
||||
-moz-box-shadow: none
|
||||
-webkit-box-shadow: none
|
||||
box-shadow: none
|
||||
.cke_button
|
||||
padding-top: 5px
|
||||
padding-bottom: 5px
|
||||
.cke_combo_button
|
||||
padding-top: 1px
|
||||
padding-bottom: 1px
|
||||
|
||||
// }}}
|
||||
|
||||
/* ---- OpenERP Style ---- {{{ */
|
||||
|
@ -93,6 +107,21 @@
|
|||
background-image: none !important
|
||||
height: 16px !important
|
||||
|
||||
#website-top-edit
|
||||
width: 100%
|
||||
> ul > li
|
||||
margin: 0
|
||||
|
||||
#website-top-navbar
|
||||
min-height: 34px
|
||||
height: 34px
|
||||
form
|
||||
margin: 0
|
||||
button, a
|
||||
padding: 4px 8px 4px 8px
|
||||
margin-top: 2px
|
||||
font-size: 13px
|
||||
|
||||
// }}}
|
||||
|
||||
/* ---- EDITOR BAR ---- {{{ */
|
||||
|
@ -415,7 +444,7 @@ $infobar_height: 20px
|
|||
position: fixed
|
||||
// top property is set programmatically
|
||||
right: 0
|
||||
z-index: 1000
|
||||
z-index: 1001
|
||||
height: 100%
|
||||
background: #2F3129
|
||||
color: white
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
/* ---- SNIPPET EDITOR ---- {{{ */
|
||||
#oe_snippets {
|
||||
position: fixed;
|
||||
top: 34px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
padding-top: 6px;
|
||||
background: #282828;
|
||||
-webkit-box-shadow: 0px 10px 10px -10px black inset;
|
||||
-moz-box-shadow: 0px 10px 10px -10px black inset;
|
||||
|
|
|
@ -7,8 +7,10 @@
|
|||
|
||||
#oe_snippets
|
||||
position: fixed
|
||||
top: 34px
|
||||
left: 0px
|
||||
right: 0px
|
||||
padding-top: 6px
|
||||
// top property is set programmatically
|
||||
background: rgb(40,40,40)
|
||||
+box-shadow(0px 10px 10px -10px black inset)
|
||||
|
|
|
@ -120,8 +120,27 @@ header a.navbar-brand img {
|
|||
}
|
||||
|
||||
/* ----- EDITOR ----- */
|
||||
#oe_main_menu_navbar {
|
||||
min-height: 34px;
|
||||
z-index: 1001;
|
||||
-webkit-border-radius: 0px;
|
||||
-moz-border-radius: 0px;
|
||||
-ms-border-radius: 0px;
|
||||
-o-border-radius: 0px;
|
||||
border-radius: 0px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
#oe_main_menu_navbar li a, #oe_main_menu_navbar li button {
|
||||
padding: 4px 8px 4px 8px;
|
||||
margin-top: 2px;
|
||||
font-size: 13px;
|
||||
}
|
||||
#oe_main_menu_navbar .navbar-nav.navbar-right:last-child {
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
.css_non_editable_mode_hidden {
|
||||
display: none !important;
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ----- BOOTSTRAP FIX ----- */
|
||||
|
|
|
@ -86,6 +86,17 @@ header
|
|||
margin-right: auto
|
||||
|
||||
/* ----- EDITOR ----- */
|
||||
#oe_main_menu_navbar
|
||||
min-height: 34px
|
||||
z-index: 1001
|
||||
+border-radius(0px)
|
||||
margin-bottom: 0px
|
||||
li a, li button
|
||||
padding: 4px 8px 4px 8px
|
||||
margin-top: 2px
|
||||
font-size: 13px
|
||||
.navbar-nav.navbar-right:last-child
|
||||
margin-right: 0 !important
|
||||
|
||||
.css_non_editable_mode_hidden
|
||||
display: none
|
||||
|
|
|
@ -7,19 +7,7 @@
|
|||
var website = openerp.website;
|
||||
website.add_template_file('/website/static/src/xml/website.ace.xml');
|
||||
|
||||
website.EditorBar.include({
|
||||
events: _.extend({}, website.EditorBar.prototype.events, {
|
||||
'click a[data-action=ace]': 'launchAce',
|
||||
}),
|
||||
start: function () {
|
||||
var self = this;
|
||||
this.globalEditor = null;
|
||||
return this._super.apply(this, arguments).then(function () {
|
||||
if (window.location.hash.indexOf(hash) >= 0) {
|
||||
self.launchAce();
|
||||
}
|
||||
});
|
||||
},
|
||||
website.Ace = openerp.Widget.extend({
|
||||
launchAce: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
|
@ -157,10 +145,10 @@
|
|||
self.close();
|
||||
});
|
||||
this.getParent().on('change:height', this, function (editor) {
|
||||
resizeEditorHeight(editor.get('height'));
|
||||
resizeEditorHeight(this.getParent().$el.outerHeight()+2);
|
||||
});
|
||||
resizeEditor(readEditorWidth());
|
||||
resizeEditorHeight(this.getParent().get('height'));
|
||||
resizeEditorHeight(this.getParent().$el.outerHeight()+2);
|
||||
},
|
||||
loadViews: function (views) {
|
||||
var $viewList = this.$('#ace-view-list');
|
||||
|
@ -368,4 +356,11 @@
|
|||
},
|
||||
});
|
||||
|
||||
website.ready().done(function() {
|
||||
var ace = new website.Ace();
|
||||
$(document.body).on('click', 'a[data-action=ace]', function() {
|
||||
ace.launchAce();
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
|
@ -2,19 +2,22 @@
|
|||
'use strict';
|
||||
|
||||
var website = openerp.website;
|
||||
website.menu = {};
|
||||
website.add_template_file('/website/static/src/xml/website.menu.xml');
|
||||
website.contentMenu = {};
|
||||
website.add_template_file('/website/static/src/xml/website.contentMenu.xml');
|
||||
var _t = openerp._t;
|
||||
|
||||
website.EditorBar.include({
|
||||
website.EditorBarContent = openerp.Widget.extend({
|
||||
start: function() {
|
||||
var res = this._super();
|
||||
this.$(".oe_content_menu a[data-action=edit-structure]").parents("li").removeClass("hidden");
|
||||
return res;
|
||||
var self = this;
|
||||
self.$el.on('click', 'a', function(ev) {
|
||||
ev.preventDefault();
|
||||
var $content_item = $(this);
|
||||
self[$content_item.data('action')]();
|
||||
})
|
||||
|
||||
return this._super();
|
||||
},
|
||||
events: _.extend({}, website.EditorBar.prototype.events, {
|
||||
'click a[data-action="edit-structure"]': 'editStructure',
|
||||
}),
|
||||
editStructure: function () {
|
||||
edit_menu: function() {
|
||||
var self = this;
|
||||
var context = website.get_context();
|
||||
openerp.jsonRpc('/web/dataset/call_kw', 'call', {
|
||||
|
@ -25,14 +28,40 @@
|
|||
context: context
|
||||
},
|
||||
}).then(function (menu) {
|
||||
var result = new website.menu.EditMenuDialog(menu).appendTo(document.body);
|
||||
var result = new website.contentMenu.EditMenuDialog(menu).appendTo(document.body);
|
||||
return result;
|
||||
});
|
||||
},
|
||||
new_page: function() {
|
||||
website.prompt({
|
||||
id: "editor_new_page",
|
||||
window_title: _t("New Page"),
|
||||
input: _t("Page Title"),
|
||||
init: function () {
|
||||
var $group = this.$dialog.find("div.form-group");
|
||||
$group.removeClass("mb0");
|
||||
|
||||
var $add = $(
|
||||
'<div class="form-group mb0">'+
|
||||
'<label class="col-sm-offset-3 col-sm-9 text-left">'+
|
||||
' <input type="checkbox" checked="checked" required="required"/> '+
|
||||
'</label>'+
|
||||
'</div>');
|
||||
$add.find('label').append(_t("Add page in menu"));
|
||||
$group.after($add);
|
||||
}
|
||||
}).then(function (val, field, $dialog) {
|
||||
if (val) {
|
||||
var url = '/website/add/' + encodeURIComponent(val);
|
||||
if ($dialog.find('input[type="checkbox"]').is(':checked')) url +="?add_menu=1";
|
||||
document.location = url;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
website.menu.EditMenuDialog = website.editor.Dialog.extend({
|
||||
template: 'website.menu.dialog.edit',
|
||||
website.contentMenu.EditMenuDialog = website.editor.Dialog.extend({
|
||||
template: 'website.contentMenu.dialog.edit',
|
||||
events: _.extend({}, website.editor.Dialog.prototype.events, {
|
||||
'click a.js_add_menu': 'add_menu',
|
||||
'click button.js_edit_menu': 'edit_menu',
|
||||
|
@ -73,7 +102,7 @@
|
|||
},
|
||||
add_menu: function () {
|
||||
var self = this;
|
||||
var dialog = new website.menu.MenuEntryDialog();
|
||||
var dialog = new website.contentMenu.MenuEntryDialog();
|
||||
dialog.on('add-menu', this, function (link) {
|
||||
var new_menu = {
|
||||
id: _.uniqueId('new-'),
|
||||
|
@ -86,7 +115,7 @@
|
|||
};
|
||||
self.flat[new_menu.id] = new_menu;
|
||||
self.$('.oe_menu_editor').append(
|
||||
openerp.qweb.render('website.menu.dialog.submenu', { submenu: new_menu }));
|
||||
openerp.qweb.render('website.contentMenu.dialog.submenu', { submenu: new_menu }));
|
||||
});
|
||||
dialog.appendTo(document.body);
|
||||
},
|
||||
|
@ -95,7 +124,7 @@
|
|||
var menu_id = $(ev.currentTarget).closest('[data-menu-id]').data('menu-id');
|
||||
var menu = self.flat[menu_id];
|
||||
if (menu) {
|
||||
var dialog = new website.menu.MenuEntryDialog(undefined, menu);
|
||||
var dialog = new website.contentMenu.MenuEntryDialog(undefined, menu);
|
||||
dialog.on('update-menu', this, function (link) {
|
||||
var id = link.shift();
|
||||
var menu_obj = self.flat[id];
|
||||
|
@ -152,8 +181,8 @@
|
|||
},
|
||||
});
|
||||
|
||||
website.menu.MenuEntryDialog = website.editor.LinkDialog.extend({
|
||||
template: 'website.menu.dialog.add',
|
||||
website.contentMenu.MenuEntryDialog = website.editor.LinkDialog.extend({
|
||||
template: 'website.contentMenu.dialog.add',
|
||||
init: function (editor, data) {
|
||||
this.data = data;
|
||||
return this._super.apply(this, arguments);
|
||||
|
@ -196,4 +225,10 @@
|
|||
},
|
||||
});
|
||||
|
||||
website.ready().done(function() {
|
||||
var content = new website.EditorBarContent()
|
||||
content.setElement($('.oe_content_menu'));
|
||||
content.start();
|
||||
});
|
||||
|
||||
})();
|
|
@ -12,8 +12,14 @@
|
|||
if (!is_smartphone) {
|
||||
website.ready().then(website.init_editor);
|
||||
} else {
|
||||
// remove padding of fake editor bar
|
||||
document.body.style.padding = 0;
|
||||
var resize_smartphone = function () {
|
||||
is_smartphone = $(document.body)[0].clientWidth < 767;
|
||||
if (!is_smartphone) {
|
||||
$(window).off("resize", resize_smartphone);
|
||||
website.init_editor();
|
||||
}
|
||||
};
|
||||
$(window).on("resize", resize_smartphone);
|
||||
}
|
||||
|
||||
$(document).on('click', 'a.js_link2post', function (ev) {
|
||||
|
@ -79,6 +85,7 @@
|
|||
// elements are used for e.g. support of FontAwesome icons
|
||||
CKEDITOR.dtd.$removeEmpty = {};
|
||||
|
||||
|
||||
website.init_editor = function () {
|
||||
CKEDITOR.plugins.add('customdialogs', {
|
||||
// requires: 'link,image',
|
||||
|
@ -435,69 +442,24 @@
|
|||
website.EditorBar = openerp.Widget.extend({
|
||||
template: 'website.editorbar',
|
||||
events: {
|
||||
'click button[data-action=edit]': 'edit',
|
||||
'click button[data-action=save]': 'save',
|
||||
'click a[data-action=cancel]': 'cancel',
|
||||
},
|
||||
container: 'body',
|
||||
customize_setup: function() {
|
||||
var self = this;
|
||||
var view_name = $(document.documentElement).data('view-xmlid');
|
||||
if (!view_name) {
|
||||
this.$('#customize-menu-button').addClass("hidden");
|
||||
}
|
||||
var menu = $('#customize-menu');
|
||||
this.$('#customize-menu-button').click(function(event) {
|
||||
menu.empty();
|
||||
openerp.jsonRpc('/website/customize_template_get', 'call', { 'xml_id': view_name }).then(
|
||||
function(result) {
|
||||
_.each(result, function (item) {
|
||||
if (item.xml_id === "website.debugger" && !window.location.search.match(/[&?]debug(&|$)/)) return;
|
||||
if (item.header) {
|
||||
menu.append('<li class="dropdown-header">' + item.name + '</li>');
|
||||
} else {
|
||||
menu.append(_.str.sprintf('<li role="presentation"><a href="#" data-view-id="%s" role="menuitem"><strong class="fa fa%s-square-o"></strong> %s</a></li>',
|
||||
item.id, item.active ? '-check' : '', item.name));
|
||||
}
|
||||
});
|
||||
// Adding Static Menus
|
||||
menu.append('<li class="divider"></li>');
|
||||
menu.append('<li><a data-action="ace" href="#">HTML Editor</a></li>');
|
||||
menu.append('<li class="js_change_theme"><a href="/page/website.themes">Change Theme</a></li>');
|
||||
menu.append('<li><a href="/web#return_label=Website&action=website.action_module_website">Install Apps</a></li>');
|
||||
self.trigger('rte:customize_menu_ready');
|
||||
}
|
||||
);
|
||||
});
|
||||
menu.on('click', 'a[data-view-id]', function (event) {
|
||||
var view_id = $(event.currentTarget).data('view-id');
|
||||
return openerp.jsonRpc('/web/dataset/call_kw', 'call', {
|
||||
model: 'ir.ui.view',
|
||||
method: 'toggle',
|
||||
args: [],
|
||||
kwargs: {
|
||||
ids: [parseInt(view_id, 10)],
|
||||
context: website.get_context()
|
||||
}
|
||||
}).then( function() {
|
||||
window.location.reload();
|
||||
});
|
||||
});
|
||||
},
|
||||
start: function() {
|
||||
// remove placeholder editor bar
|
||||
var fakebar = document.getElementById('website-top-navbar-placeholder');
|
||||
if (fakebar) {
|
||||
fakebar.parentNode.removeChild(fakebar);
|
||||
}
|
||||
|
||||
var self = this;
|
||||
this.saving_mutex = new openerp.Mutex();
|
||||
|
||||
this.$buttons = {
|
||||
edit: this.$el.parents().find('button[data-action=edit]'),
|
||||
save: this.$('button[data-action=save]'),
|
||||
cancel: this.$('button[data-action=cancel]'),
|
||||
};
|
||||
|
||||
this.$('#website-top-edit').hide();
|
||||
this.$('#website-top-view').show();
|
||||
this.$buttons.edit.show();
|
||||
|
||||
var $edit_button = this.$('button[data-action=edit]')
|
||||
var $edit_button = this.$buttons.edit
|
||||
.prop('disabled', website.no_editor);
|
||||
if (website.no_editor) {
|
||||
var help_text = $(document.documentElement).data('editable-no-editor');
|
||||
|
@ -507,52 +469,31 @@
|
|||
.attr('title', help_text);
|
||||
}
|
||||
|
||||
|
||||
$('.dropdown-toggle').dropdown();
|
||||
this.customize_setup();
|
||||
|
||||
this.$buttons = {
|
||||
edit: this.$('button[data-action=edit]'),
|
||||
save: this.$('button[data-action=save]'),
|
||||
cancel: this.$('button[data-action=cancel]'),
|
||||
};
|
||||
this.$buttons.edit.click(function(ev) {
|
||||
self.edit();
|
||||
});
|
||||
|
||||
this.rte = new website.RTE(this);
|
||||
this.rte.on('change', this, this.proxy('rte_changed'));
|
||||
this.rte.on('rte:ready', this, function () {
|
||||
self.setup_hover_buttons();
|
||||
self.trigger('rte:ready');
|
||||
self.check_height();
|
||||
});
|
||||
|
||||
$(window).on('resize', _.debounce(this.check_height.bind(this), 50));
|
||||
this.check_height();
|
||||
|
||||
if (website.is_editable_button) {
|
||||
this.$("button[data-action=edit]").removeClass("hidden");
|
||||
}
|
||||
|
||||
return $.when(
|
||||
this._super.apply(this, arguments),
|
||||
this.rte.appendTo(this.$('#website-top-edit .nav.pull-right'))
|
||||
).then(function () {
|
||||
self.check_height();
|
||||
});
|
||||
},
|
||||
check_height: function () {
|
||||
var editor_height = this.$el.outerHeight();
|
||||
if (this.get('height') != editor_height) {
|
||||
$(document.body).css('padding-top', editor_height);
|
||||
this.set('height', editor_height);
|
||||
}
|
||||
this.rte.appendTo(this.$('#website-top-edit .nav.js_editor_placeholder'));
|
||||
return this._super.apply(this, arguments);
|
||||
|
||||
},
|
||||
edit: function () {
|
||||
this.$buttons.edit.prop('disabled', true);
|
||||
this.$('#website-top-view').hide();
|
||||
this.$el.show();
|
||||
this.$('#website-top-edit').show();
|
||||
$('.css_non_editable_mode_hidden').removeClass("css_non_editable_mode_hidden");
|
||||
|
||||
this.rte.start_edition().then(this.check_height.bind(this));
|
||||
this.rte.start_edition();
|
||||
this.trigger('rte:called');
|
||||
},
|
||||
rte_changed: function () {
|
||||
|
@ -762,6 +703,62 @@
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
website.EditorBarCustomize = openerp.Widget.extend({
|
||||
events: {
|
||||
'mousedown a.dropdown-toggle': 'load_menu',
|
||||
'click ul a[data-action!=ace]': 'do_customize',
|
||||
},
|
||||
start: function() {
|
||||
var self = this;
|
||||
this.$menu = self.$el.find('ul');
|
||||
this.view_name = $(document.documentElement).data('view-xmlid');
|
||||
if (!this.view_name) {
|
||||
this.$el.hide();
|
||||
}
|
||||
this.loaded = false;
|
||||
},
|
||||
load_menu: function () {
|
||||
var self = this;
|
||||
if(this.loaded) {
|
||||
return;
|
||||
}
|
||||
openerp.jsonRpc('/website/customize_template_get', 'call', { 'xml_id': this.view_name }).then(
|
||||
function(result) {
|
||||
_.each(result, function (item) {
|
||||
if (item.xml_id === "website.debugger" && !window.location.search.match(/[&?]debug(&|$)/)) return;
|
||||
if (item.header) {
|
||||
self.$menu.append('<li class="dropdown-header">' + item.name + '</li>');
|
||||
} else {
|
||||
self.$menu.append(_.str.sprintf('<li role="presentation"><a href="#" data-view-id="%s" role="menuitem"><strong class="fa fa%s-square-o"></strong> %s</a></li>',
|
||||
item.id, item.active ? '-check' : '', item.name));
|
||||
}
|
||||
});
|
||||
self.loaded = true;
|
||||
}
|
||||
);
|
||||
},
|
||||
do_customize: function (event) {
|
||||
var view_id = $(event.currentTarget).data('view-id');
|
||||
return openerp.jsonRpc('/web/dataset/call_kw', 'call', {
|
||||
model: 'ir.ui.view',
|
||||
method: 'toggle',
|
||||
args: [],
|
||||
kwargs: {
|
||||
ids: [parseInt(view_id, 10)],
|
||||
context: website.get_context()
|
||||
}
|
||||
}).then( function() {
|
||||
window.location.reload();
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
website.ready().done(function() {
|
||||
var editorBarCustomize = new website.EditorBarCustomize();
|
||||
editorBarCustomize.setElement($('li[id=customize-menu]'));
|
||||
editorBarCustomize.start();
|
||||
});
|
||||
|
||||
var blocks_selector = _.keys(CKEDITOR.dtd.$block).join(',');
|
||||
/* ----- RICH TEXT EDITOR ---- */
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
(function() {
|
||||
"use strict";
|
||||
|
||||
var website = openerp.website;
|
||||
var _t = openerp._t;
|
||||
website.is_editable_button = true;
|
||||
|
||||
website.EditorBar.include({
|
||||
start: function() {
|
||||
var res = this._super();
|
||||
this.$("a[data-action=new_page]").parents("li").removeClass("hidden");
|
||||
this.$(".oe_content_menu li.divider").removeClass("hidden");
|
||||
return res;
|
||||
},
|
||||
edit: function () {
|
||||
this.on('rte:ready', this, function () {
|
||||
$('a:has(span[data-oe-model="website.menu"])').tooltip({
|
||||
title: _t('Save this page and use the top "Content" menu to edit the menu.'),
|
||||
placement: "bottom",
|
||||
trigger: "hover",
|
||||
show: 50,
|
||||
hide: 100,
|
||||
container: 'body'
|
||||
});
|
||||
});
|
||||
return this._super();
|
||||
},
|
||||
events: _.extend({}, website.EditorBar.prototype.events, {
|
||||
'click a[data-action=new_page]': function (ev) {
|
||||
ev.preventDefault();
|
||||
website.prompt({
|
||||
id: "editor_new_page",
|
||||
window_title: _t("New Page"),
|
||||
input: _t("Page Title"),
|
||||
init: function () {
|
||||
var $group = this.$dialog.find("div.form-group");
|
||||
$group.removeClass("mb0");
|
||||
|
||||
var $add = $(
|
||||
'<div class="form-group mb0">'+
|
||||
'<label class="col-sm-offset-3 col-sm-9 text-left">'+
|
||||
' <input type="checkbox" checked="checked" required="required"/> '+
|
||||
'</label>'+
|
||||
'</div>');
|
||||
$add.find('label').append(_t("Add page in menu"));
|
||||
$group.after($add);
|
||||
}
|
||||
}).then(function (val, field, $dialog) {
|
||||
if (val) {
|
||||
var url = '/website/add/' + encodeURIComponent(val);
|
||||
if ($dialog.find('input[type="checkbox"]').is(':checked')) url +="?add_menu=1";
|
||||
document.location = url;
|
||||
}
|
||||
});
|
||||
}
|
||||
}),
|
||||
});
|
||||
})();
|
|
@ -5,7 +5,6 @@
|
|||
openerp.website = website;
|
||||
|
||||
website.translatable = !!$('html').data('translatable');
|
||||
website.is_editable = !!$('html').data('editable');
|
||||
|
||||
/* ----------------------------------------------------
|
||||
Helpers
|
||||
|
@ -247,13 +246,10 @@
|
|||
});
|
||||
};
|
||||
|
||||
if (website.is_editable) {
|
||||
website.add_template_file('/website/static/src/xml/website.xml');
|
||||
}
|
||||
website.add_template_file('/website/static/src/xml/website.xml');
|
||||
|
||||
website.dom_ready = $.Deferred();
|
||||
$(document).ready(function () {
|
||||
website.is_editable_button= website.is_editable_button || $('html').data('editable');
|
||||
website.dom_ready.resolve();
|
||||
// fix for ie
|
||||
if($.fn.placeholder) $('input, textarea').placeholder();
|
||||
|
@ -269,7 +265,11 @@
|
|||
all_ready = website.dom_ready.then(function () {
|
||||
return templates_def;
|
||||
}).then(function () {
|
||||
if (website.is_editable) {
|
||||
// display button if they are at least one editable zone in the page (check the branding)
|
||||
var editable = $('html').data('website-id') && !!$('[data-oe-model]').size();
|
||||
$("#oe_editzone").toggle(editable);
|
||||
|
||||
if ($('html').data('website-id')) {
|
||||
website.id = $('html').data('website-id');
|
||||
website.session = new openerp.Session();
|
||||
var modules = ['website'];
|
||||
|
@ -308,6 +308,14 @@
|
|||
window.document.body.scrollTop = +location.hash.match(/scrollTop=([0-9]+)/)[1];
|
||||
}
|
||||
},0);
|
||||
|
||||
/* ----- WEBSITE TOP BAR ---- */
|
||||
var $collapse = $('#oe_applications ul.dropdown-menu').clone()
|
||||
.attr("id", "oe_applications_collapse")
|
||||
.attr("class", "nav navbar-nav navbar-left navbar-collapse collapse");
|
||||
$('#oe_applications').before($collapse);
|
||||
$collapse.wrap('<div class="visible-xs"/>');
|
||||
$('[data-target="#oe_applications"]').attr("data-target", "#oe_applications_collapse");
|
||||
});
|
||||
|
||||
return website;
|
||||
|
|
|
@ -2,30 +2,30 @@
|
|||
'use strict';
|
||||
|
||||
var website = openerp.website;
|
||||
website.EditorBar.include({
|
||||
events: _.extend({}, website.EditorBar.prototype.events, {
|
||||
'click a[data-action=show-mobile-preview]': 'mobilePreview',
|
||||
}),
|
||||
mobilePreview: function () {
|
||||
(new website.MobilePreview()).appendTo($(document.body));
|
||||
},
|
||||
});
|
||||
website.add_template_file('/website/static/src/xml/website.xml');
|
||||
|
||||
website.MobilePreview = openerp.Widget.extend({
|
||||
template: 'website.mobile_preview',
|
||||
events: {
|
||||
'hidden.bs.modal': 'destroy'
|
||||
},
|
||||
start: function () {
|
||||
start: function() {
|
||||
if (!window.location.origin) { // fix for ie9
|
||||
window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
|
||||
}
|
||||
document.getElementById("mobile-viewport").src = window.location.origin + window.location.pathname + window.location.search + "#mobile-preview";
|
||||
this.$el.modal();
|
||||
},
|
||||
destroy: function () {
|
||||
destroy: function() {
|
||||
$('.modal-backdrop').remove();
|
||||
this._super();
|
||||
},
|
||||
});
|
||||
|
||||
website.ready().done(function() {
|
||||
$(document.body).on('click', 'a[data-action=show-mobile-preview]', function() {
|
||||
new website.MobilePreview().appendTo($(document.body));
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
|
@ -4,15 +4,6 @@
|
|||
var website = openerp.website;
|
||||
website.add_template_file('/website/static/src/xml/website.seo.xml');
|
||||
|
||||
website.EditorBar.include({
|
||||
events: _.extend({}, website.EditorBar.prototype.events, {
|
||||
'click a[data-action=promote-current-page]': 'launchSeo',
|
||||
}),
|
||||
launchSeo: function () {
|
||||
(new website.seo.Configurator(this)).appendTo($(document.body));
|
||||
},
|
||||
});
|
||||
|
||||
website.seo = {};
|
||||
|
||||
function analyzeKeyword(htmlPage, keyword) {
|
||||
|
@ -524,4 +515,11 @@
|
|||
this._super();
|
||||
},
|
||||
});
|
||||
|
||||
website.ready().done(function() {
|
||||
$(document.body).on('click', 'a[data-action=promote-current-page]', function() {
|
||||
new website.seo.Configurator(this).appendTo($(document.body));
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
popover: { fixed: true },
|
||||
},
|
||||
{
|
||||
waitFor: 'button[data-action=edit]:visible',
|
||||
waitFor: 'button[data-action=save]:not(:visible)',
|
||||
title: _t("Good Job!"),
|
||||
content: _t("Well done, you created your homepage."),
|
||||
popover: { next: _t("Continue") },
|
||||
|
|
|
@ -12,8 +12,8 @@ window.openerp.website.EditorBar.include({
|
|||
}
|
||||
var $menuItem = $($.parseHTML('<li><a href="#">'+tour.name+'</a></li>'));
|
||||
$menuItem.click(function () {
|
||||
T.reset();
|
||||
T.run(tour.id);
|
||||
openerp.Tour.reset();
|
||||
openerp.Tour.run(tour.id);
|
||||
});
|
||||
menu.append($menuItem);
|
||||
});
|
||||
|
@ -21,4 +21,4 @@ window.openerp.website.EditorBar.include({
|
|||
}
|
||||
});
|
||||
|
||||
}());
|
||||
})();
|
||||
|
|
|
@ -12,21 +12,20 @@
|
|||
|
||||
website.EditorBar.include({
|
||||
do_not_translate : ['-','*','!'],
|
||||
events: _.extend({}, website.EditorBar.prototype.events, {
|
||||
'click a[data-action=edit_master]': 'edit_master',
|
||||
}),
|
||||
start: function () {
|
||||
var self = this;
|
||||
this.initial_content = {};
|
||||
return this._super.apply(this, arguments).then(function () {
|
||||
self.$("button[data-action=edit]").removeClass("hidden");
|
||||
self.$('button[data-action=edit]')
|
||||
$("button[data-action=edit]").removeClass("hidden");
|
||||
$('button[data-action=edit]')
|
||||
.text("Translate");
|
||||
if (website.is_editable_button) {
|
||||
self.$('button[data-action=edit]')
|
||||
.after(openerp.qweb.render('website.TranslatorAdditionalButtons'));
|
||||
}
|
||||
self.$('.js_hide_on_translate').hide();
|
||||
$('button[data-action=edit]')
|
||||
.parent()
|
||||
.after(openerp.qweb.render('website.TranslatorAdditionalButtons'));
|
||||
$('a[data-action=edit_master]').on('click', self, function(ev) {
|
||||
self.edit_master(ev);
|
||||
});
|
||||
$('.js_hide_on_translate').hide();
|
||||
});
|
||||
},
|
||||
edit: function () {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<templates id="template" xml:space="preserve">
|
||||
<t t-name="website.menu.dialog.submenu">
|
||||
<t t-name="website.contentMenu.dialog.submenu">
|
||||
<li t-att-data-menu-id="submenu.id">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon fa fa-bars"/>
|
||||
|
@ -17,17 +17,17 @@
|
|||
<t t-set="children" t-value="submenu.children"/>
|
||||
<ul t-if="children">
|
||||
<t t-foreach="children" t-as="submenu">
|
||||
<t t-call="website.menu.dialog.submenu"/>
|
||||
<t t-call="website.contentMenu.dialog.submenu"/>
|
||||
</t>
|
||||
</ul>
|
||||
</li>
|
||||
</t>
|
||||
<t t-name="website.menu.dialog.edit">
|
||||
<t t-name="website.contentMenu.dialog.edit">
|
||||
<t t-call="website.editor.dialog">
|
||||
<t t-set="title">Edit Menu</t>
|
||||
<ul class="oe_menu_editor list-unstyled">
|
||||
<t t-foreach="widget.menu.children" t-as="submenu">
|
||||
<t t-call="website.menu.dialog.submenu"/>
|
||||
<t t-call="website.contentMenu.dialog.submenu"/>
|
||||
</t>
|
||||
</ul>
|
||||
<div class="mt16">
|
||||
|
@ -42,7 +42,7 @@
|
|||
</div>
|
||||
</t>
|
||||
</t>
|
||||
<t t-name="website.menu.dialog.add" t-extend="website.editor.dialog.link">
|
||||
<t t-name="website.contentMenu.dialog.add" t-extend="website.editor.dialog.link">
|
||||
<t t-jquery="t[t-set='title']" t-operation="inner">
|
||||
<t t-if="!widget.update_mode">Add Menu Entry</t>
|
||||
<t t-if="widget.update_mode">Edit Menu Entry</t>
|
|
@ -1,18 +1,19 @@
|
|||
<templates id="template" xml:space="preserve">
|
||||
<t t-extend="website.editorbar">
|
||||
<t t-jquery="#website-top-view" t-operation="after">
|
||||
<div class="navbar-inner" id="website-top-edit">
|
||||
<form class="navbar-form pull-left text-muted">
|
||||
<button type="button" data-action="save"
|
||||
class="btn btn-primary">Save</button>
|
||||
or
|
||||
<a href="#" data-action="cancel" class="btn btn-link">Discard</a>
|
||||
</form>
|
||||
<ul class="nav navbar-nav pull-right">
|
||||
<t t-name="website.editorbar">
|
||||
<div id="website-top-navbar" class="navbar navbar-inverse navbar-fixed-top hidden-xs" style="display: none;">
|
||||
<div class="navbar-header" id="website-top-edit">
|
||||
<ul class="nav navbar-nav js_editor_placeholder pull-right">
|
||||
</ul>
|
||||
<form class="navbar-form text-muted">
|
||||
<button type="button" data-action="save"
|
||||
class="btn btn-primary btn-xs">Save</button>
|
||||
or
|
||||
<a href="#" data-action="cancel" class="btn btn-link btn-xs">Discard</a>
|
||||
</form>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="website.editor.dialog">
|
||||
<div class="modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
|
||||
<t t-name="website.editorbar.menu.promote">
|
||||
<li><a data-action="promote-current-page" href="#"><span title="Promote page on the web">Promote</span></a></li>
|
||||
</t>
|
||||
|
||||
<t t-name="website.seo_configuration">
|
||||
<div class="modal fade oe_seo_configuration js_seo_configuration" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
|
||||
<!-- Snippet loader -->
|
||||
<t t-name="website.snippets_button">
|
||||
<li class="navbar-form js_hide_on_translate"><button type="button" data-action="snippet" class="hidden btn btn-primary">Insert Blocks</button></li>
|
||||
<li class="navbar-form js_hide_on_translate" style="margin-top: 6px;">
|
||||
<button type="button" data-action="snippet" class="hidden btn btn-primary btn-xs">Insert Blocks</button>
|
||||
</li>
|
||||
</t>
|
||||
<t t-name="website.snippets_style">
|
||||
<li class="navbar-form">
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-name="website.TranslatorAdditionalButtons">
|
||||
<span class="oe_translate_or">or</span>
|
||||
<a class="btn btn-link" data-action="edit_master" href="#">Edit Master</a>
|
||||
<li><a class="btn btn-link" data-action="edit_master" href="#"> or Edit Master</a></li>
|
||||
</t>
|
||||
<t t-name="website.TranslatorDialog">
|
||||
<div class="modal fade oe_website_translator" tabindex="-1" role="dialog">
|
||||
|
|
|
@ -2,53 +2,6 @@
|
|||
<!-- vim:fdl=1:
|
||||
-->
|
||||
<templates id="template" xml:space="preserve">
|
||||
|
||||
<t t-name="website.editorbar">
|
||||
<div id="website-top-navbar" class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div id="website-top-view">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-edit-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<form class="navbar-form navbar-left">
|
||||
<button type="button" data-action="edit"
|
||||
class="btn btn-primary hidden">Edit</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse navbar-edit-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a data-action="show-mobile-preview" href="#"><span title="Mobile preview"><i class="fa fa-mobile"/></span></a></li>
|
||||
<li class="divider-vertical"></li>
|
||||
<li><a data-action="promote-current-page" href="#"><span title="Promote page on the web">Promote</span></a></li>
|
||||
<li class="hidden dropdown js_hide_on_translate">
|
||||
<a id="content-menu-button" class="dropdown-toggle" data-toggle="dropdown" href="#">Content <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu oe_content_menu" role="menu">
|
||||
<li class="hidden"><a data-action="edit-structure" href="#"><span title="Edit Top Menu">Edit Menu</span></a></li>
|
||||
<li class="hidden divider"> </li>
|
||||
<li class="hidden"><a href="#" data-action="new_page">New Page</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown js_hide_on_translate">
|
||||
<a id="customize-menu-button" class="dropdown-toggle" data-toggle="dropdown" href="#">Customize <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu" id="customize-menu">
|
||||
<!-- filled in JS -->
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown js_hide_on_translate">
|
||||
<a id="help-menu-button" class="dropdown-toggle" data-toggle="dropdown" href="#">Help <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu" id="help-menu">
|
||||
<!-- filled in JS -->
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="website.mobile_preview">
|
||||
<div class="modal fade oe_mobile_preview" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
@ -124,5 +77,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import openerp.tests
|
||||
|
||||
|
||||
class TestUi(openerp.tests.HttpCase):
|
||||
def test_01_public_homepage(self):
|
||||
self.phantom_js("/", "console.log('ok')", "openerp.website.snippet")
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- Front-end/Back-end integration -->
|
||||
<template id="user_navbar" inherit_id="website.layout" groups="base.group_user">
|
||||
<xpath expr="//body/div['id=wrawrap']" position="before">
|
||||
<nav id="oe_main_menu_navbar" class="navbar navbar-inverse" role="navigation">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#oe_applications">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<ul id="oe_applications" class="nav navbar-nav navbar-left navbar-collapse collapse">
|
||||
<li class="dropdown active">
|
||||
<a href="#" class="dropdown-toggle hidden-xs" data-toggle="dropdown"><i class="fa fa-th-large"></i> Website<b class="caret"/></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li t-foreach="menu_data['children']" t-as="menu">
|
||||
<t t-call="web.menu_link"/>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul id="oe_editzone" class="nav navbar-nav hidden-xs" style="padding-left: 20px;" groups="base.group_website_publisher">
|
||||
<li><button type="button" data-action="edit" class="btn btn-primary btn-xs" style="display: none;">Edit</button></li>
|
||||
</ul>
|
||||
|
||||
<ul id="oe_systray" class="nav navbar-nav navbar-right pull-right hidden-xs">
|
||||
<!-- Mobile -->
|
||||
<li>
|
||||
<a data-action="show-mobile-preview" href="#">
|
||||
<span title="Mobile preview"><i class="fa fa-mobile"/></span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Promote -->
|
||||
<li groups="base.group_website_designer">
|
||||
<a data-action="promote-current-page" href="#">
|
||||
<span title="Promote page on the web">Promote</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Content -->
|
||||
<li class="dropdown" groups="base.group_website_publisher">
|
||||
<a id="content-menu-button" class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
Content <span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu oe_content_menu" role="menu">
|
||||
<li groups="base.group_website_designer"><a data-action="edit_menu" href="#"><span title="Edit Top Menu">Edit Menu</span></a></li>
|
||||
<li class="divider" groups="base.group_website_designer"> </li>
|
||||
<li groups="base.group_website_designer"><a href="#" data-action="new_page">New Page</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<!-- Customize -->
|
||||
<li class="dropdown" id="customize-menu" groups="base.group_website_designer">
|
||||
<a id="customize-menu-button" class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
Customize <span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#advanced-view-editor" data-action='ace'>HTML Editor</a></li>
|
||||
<li><a href="/page/website.themes">Change Theme</a></li>
|
||||
<li><a href="/web#return_label=Website&action=website.action_module_website">Install Apps</a></li>
|
||||
<li class="divider"></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<!-- Help -->
|
||||
<li class="dropdown">
|
||||
<a id="help-menu-button" class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
Help <span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu" id="help-menu">
|
||||
<li class="dropdown-header">HELP & TUTORIALS</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</xpath>
|
||||
</template>
|
||||
</data>
|
||||
</openerp>
|
|
@ -174,36 +174,6 @@
|
|||
</template>
|
||||
|
||||
<template id="editor_head" inherit_id="website.layout" name="Editor" groups="base.group_website_publisher,base.group_website_designer">
|
||||
<xpath expr="//body" position="attributes">
|
||||
<attribute name="style">padding-top: 51px;</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//body" position="inside">
|
||||
<div id="website-top-navbar-placeholder" class="navbar navbar-inverse navbar-fixed-top hidden-xs">
|
||||
<div class="navbar-header">
|
||||
<form class="navbar-form navbar-left" title="editable_no_editor or None">
|
||||
<button type="button" class="btn btn-primary"
|
||||
disabled="'disabled' if editable_no_editor else None"
|
||||
>Edit</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse navbar-edit-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="#" onclick="return false;"><i class="fa fa-mobile" title="Mobile preview"/></a></li>
|
||||
<li class="divider-vertical"/>
|
||||
<li><a href="#" onclick="return false;"><span title="Promote page on the web">Promote</span></a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" onclick="return false;">Content <span class="caret"/></a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" onclick="return false;">Customize <span class="caret"/></a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" onclick="return false;">Help <span class="caret"/></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr='//t[@t-call-assets="website.assets_frontend"]' position="after">
|
||||
<t t-call-assets="website.assets_editor"/>
|
||||
</xpath>
|
||||
|
@ -215,22 +185,21 @@
|
|||
</script>
|
||||
<link rel='stylesheet' href='/website/static/src/css/snippets.css'/>
|
||||
<link rel='stylesheet' href='/website/static/src/css/editor.css'/>
|
||||
|
||||
<link rel='stylesheet' href="/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.9.1.custom.css"/>
|
||||
|
||||
<link rel="stylesheet" href="/web/static/lib/select2/select2.css"/>
|
||||
<link rel="stylesheet" href="/website/static/lib/select2-bootstrap-css/select2-bootstrap.css"/>
|
||||
|
||||
<script type="text/javascript" src="/web/static/lib/select2/select2.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/web/static/lib/ckeditor/ckeditor.js"></script>
|
||||
<script type="text/javascript" src="/website/static/lib/ace/ace.js"></script>
|
||||
<script type="text/javascript" src="/website/static/lib/ace/theme-monokai.js"></script>
|
||||
<script type="text/javascript" src="/website/static/lib/ace/mode-xml.js"></script>
|
||||
<script type="text/javascript" src="/website/static/lib/vkbeautify/vkbeautify.0.99.00.beta.js"></script>
|
||||
<script type="text/javascript" src="/website/static/lib/jQuery.transfo.js"></script>
|
||||
<t t-call="web.jqueryui_conflict">
|
||||
<script type="text/javascript" src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
|
||||
</t>
|
||||
|
||||
<!-- mutation observers shim backed by mutation events (8 < IE < 11, Safari < 6, FF < 14, Chrome < 17) -->
|
||||
<script type="text/javascript" src="/website/static/lib//jquery.mjs.nestedSortable/jquery.mjs.nestedSortable.js"></script>
|
||||
<script type="text/javascript" src="/website/static/lib/MutationObservers/test/sidetable.js"></script>
|
||||
|
@ -238,8 +207,7 @@
|
|||
<script type="text/javascript" src="/website/static/lib/MutationObservers/MutationObserver.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/website/static/src/js/website.editor.js"></script>
|
||||
<script type="text/javascript" src="/website/static/src/js/website.editor.newpage.js"></script> <!-- groups="base.group_website_designer" -->
|
||||
<script type="text/javascript" src="/website/static/src/js/website.menu.js"></script> <!-- groups="base.group_website_designer" -->
|
||||
<script type="text/javascript" src="/website/static/src/js/website.contentMenu.js"></script> <!-- groups="base.group_website_designer" -->
|
||||
<script type="text/javascript" src="/website/static/src/js/website.mobile.js"></script>
|
||||
<script type="text/javascript" src="/website/static/src/js/website.seo.js"></script>
|
||||
<script type="text/javascript" src="/website/static/src/js/website.tour.js"></script>
|
||||
|
@ -248,13 +216,6 @@
|
|||
<script type="text/javascript" src="/website/static/src/js/website.ace.js"></script>
|
||||
<script type="text/javascript" src="/website/static/src/js/website.translator.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/website/static/src/js/jQuery.transfo.js"></script>
|
||||
</template>
|
||||
|
||||
<template id="debugger" inherit_id="website.layout" optional="disabled" name="Debugger & Tests">
|
||||
<xpath expr='//t[@name="layout_head"]' position="after">
|
||||
<t t-set="debugger_hook" t-value="1" />
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="login_layout" inherit_id="web.login_layout" name="Website Login Layout">
|
||||
|
|
|
@ -3,31 +3,24 @@
|
|||
|
||||
var website = openerp.website;
|
||||
var _t = openerp._t;
|
||||
website.add_template_file('/website_blog/static/src/xml/website_blog.xml');
|
||||
|
||||
website.EditorBarContent.include({
|
||||
new_blog_post: function() {
|
||||
website.prompt({
|
||||
id: "editor_new_blog",
|
||||
window_title: _t("New Blog Post"),
|
||||
select: "Select Blog",
|
||||
init: function (field) {
|
||||
return website.session.model('blog.blog')
|
||||
.call('name_search', [], { context: website.get_context() });
|
||||
},
|
||||
}).then(function (cat_id) {
|
||||
document.location = '/blogpost/new?blog_id=' + cat_id;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
website.EditorBar.include({
|
||||
start: function() {
|
||||
website.is_editable_button = website.is_editable_button || !!$("#wrap.js_blog").size();
|
||||
var res = this._super();
|
||||
this.$(".dropdown:has(.oe_content_menu)").removeClass("hidden");
|
||||
return res;
|
||||
},
|
||||
events: _.extend({}, website.EditorBar.prototype.events, {
|
||||
'click a[data-action=new_blog_post]': function (ev) {
|
||||
ev.preventDefault();
|
||||
website.prompt({
|
||||
id: "editor_new_blog",
|
||||
window_title: _t("New Blog Post"),
|
||||
select: "Select Blog",
|
||||
init: function (field) {
|
||||
return website.session.model('blog.blog')
|
||||
.call('name_search', [], { context: website.get_context() });
|
||||
},
|
||||
}).then(function (cat_id) {
|
||||
document.location = '/blogpost/new?blog_id=' + cat_id;
|
||||
});
|
||||
},
|
||||
}),
|
||||
edit: function () {
|
||||
var self = this;
|
||||
$('.popover').remove();
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<templates id="template" xml:space="preserve">
|
||||
<t t-extend="website.editorbar">
|
||||
<t t-jquery="ul.oe_content_menu" t-operation="append">
|
||||
<li><a href="#" data-action="new_blog_post">New Blog Post</a></li>
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
|
@ -461,5 +461,11 @@
|
|||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- User Navbar -->
|
||||
<template id="content_new_blogpost" inherit_id="website.user_navbar" groups="base.group_document_user">
|
||||
<xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
|
||||
<li><a href="#" data-action="new_blog_post">New Blog Post</a></li>
|
||||
</xpath>
|
||||
</template>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -3,28 +3,18 @@
|
|||
|
||||
var website = openerp.website;
|
||||
var _t = openerp._t;
|
||||
website.add_template_file('/website_event/static/src/xml/website_event.xml');
|
||||
|
||||
website.EditorBar.include({
|
||||
start: function() {
|
||||
website.is_editable_button = website.is_editable_button || !!$("#wrap.js_event").size();
|
||||
var res = this._super();
|
||||
this.$(".dropdown:has(.oe_content_menu)").removeClass("hidden");
|
||||
return res;
|
||||
},
|
||||
events: _.extend({}, website.EditorBar.prototype.events, {
|
||||
'click a[data-action=new_event]': function (ev) {
|
||||
ev.preventDefault();
|
||||
website.prompt({
|
||||
id: "editor_new_event",
|
||||
window_title: _t("New Event"),
|
||||
input: "Event Name",
|
||||
}).then(function (event_name) {
|
||||
website.form('/event/add_event', 'POST', {
|
||||
event_name: event_name
|
||||
});
|
||||
website.EditorBarContent.include({
|
||||
new_event: function() {
|
||||
website.prompt({
|
||||
id: "editor_new_event",
|
||||
window_title: _t("New Event"),
|
||||
input: "Event Name",
|
||||
}).then(function (event_name) {
|
||||
website.form('/event/add_event', 'POST', {
|
||||
event_name: event_name
|
||||
});
|
||||
}
|
||||
}),
|
||||
});
|
||||
},
|
||||
});
|
||||
})();
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<templates id="template" xml:space="preserve">
|
||||
<t t-extend="website.editorbar">
|
||||
<t t-jquery="ul.oe_content_menu" t-operation="append">
|
||||
<li><a href="#" data-action="new_event">New Event</a></li>
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
|
@ -8,7 +8,7 @@
|
|||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="editor_head" inherit_id="website.assets_editor" name="Event Editor" groups="event.group_event_manager">
|
||||
<template id="assets_editor" inherit_id="website.assets_editor" name="Event Editor" groups="event.group_event_manager">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_event/static/src/js/website_event.editor.js"></script>
|
||||
<script type="text/javascript" src="/website_event/static/src/js/website.tour.event.js"></script>
|
||||
|
@ -429,5 +429,12 @@
|
|||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<!-- User Navbar -->
|
||||
<template id="content_new_event" inherit_id="website.user_navbar" groups="event.group_event_manager">
|
||||
<xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
|
||||
<li><a href="#" data-action="new_event">New Event</a></li>
|
||||
</xpath>
|
||||
</template>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -7,21 +7,18 @@ from openerp.tools.translate import _
|
|||
class sale_order(osv.Model):
|
||||
_inherit = "sale.order"
|
||||
|
||||
def _cart_find_product_line(self, cr, uid, ids, product_id=None, line_id=None, context=None):
|
||||
def _cart_find_product_line(self, cr, uid, ids, product_id=None, line_id=None, context=None, **kwargs):
|
||||
line_ids = super(sale_order, self)._cart_find_product_line(cr, uid, ids, product_id, line_id, context=context)
|
||||
if line_id:
|
||||
return line_ids
|
||||
for so in self.browse(cr, uid, ids, context=context):
|
||||
order_line_id = None
|
||||
domain = [('order_id', '=', so.id), ('product_id', '=', product_id)]
|
||||
if line_id:
|
||||
domain += [('id', '=', line_id)]
|
||||
elif context.get("event_ticket_id"):
|
||||
domain = [('id', 'in', line_ids)]
|
||||
if context.get("event_ticket_id"):
|
||||
domain += [('event_ticket_id', '=', context.get("event_ticket_id"))]
|
||||
order_line_ids = self.pool.get('sale.order.line').search(cr, SUPERUSER_ID, domain, context=context)
|
||||
if order_line_ids:
|
||||
order_line_id = order_line_ids[0]
|
||||
return order_line_id
|
||||
return self.pool.get('sale.order.line').search(cr, SUPERUSER_ID, domain, context=context)
|
||||
|
||||
def _website_product_id_change(self, cr, uid, ids, order_id, product_id, line_id=None, context=None):
|
||||
values = super(sale_order,self)._website_product_id_change(cr, uid, ids, order_id, product_id, line_id=None, context=None)
|
||||
values = super(sale_order,self)._website_product_id_change(cr, uid, ids, order_id, product_id, line_id=line_id, context=None)
|
||||
|
||||
event_ticket_id = None
|
||||
if context.get("event_ticket_id"):
|
||||
|
|
|
@ -4,7 +4,6 @@ import openerp.tests
|
|||
|
||||
inject = [
|
||||
("openerp.Tour", os.path.join(os.path.dirname(__file__), '../../web/static/src/js/tour.js')),
|
||||
("openerp.Tour.ShopTest", os.path.join(os.path.dirname(__file__), "../static/src/js/website.tour.event_sale.js")),
|
||||
]
|
||||
|
||||
@openerp.tests.common.at_install(False)
|
||||
|
|
|
@ -2,13 +2,12 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<template id="debugger" inherit_id="website.debugger" name="Event Debugger">
|
||||
<xpath expr='//t[@t-set="debugger_hook"]' position="after">
|
||||
<script type="text/javascript" src="/website_event_sale/static/src/js/website.tour.event_sale.js"></script>
|
||||
</xpath>
|
||||
<template id="assets_editor" inherit_id="website.assets_frontend" name="Event Sale">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_event_sale/static/src/js/website.tour.event_sale.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
|
||||
<template id="index" inherit_id="website_event.index" name="Event's Ticket">
|
||||
<xpath expr="//li[@t-foreach='event_ids']/div/h4" position="before">
|
||||
<t t-if="event.state in ['draft', 'confirm'] and event.event_ticket_ids">
|
||||
|
|
|
@ -3,28 +3,18 @@
|
|||
|
||||
var website = openerp.website;
|
||||
var _t = openerp._t;
|
||||
website.add_template_file('/website_forum/static/src/xml/website_forum.xml');
|
||||
|
||||
website.EditorBar.include({
|
||||
start: function() {
|
||||
website.is_editable_button = website.is_editable_button || !!$("#wrap").size();
|
||||
var res = this._super();
|
||||
this.$(".dropdown:has(.oe_content_menu)").removeClass("hidden");
|
||||
return res;
|
||||
},
|
||||
events: _.extend({}, website.EditorBar.prototype.events, {
|
||||
'click a[data-action=new_forum]': function (ev) {
|
||||
ev.preventDefault();
|
||||
website.prompt({
|
||||
id: "editor_new_forum",
|
||||
window_title: _t("New Forum"),
|
||||
input: "Forum Name",
|
||||
}).then(function (forum_name) {
|
||||
website.form('/forum/new', 'POST', {
|
||||
forum_name: forum_name
|
||||
});
|
||||
website.EditorBarContent.include({
|
||||
new_forum: function() {
|
||||
website.prompt({
|
||||
id: "editor_new_forum",
|
||||
window_title: _t("New Forum"),
|
||||
input: "Forum Name",
|
||||
}).then(function (forum_name) {
|
||||
website.form('/forum/new', 'POST', {
|
||||
forum_name: forum_name
|
||||
});
|
||||
}
|
||||
}),
|
||||
});
|
||||
},
|
||||
});
|
||||
})();
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<templates id="template" xml:space="preserve">
|
||||
<t t-extend="website.editorbar">
|
||||
<t t-jquery="ul.oe_content_menu" t-operation="append">
|
||||
<li><a href="#" data-action="new_forum">New Forum</a></li>
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
|
@ -1019,5 +1019,12 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<!-- User Navbar -->
|
||||
<template id="content_new_forum" inherit_id="website.user_navbar" groups="base.group_user">
|
||||
<xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
|
||||
<li><a href="#" data-action="new_forum">New Forum</a></li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -59,7 +59,7 @@ class website_hr_recruitment(http.Controller):
|
|||
'countries': countries
|
||||
})
|
||||
|
||||
@http.route('/jobs/add', type='http', auth="user", methods=['POST'], website=True)
|
||||
@http.route('/jobs/add', type='http', auth="user", website=True)
|
||||
def jobs_add(self, **kwargs):
|
||||
cr, uid, context = request.cr, request.uid, request.context
|
||||
value = {
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
(function() {
|
||||
"use strict";
|
||||
var website = openerp.website;
|
||||
website.add_template_file('/website_hr_recruitment/static/src/xml/website_hr_recruitment.xml');
|
||||
|
||||
website.EditorBar.include({
|
||||
start: function() {
|
||||
website.is_editable_button = website.is_editable_button || !!$("#wrap.js_hr_recruitment").size();
|
||||
var res = this._super();
|
||||
this.$(".dropdown:has(.oe_content_menu)").removeClass("hidden");
|
||||
return res;
|
||||
},
|
||||
});
|
||||
})();
|
|
@ -1,7 +0,0 @@
|
|||
<templates id="template" xml:space="preserve">
|
||||
<t t-extend="website.editorbar">
|
||||
<t t-jquery="ul.oe_content_menu" t-operation="append">
|
||||
<li><a href="/jobs/add" class="js_link2post">New Job Offer</a></li>
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
|
@ -2,12 +2,6 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<template id="assets_editor" inherit_id="website.assets_editor" name="Jobs Editor" groups="base.group_hr_manager">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_hr_recruitment/static/src/js/website_hr_recruitment.editor.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="job_footer_custom" inherit_id="website.footer_default" name="Footer Job Link">
|
||||
<xpath expr="//div[@id='info']/ul" position="inside">
|
||||
<li><a href="/jobs">Jobs</a></li>
|
||||
|
@ -291,5 +285,12 @@
|
|||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- User Navbar -->
|
||||
<template id="content_new_job_offer" inherit_id="website.user_navbar" groups="base.group_hr_manager">
|
||||
<xpath expr="//ul[@id='oe_systray']/li/ul[@class='dropdown-menu oe_content_menu']" position="inside">
|
||||
<li><a href="/jobs/add" class="js_link2post">New Job Offer</a></li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue