- Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]
+ Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]
- Base
+ Base
- Amount
+ Amount
@@ -361,7 +358,7 @@
- Fiscal Position Remark :
+ Fiscal Position Remark :
[[ (o.fiscal_position and o.fiscal_position.note and format(o.fiscal_position.note)) or removeParentNode('blockTable') ]]
diff --git a/addons/account/wizard/pos_box.py b/addons/account/wizard/pos_box.py
index bd38e6bbed6..4b7e63585d8 100644
--- a/addons/account/wizard/pos_box.py
+++ b/addons/account/wizard/pos_box.py
@@ -22,7 +22,7 @@ class CashBox(osv.osv_memory):
records = self.pool[active_model].browse(cr, uid, active_ids, context=context)
- return self._run(cr, uid, ids, records, context=None)
+ return self._run(cr, uid, ids, records, context=context)
def _run(self, cr, uid, ids, records, context=None):
for box in self.browse(cr, uid, ids, context=context):
diff --git a/addons/account_followup/account_followup_customers.xml b/addons/account_followup/account_followup_customers.xml
index 6893abe012e..fba0bce460b 100644
--- a/addons/account_followup/account_followup_customers.xml
+++ b/addons/account_followup/account_followup_customers.xml
@@ -9,11 +9,12 @@
res.partner
-
+
+
@@ -97,7 +98,7 @@
+ groups="account.group_account_user"/>
diff --git a/addons/account_followup/report/account_followup_report.xml b/addons/account_followup/report/account_followup_report.xml
index 6fee6a77ac1..b7c38e89f5e 100644
--- a/addons/account_followup/report/account_followup_report.xml
+++ b/addons/account_followup/report/account_followup_report.xml
@@ -6,7 +6,7 @@
account_followup.stat.tree
account_followup.stat
-
+
diff --git a/addons/account_payment/wizard/account_payment_order.py b/addons/account_payment/wizard/account_payment_order.py
index 08d36c45eff..03e25dfbc45 100644
--- a/addons/account_payment/wizard/account_payment_order.py
+++ b/addons/account_payment/wizard/account_payment_order.py
@@ -23,6 +23,7 @@ import time
from lxml import etree
from openerp.osv import fields, osv
+from openerp.tools.translate import _
class payment_order_create(osv.osv_memory):
"""
@@ -108,7 +109,7 @@ class payment_order_create(osv.osv_memory):
context.update({'line_ids': line_ids})
model_data_ids = mod_obj.search(cr, uid,[('model', '=', 'ir.ui.view'), ('name', '=', 'view_create_payment_order_lines')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
- return {'name': ('Entrie Lines'),
+ return {'name': _('Entry Lines'),
'context': context,
'view_type': 'form',
'view_mode': 'form',
diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py
index ad28bbb1d57..891837f8813 100644
--- a/addons/auth_signup/res_users.py
+++ b/addons/auth_signup/res_users.py
@@ -56,19 +56,22 @@ class res_partner(osv.Model):
def _get_signup_url_for_action(self, cr, uid, ids, action='login', view_type=None, menu_id=None, res_id=None, model=None, context=None):
""" generate a signup url for the given partner ids and action, possibly overriding
the url state components (menu_id, id, view_type) """
+ if context is None:
+ context= {}
res = dict.fromkeys(ids, False)
base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')
for partner in self.browse(cr, uid, ids, context):
# when required, make sure the partner has a valid signup token
- if context and context.get('signup_valid') and not partner.user_ids:
+ if context.get('signup_valid') and not partner.user_ids:
self.signup_prepare(cr, uid, [partner.id], context=context)
partner.refresh()
# the parameters to encode for the query and fragment part of url
query = {'db': cr.dbname}
- fragment = {'action': action, 'type': partner.signup_type}
+ signup_type = context.get('signup_force_type_in_url', partner.signup_type or '')
+ fragment = {'action': action, 'type': signup_type}
- if partner.signup_token:
+ if partner.signup_token and signup_type:
fragment['token'] = partner.signup_token
elif partner.user_ids:
fragment['db'] = cr.dbname
diff --git a/addons/auth_signup/static/src/js/auth_signup.js b/addons/auth_signup/static/src/js/auth_signup.js
index 545ee6cf60e..b825d683099 100644
--- a/addons/auth_signup/static/src/js/auth_signup.js
+++ b/addons/auth_signup/static/src/js/auth_signup.js
@@ -7,7 +7,7 @@ openerp.auth_signup = function(instance) {
var self = this;
this.signup_enabled = false;
this.reset_password_enabled = false;
- return this._super().then(function() {
+ return this._super().always(function() {
// Switches the login box to the select mode whith mode == [default|signup|reset]
self.on('change:login_mode', self, function() {
diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py
index 9309f790013..3497255fa76 100644
--- a/addons/base_action_rule/base_action_rule.py
+++ b/addons/base_action_rule/base_action_rule.py
@@ -66,6 +66,7 @@ class base_action_rule(osv.osv):
[('on_create', 'On Creation'), ('on_write', 'On Update'), ('on_time', 'Based on Timed Condition')],
string='When to Run'),
'trg_date_id': fields.many2one('ir.model.fields', string='Trigger Date',
+ help="When should the condition be triggered. If present, will be checked by the scheduler. If empty, will be checked at creation and update.",
domain="[('model_id', '=', model_id), ('ttype', 'in', ('date', 'datetime'))]"),
'trg_date_range': fields.integer('Delay after trigger date',
help="Delay after the trigger date." \
diff --git a/addons/base_vat/base_vat.py b/addons/base_vat/base_vat.py
index e7501334997..52db18b7307 100644
--- a/addons/base_vat/base_vat.py
+++ b/addons/base_vat/base_vat.py
@@ -83,6 +83,8 @@ class res_partner(osv.osv):
Check the VAT number depending of the country.
http://sima-pc.com/nif.php
'''
+ if not ustr(country_code).encode('utf-8').isalpha():
+ return False
check_func_name = 'check_vat_' + country_code
check_func = getattr(self, check_func_name, None) or \
getattr(vatnumber, check_func_name, None)
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 455ad89003c..b8673e73927 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -77,12 +77,12 @@ class crm_lead(base_stage, format_address, osv.osv):
_track = {
'state': {
- 'crm.mt_lead_create': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'new',
+ 'crm.mt_lead_create': lambda self, cr, uid, obj, ctx=None: obj['state'] in ['new', 'draft'],
'crm.mt_lead_won': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'done',
'crm.mt_lead_lost': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'cancel',
},
'stage_id': {
- 'crm.mt_lead_stage': lambda self, cr, uid, obj, ctx=None: obj['state'] not in ['new', 'cancel', 'done'],
+ 'crm.mt_lead_stage': lambda self, cr, uid, obj, ctx=None: obj['state'] not in ['new', 'draft', 'cancel', 'done'],
},
}
@@ -103,7 +103,9 @@ class crm_lead(base_stage, format_address, osv.osv):
if vals.get('type'):
ctx['default_type'] = vals['type']
vals['stage_id'] = self._get_default_stage_id(cr, uid, context=ctx)
- return super(crm_lead, self).create(cr, uid, vals, context=context)
+ # context: no_log, because subtype already handle this
+ create_context = dict(context, mail_create_nolog=True)
+ return super(crm_lead, self).create(cr, uid, vals, context=create_context)
def _get_default_section_id(self, cr, uid, context=None):
""" Gives default section by checking if present in the context """
@@ -678,8 +680,9 @@ class crm_lead(base_stage, format_address, osv.osv):
merged_data['stage_id'] = section_stage_ids and section_stage_ids[0] or False
# Write merged data into first opportunity
self.write(cr, uid, [highest.id], merged_data, context=context)
- # Delete tail opportunities
- self.unlink(cr, uid, [x.id for x in tail_opportunities], context=context)
+ # Delete tail opportunities
+ # We use the SUPERUSER to avoid access rights issues because as the user had the rights to see the records it should be safe to do so
+ self.unlink(cr, SUPERUSER_ID, [x.id for x in tail_opportunities], context=context)
return highest.id
diff --git a/addons/crm_partner_assign/wizard/crm_forward_to_partner.py b/addons/crm_partner_assign/wizard/crm_forward_to_partner.py
index 924f96180cc..724102a84b1 100644
--- a/addons/crm_partner_assign/wizard/crm_forward_to_partner.py
+++ b/addons/crm_partner_assign/wizard/crm_forward_to_partner.py
@@ -124,6 +124,7 @@ class crm_lead_forward_to_partner(osv.TransientModel):
lead_ids = context and context.get('active_ids', []) or []
value = self.default_get(cr, uid, ['body', 'email_to', 'email_cc', 'subject', 'history_mode'], context=context)
value.pop('composition_mode')
+ self.pool.get('crm.lead').message_subscribe(cr, uid, lead_ids, [partner.id for partner in wizard.partner_ids], context=context)
self.write(cr, uid, ids, value, context=context)
return self.send_mail(cr, uid, ids, context=context)
diff --git a/addons/document_page/document_page_view.xml b/addons/document_page/document_page_view.xml
index 08c77647d17..4d0b5596e75 100644
--- a/addons/document_page/document_page_view.xml
+++ b/addons/document_page/document_page_view.xml
@@ -26,6 +26,7 @@
+
diff --git a/addons/fetchmail/security/ir.model.access.csv b/addons/fetchmail/security/ir.model.access.csv
index 7deea6eb9f4..c006546659f 100644
--- a/addons/fetchmail/security/ir.model.access.csv
+++ b/addons/fetchmail/security/ir.model.access.csv
@@ -1,3 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_fetchmail_server,fetchmail.server,model_fetchmail_server,,1,0,0,0
access_fetchmail_server,fetchmail.server,model_fetchmail_server,base.group_system,1,1,1,1
diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py
index 73daa64f841..8d707baa50e 100644
--- a/addons/hr_expense/hr_expense.py
+++ b/addons/hr_expense/hr_expense.py
@@ -57,10 +57,7 @@ class hr_expense_expense(osv.osv):
def _get_currency(self, cr, uid, context=None):
user = self.pool.get('res.users').browse(cr, uid, [uid], context=context)[0]
- if user.company_id:
- return user.company_id.currency_id.id
- else:
- return self.pool.get('res.currency').search(cr, uid, [('rate','=',1.0)], context=context)[0]
+ return user.company_id.currency_id.id
_name = "hr.expense.expense"
_inherit = ['mail.thread']
@@ -99,11 +96,13 @@ class hr_expense_expense(osv.osv):
('cancelled', 'Refused'),
('confirm', 'Waiting Approval'),
('accepted', 'Approved'),
- ('done', 'Done'),
+ ('done', 'Waiting Payment'),
+ ('paid', 'Paid'),
],
'Status', readonly=True, track_visibility='onchange',
help='When the expense request is created the status is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the status is \'Waiting Confirmation\'.\
- \nIf the admin accepts it, the status is \'Accepted\'.\n If a receipt is made for the expense request, the status is \'Done\'.'),
+ \nIf the admin accepts it, the status is \'Accepted\'.\n If the accounting entries are made for the expense request, the status is \'Waiting Payment\'.'),
+
}
_defaults = {
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'hr.employee', context=c),
@@ -114,6 +113,12 @@ class hr_expense_expense(osv.osv):
'currency_id': _get_currency,
}
+ def copy(self, cr, uid, id, default=None, context=None):
+ if default is None:
+ default = {}
+ default.update(account_move_id=False)
+ return super(hr_expense_expense, self).copy(cr, uid, id, default=default, context=context)
+
def unlink(self, cr, uid, ids, context=None):
for rec in self.browse(cr, uid, ids, context=context):
if rec.state != 'draft':
@@ -282,7 +287,6 @@ class hr_expense_expense(osv.osv):
tax_code_found= False
#Calculate tax according to default tax on product
-
taxes = []
#Taken from product_id_onchange in account.invoice
if line.product_id:
@@ -319,8 +323,11 @@ class hr_expense_expense(osv.osv):
tax_code_found = True
res[-1]['tax_code_id'] = tax_code_id
res[-1]['tax_amount'] = cur_obj.compute(cr, uid, exp.currency_id.id, company_currency, tax_amount, context={'date': exp.date_confirm})
-
- #Will create the tax here as we don't have the access
+ ##
+ is_price_include = tax_obj.read(cr,uid,tax['id'],['price_include'],context)['price_include']
+ if is_price_include:
+ ## We need to deduce the price for the tax
+ res[-1]['price'] = res[-1]['price'] - (tax['amount'] * tax['base_sign'] or 0.0)
assoc_tax = {
'type':'tax',
'name':tax['name'],
@@ -449,4 +456,26 @@ class hr_expense_line(osv.osv):
return res
+class account_move_line(osv.osv):
+ _inherit = "account.move.line"
+
+ def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context=None):
+ res = super(account_move_line, self).reconcile(cr, uid, ids, type=type, writeoff_acc_id=writeoff_acc_id, writeoff_period_id=writeoff_period_id, writeoff_journal_id=writeoff_journal_id, context=context)
+ #when making a full reconciliation of account move lines 'ids', we may need to recompute the state of some hr.expense
+ account_move_ids = [aml.move_id.id for aml in self.browse(cr, uid, ids, context=context)]
+ expense_obj = self.pool.get('hr.expense.expense')
+ currency_obj = self.pool.get('res.currency')
+ if account_move_ids:
+ expense_ids = expense_obj.search(cr, uid, [('account_move_id', 'in', account_move_ids)], context=context)
+ for expense in expense_obj.browse(cr, uid, expense_ids, context=context):
+ if expense.state == 'done':
+ #making the postulate it has to be set paid, then trying to invalidate it
+ new_status_is_paid = True
+ for aml in expense.account_move_id.line_id:
+ if aml.account_id.type == 'payable' and not currency_obj.is_zero(cr, uid, expense.company_id.currency_id, aml.amount_residual):
+ new_status_is_paid = False
+ if new_status_is_paid:
+ expense_obj.write(cr, uid, [expense.id], {'state': 'paid'}, context=context)
+ return res
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml
index 10abe95d892..ca882406d63 100644
--- a/addons/hr_expense/hr_expense_view.xml
+++ b/addons/hr_expense/hr_expense_view.xml
@@ -68,7 +68,7 @@
-
+
diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml
index 5828790c152..5ffbff10040 100644
--- a/addons/hr_holidays/hr_holidays_view.xml
+++ b/addons/hr_holidays/hr_holidays_view.xml
@@ -40,8 +40,8 @@
Leave Request
hr.holidays
-
-
+
+
diff --git a/addons/hr_timesheet_sheet/static/src/js/timesheet.js b/addons/hr_timesheet_sheet/static/src/js/timesheet.js
index fe7d0c82767..e7d13c425b6 100644
--- a/addons/hr_timesheet_sheet/static/src/js/timesheet.js
+++ b/addons/hr_timesheet_sheet/static/src/js/timesheet.js
@@ -163,24 +163,42 @@ openerp.hr_timesheet_sheet = function(instance) {
this.dfm = undefined;
}
},
+ is_valid_value:function(value){
+ var split_value = value.split(":");
+ var valid_value = true;
+ if (split_value.length > 2)
+ return false;
+ _.detect(split_value,function(num){
+ if(isNaN(num)){
+ valid_value = false;
+ }
+ });
+ return valid_value;
+ },
display_data: function() {
var self = this;
self.$el.html(QWeb.render("hr_timesheet_sheet.WeeklyTimesheet", {widget: self}));
_.each(self.accounts, function(account) {
_.each(_.range(account.days.length), function(day_count) {
if (!self.get('effective_readonly')) {
- self.get_box(account, day_count).val(self.sum_box(account, day_count)).change(function() {
- var num = Number($(this).val());
+ self.get_box(account, day_count).val(self.sum_box(account, day_count, true)).change(function() {
+ var num = $(this).val();
+ if (self.is_valid_value(num)){
+ num = (num == 0)?0:Number(self.parse_client(num));
+ }
if (isNaN(num)) {
- $(this).val(self.sum_box(account, day_count));
+ $(this).val(self.sum_box(account, day_count, true));
} else {
account.days[day_count].lines[0].unit_amount += num - self.sum_box(account, day_count);
self.display_totals();
self.sync();
+ if(!isNaN($(this).val())){
+ $(this).val(self.sum_box(account, day_count, true));
+ }
}
});
} else {
- self.get_box(account, day_count).html(self.sum_box(account, day_count));
+ self.get_box(account, day_count).html(self.sum_box(account, day_count, true));
}
});
});
@@ -247,12 +265,12 @@ openerp.hr_timesheet_sheet = function(instance) {
get_super_total: function() {
return this.$('.oe_timesheet_weekly_supertotal');
},
- sum_box: function(account, day_count) {
+ sum_box: function(account, day_count, show_value_in_hour) {
var line_total = 0;
_.each(account.days[day_count].lines, function(line) {
line_total += line.unit_amount;
});
- return line_total;
+ return (show_value_in_hour && line_total != 0)?this.format_client(line_total):line_total;
},
display_totals: function() {
var self = this;
@@ -266,12 +284,12 @@ openerp.hr_timesheet_sheet = function(instance) {
day_tots[day_count] += sum;
super_tot += sum;
});
- self.get_total(account).html(acc_tot);
+ self.get_total(account).html(self.format_client(acc_tot));
});
_.each(_.range(self.dates.length), function(day_count) {
- self.get_day_total(day_count).html(day_tots[day_count]);
+ self.get_day_total(day_count).html(self.format_client(day_tots[day_count]));
});
- self.get_super_total().html(super_tot);
+ self.get_super_total().html(self.format_client(super_tot));
},
sync: function() {
var self = this;
@@ -279,6 +297,14 @@ openerp.hr_timesheet_sheet = function(instance) {
self.set({sheets: this.generate_o2m_value()});
self.setting = false;
},
+ //converts hour value to float
+ parse_client: function(value) {
+ return instance.web.parse_value(value, { type:"float_time" });
+ },
+ //converts float value to hour
+ format_client:function(value){
+ return instance.web.format_value(value, { type:"float_time" });
+ },
generate_o2m_value: function() {
var self = this;
var ops = [];
diff --git a/addons/im/im.py b/addons/im/im.py
index 0de9ea8c79b..cee1705ec35 100644
--- a/addons/im/im.py
+++ b/addons/im/im.py
@@ -90,79 +90,6 @@ POLL_TIMER = 30
DISCONNECTION_TIMER = POLL_TIMER + 5
WATCHER_ERROR_DELAY = 10
-if openerp.evented:
- import gevent
- import gevent.event
-
- class ImWatcher(object):
- watchers = {}
-
- @staticmethod
- def get_watcher(db_name):
- if not ImWatcher.watchers.get(db_name):
- ImWatcher(db_name)
- return ImWatcher.watchers[db_name]
-
- def __init__(self, db_name):
- self.db_name = db_name
- ImWatcher.watchers[db_name] = self
- self.waiting = 0
- self.wait_id = 0
- self.users = {}
- self.users_watch = {}
- gevent.spawn(self.loop)
-
- def loop(self):
- _logger.info("Begin watching on channel im_channel for database " + self.db_name)
- stop = False
- while not stop:
- try:
- registry = openerp.modules.registry.RegistryManager.get(self.db_name)
- with registry.cursor() as cr:
- listen_channel(cr, "im_channel", self.handle_message, self.check_stop)
- stop = True
- except:
- # if something crash, we wait some time then try again
- _logger.exception("Exception during watcher activity")
- time.sleep(WATCHER_ERROR_DELAY)
- _logger.info("End watching on channel im_channel for database " + self.db_name)
- del ImWatcher.watchers[self.db_name]
-
- def handle_message(self, message):
- if message["type"] == "message":
- for waiter in self.users.get(message["receiver"], {}).values():
- waiter.set()
- else: #type status
- for waiter in self.users_watch.get(message["user"], {}).values():
- waiter.set()
-
- def check_stop(self):
- return self.waiting == 0
-
- def _get_wait_id(self):
- self.wait_id += 1
- return self.wait_id
-
- def stop(self, user_id, watch_users, timeout=None):
- wait_id = self._get_wait_id()
- event = gevent.event.Event()
- self.waiting += 1
- self.users.setdefault(user_id, {})[wait_id] = event
- for watch in watch_users:
- self.users_watch.setdefault(watch, {})[wait_id] = event
- try:
- event.wait(timeout)
- finally:
- for watch in watch_users:
- del self.users_watch[watch][wait_id]
- if len(self.users_watch[watch]) == 0:
- del self.users_watch[watch]
- del self.users[user_id][wait_id]
- if len(self.users[user_id]) == 0:
- del self.users[user_id]
- self.waiting -= 1
-
-
class LongPollingController(openerp.addons.web.http.Controller):
_cp_path = '/longpolling/im'
@@ -171,6 +98,7 @@ class LongPollingController(openerp.addons.web.http.Controller):
assert_uuid(uuid)
if not openerp.evented:
raise Exception("Not usable in a server not running gevent")
+ from openerp.addons.im.watcher import ImWatcher
if db is not None:
req.session._db = db
req.session._uid = uid
diff --git a/addons/im/security/ir.model.access.csv b/addons/im/security/ir.model.access.csv
index ed639353e21..db3fe77f690 100644
--- a/addons/im/security/ir.model.access.csv
+++ b/addons/im/security/ir.model.access.csv
@@ -1,3 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_im_message,im.message,model_im_message,base.group_user,1,0,1,0
-access_im_user,im.user,model_im_user,base.group_user,1,1,1,0
\ No newline at end of file
+access_im_user,im.user,model_im_user,,1,1,1,0
\ No newline at end of file
diff --git a/addons/im/static/src/audio/Ting.mp3 b/addons/im/static/src/audio/Ting.mp3
index 6fd090a89ce..ffbb77144b2 100644
Binary files a/addons/im/static/src/audio/Ting.mp3 and b/addons/im/static/src/audio/Ting.mp3 differ
diff --git a/addons/im/static/src/audio/Ting.ogg b/addons/im/static/src/audio/Ting.ogg
index 8d17ea85bd3..74ee13a4e5a 100644
Binary files a/addons/im/static/src/audio/Ting.ogg and b/addons/im/static/src/audio/Ting.ogg differ
diff --git a/addons/im/static/src/js/im.js b/addons/im/static/src/js/im.js
index b21a339cb84..a271c9eccf0 100644
--- a/addons/im/static/src/js/im.js
+++ b/addons/im/static/src/js/im.js
@@ -284,6 +284,10 @@ openerp.im = function(instance) {
return this.activated;
},
create_ting: function() {
+ if (typeof(Audio) === "undefined") {
+ this.ting = {play: function() {}};
+ return;
+ }
var kitten = jQuery.param !== undefined && jQuery.deparam(jQuery.param.querystring()).kitten !== undefined;
this.ting = new Audio(instance.webclient.session.origin + "/im/static/src/audio/" + (kitten ? "purr" : "Ting") +
(new Audio().canPlayType("audio/ogg; codecs=vorbis") ? ".ogg" : ".mp3"));
@@ -408,6 +412,9 @@ openerp.im = function(instance) {
return;
}
var mes = this.$("input").val();
+ if (! mes.trim()) {
+ return;
+ }
this.$("input").val("");
var send_it = _.bind(function() {
var model = new instance.web.Model("im.message");
diff --git a/addons/im/watcher.py b/addons/im/watcher.py
new file mode 100644
index 00000000000..b8cb74df5ba
--- /dev/null
+++ b/addons/im/watcher.py
@@ -0,0 +1,84 @@
+
+import openerp
+import openerp.tools.config
+import openerp.modules.registry
+from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
+import datetime
+from openerp.osv import osv, fields
+import time
+import logging
+import json
+import select
+import gevent
+import gevent.event
+from openerp.addons.im.im import *
+
+_logger = logging.getLogger(__name__)
+
+class ImWatcher(object):
+ watchers = {}
+
+ @staticmethod
+ def get_watcher(db_name):
+ if not ImWatcher.watchers.get(db_name):
+ ImWatcher(db_name)
+ return ImWatcher.watchers[db_name]
+
+ def __init__(self, db_name):
+ self.db_name = db_name
+ ImWatcher.watchers[db_name] = self
+ self.waiting = 0
+ self.wait_id = 0
+ self.users = {}
+ self.users_watch = {}
+ gevent.spawn(self.loop)
+
+ def loop(self):
+ _logger.info("Begin watching on channel im_channel for database " + self.db_name)
+ stop = False
+ while not stop:
+ try:
+ registry = openerp.modules.registry.RegistryManager.get(self.db_name)
+ with registry.cursor() as cr:
+ listen_channel(cr, "im_channel", self.handle_message, self.check_stop)
+ stop = True
+ except:
+ # if something crash, we wait some time then try again
+ _logger.exception("Exception during watcher activity")
+ time.sleep(WATCHER_ERROR_DELAY)
+ _logger.info("End watching on channel im_channel for database " + self.db_name)
+ del ImWatcher.watchers[self.db_name]
+
+ def handle_message(self, message):
+ if message["type"] == "message":
+ for waiter in self.users.get(message["receiver"], {}).values():
+ waiter.set()
+ else: #type status
+ for waiter in self.users_watch.get(message["user"], {}).values():
+ waiter.set()
+
+ def check_stop(self):
+ return self.waiting == 0
+
+ def _get_wait_id(self):
+ self.wait_id += 1
+ return self.wait_id
+
+ def stop(self, user_id, watch_users, timeout=None):
+ wait_id = self._get_wait_id()
+ event = gevent.event.Event()
+ self.waiting += 1
+ self.users.setdefault(user_id, {})[wait_id] = event
+ for watch in watch_users:
+ self.users_watch.setdefault(watch, {})[wait_id] = event
+ try:
+ event.wait(timeout)
+ finally:
+ for watch in watch_users:
+ del self.users_watch[watch][wait_id]
+ if len(self.users_watch[watch]) == 0:
+ del self.users_watch[watch]
+ del self.users[user_id][wait_id]
+ if len(self.users[user_id]) == 0:
+ del self.users[user_id]
+ self.waiting -= 1
diff --git a/addons/im_livechat/security/ir.model.access.csv b/addons/im_livechat/security/ir.model.access.csv
index 6e17c1a127f..0dcf0bdee6f 100644
--- a/addons/im_livechat/security/ir.model.access.csv
+++ b/addons/im_livechat/security/ir.model.access.csv
@@ -2,5 +2,7 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_ls_chann1,im_livechat.channel,model_im_livechat_channel,,1,0,0,0
access_ls_chann2,im_livechat.channel,model_im_livechat_channel,group_im_livechat,1,1,1,0
access_ls_chann3,im_livechat.channel,model_im_livechat_channel,group_im_livechat_manager,1,1,1,1
+access_ls_message_portal,im_livechat.im.message.portal,im.model_im_message,portal.group_portal,0,0,0,0
+access_im_user_portal,im_livechat.im.user.portal,im.model_im_user,portal.group_portal,1,0,0,0
access_ls_message,im_livechat.im.message,im.model_im_message,portal.group_anonymous,0,0,0,0
access_im_user,im_livechat.im.user,im.model_im_user,portal.group_anonymous,1,0,0,0
\ No newline at end of file
diff --git a/addons/im_livechat/static/ext/static/audio/Ting.mp3 b/addons/im_livechat/static/ext/static/audio/Ting.mp3
index 6fd090a89ce..ffbb77144b2 100644
Binary files a/addons/im_livechat/static/ext/static/audio/Ting.mp3 and b/addons/im_livechat/static/ext/static/audio/Ting.mp3 differ
diff --git a/addons/im_livechat/static/ext/static/audio/Ting.ogg b/addons/im_livechat/static/ext/static/audio/Ting.ogg
index 8d17ea85bd3..74ee13a4e5a 100644
Binary files a/addons/im_livechat/static/ext/static/audio/Ting.ogg and b/addons/im_livechat/static/ext/static/audio/Ting.ogg differ
diff --git a/addons/im_livechat/static/ext/static/js/livesupport.js b/addons/im_livechat/static/ext/static/js/livesupport.js
index 0b9e52d2c07..c45e9588c83 100644
--- a/addons/im_livechat/static/ext/static/js/livesupport.js
+++ b/addons/im_livechat/static/ext/static/js/livesupport.js
@@ -268,6 +268,10 @@ define(["nova", "underscore", "oeclient", "require", "jquery",
return this.activated;
},
create_ting: function() {
+ if (typeof(Audio) === "undefined") {
+ this.ting = {play: function() {}};
+ return;
+ }
this.ting = new Audio(new Audio().canPlayType("audio/ogg; codecs=vorbis") ?
require.toUrl("../audio/Ting.ogg") :
require.toUrl("../audio/Ting.mp3")
@@ -395,6 +399,9 @@ define(["nova", "underscore", "oeclient", "require", "jquery",
return;
}
var mes = this.$("input").val();
+ if (! mes.trim()) {
+ return;
+ }
this.$("input").val("");
var send_it = _.bind(function() {
var model = connection.getModel("im.message");
diff --git a/addons/l10n_ca/__openerp__.py b/addons/l10n_ca/__openerp__.py
index 05279b6ef8e..945327a06bc 100644
--- a/addons/l10n_ca/__openerp__.py
+++ b/addons/l10n_ca/__openerp__.py
@@ -20,7 +20,7 @@
##############################################################################
{
'name': 'Canada - Accounting',
- 'version': '1.0',
+ 'version': '1.1',
'author': 'Savoir-faire Linux',
'website': 'http://www.savoirfairelinux.com',
'category': 'Localization/Account Charts',
@@ -49,7 +49,7 @@ Canadian accounting charts and localizations.
'account_chart_template_fr.xml',
'account_tax_fr.xml',
'fiscal_templates_fr.xml',
- 'l10n_ca_wizard.xml',
+ 'l10n_ca_wizard.xml'
],
'demo': [],
'installable': True,
diff --git a/addons/l10n_ca/account_tax_en.xml b/addons/l10n_ca/account_tax_en.xml
index 1ff884ac361..afe505f27f5 100644
--- a/addons/l10n_ca/account_tax_en.xml
+++ b/addons/l10n_ca/account_tax_en.xml
@@ -12,7 +12,6 @@
GSTPST_MB_SALE
sale
1
- 1
percent
@@ -39,7 +38,7 @@
PST for sales - 7%
PST
sale
- 0.700000
+ 0.070000
percent
2
@@ -106,7 +105,6 @@
GSTTVQ_SALE
sale
1
- 1
percent
@@ -152,7 +150,6 @@
GSTPST_SK_SALE
sale
1
- 1
percent
@@ -281,7 +278,6 @@
GSTPST_MB_PURC
purchase
1
- 1
percent
@@ -308,7 +304,7 @@
PST for purchases - 7%
PST
purchase
- 0.700000
+ 0.070000
percent
2
@@ -375,7 +371,6 @@
GSTTVQ_PURC
purchase
1
- 1
percent
@@ -421,7 +416,6 @@
GSTPST_SK_PURC
purchase
1
- 1
percent
diff --git a/addons/l10n_ca/account_tax_fr.xml b/addons/l10n_ca/account_tax_fr.xml
index b344feeec83..c34f329be3a 100644
--- a/addons/l10n_ca/account_tax_fr.xml
+++ b/addons/l10n_ca/account_tax_fr.xml
@@ -12,7 +12,6 @@
TPSTVP_MB_SALE
sale
1
- 1
percent
@@ -39,7 +38,7 @@
TVP sur les ventes - 7%
TVP
sale
- 0.700000
+ 0.070000
percent
2
@@ -106,7 +105,6 @@
TPSTVQ_SALE
sale
1
- 1
percent
@@ -152,7 +150,6 @@
TPSTVP_SK_SALE
sale
1
- 1
percent
@@ -281,7 +278,6 @@
TPSTVP_MB_PURC
purchase
1
- 1
percent
@@ -308,7 +304,7 @@
TVP sur les achats - 7%
TVP
purchase
- 0.700000
+ 0.070000
percent
2
@@ -375,7 +371,6 @@
TPSTVQ_PURC
purchase
1
- 1
percent
@@ -421,7 +416,6 @@
TPSTVP_SK_PURC
purchase
1
- 1
percent
diff --git a/addons/l10n_ca/fiscal_templates_en.xml b/addons/l10n_ca/fiscal_templates_en.xml
index 68e881c3541..a3bab5b89dd 100644
--- a/addons/l10n_ca/fiscal_templates_en.xml
+++ b/addons/l10n_ca/fiscal_templates_en.xml
@@ -5,17 +5,17 @@
- Provincial Regime
+ Provincial Regime (PROV)
- Harmonized Provinces Regime (12%)
+ Harmonized Provinces Regime (12%) (BC)
- Harmonized Provinces Regime (13%)
+ Harmonized Provinces Regime (13%) (ON, NB, NL)
@@ -25,17 +25,17 @@
- Harmonized Provinces Regime (15%)
+ Harmonized Provinces Regime (15%) (NS)
- Non-Harmonized Provinces Regime
+ Non-Harmonized Provinces Regime (AB, MB, SK, PE, NT, NU, YT)
- International Regime
+ International Regime (INTL)
diff --git a/addons/l10n_ca/fiscal_templates_fr.xml b/addons/l10n_ca/fiscal_templates_fr.xml
index 3ba13d6642e..b01ab0985ea 100644
--- a/addons/l10n_ca/fiscal_templates_fr.xml
+++ b/addons/l10n_ca/fiscal_templates_fr.xml
@@ -5,7 +5,7 @@
- Régime Provincial
+ Régime Provincial (PROV)
@@ -30,12 +30,12 @@
- Régime Provinces Non-Harmonisées
+ Régime Provinces Non-Harmonisées (AB, MB, SK, PE, NT, NU, YT)
- Régime International
+ Régime International (INTL)
diff --git a/addons/l10n_it/__openerp__.py b/addons/l10n_it/__openerp__.py
index 00ba19e9c42..686fb5ff0d4 100644
--- a/addons/l10n_it/__openerp__.py
+++ b/addons/l10n_it/__openerp__.py
@@ -29,7 +29,7 @@
{
'name': 'Italy - Accounting',
- 'version': '0.1',
+ 'version': '0.2',
'depends': ['base_vat','account_chart','base_iban'],
'author': 'OpenERP Italian Community',
'description': """
diff --git a/addons/l10n_it/data/account.tax.code.template.csv b/addons/l10n_it/data/account.tax.code.template.csv
index d6d6667f43b..e5435945556 100644
--- a/addons/l10n_it/data/account.tax.code.template.csv
+++ b/addons/l10n_it/data/account.tax.code.template.csv
@@ -1,28 +1,37 @@
code,id,name,parent_id:id
,vat_code_chart_root,Tassazione,
IVC,template_ivacode_pagata,IVA a credito,vat_code_chart_root
-IVC0,template_ivacode_pagata_0,Esente IVA (credito),template_ivacode_pagata
+IVCN,template_ivacode_pagata_ind,IVA a credito indetraibile,vat_code_chart_root
+IVC0,template_ivacode_pagata_0,Fuori Campo IVA (credito),template_ivacode_pagata
IVCI,template_impcode_pagata,IVA a credito (imponibile),vat_code_chart_root
-IVC0I,template_impcode_pagata_0,Esente IVA a credito (imponibile),template_impcode_pagata
+IVC0I,template_impcode_pagata_0,Fuori Campo IVA (credito) (imponibile),template_impcode_pagata
+IVCart15,template_ivacode_pagata_art15,Escluso Art.15 (credito),template_ivacode_pagata
+IVCart15I,template_impcode_pagata_art15,Escluso Art.15. (credito) (imponibile),template_impcode_pagata
IVC10,template_ivacode_pagata_10,IVA a credito 10%,template_ivacode_pagata
IVC10I,template_impcode_pagata_10,IVA a credito 10% (imponibile),template_impcode_pagata
-IVC10ind,template_ivacode_pagata_10ind,IVA a credito 10% indetraibile,template_ivacode_pagata
+IVC10ind,template_ivacode_pagata_10ind,IVA a credito 10% indetraibile,template_ivacode_pagata_ind
IVC10Iind,template_impcode_pagata_10ind,IVA a credito 10% indetraibile (imponibile),template_impcode_pagata
-IVC20ind,template_ivacode_pagata_20ind,IVA a credito 20% indetraibile,template_ivacode_pagata
+IVC20ind,template_ivacode_pagata_20ind,IVA a credito 20% indetraibile,template_ivacode_pagata_ind
IVC20Iind,template_impcode_pagata_20ind,IVA a credito 20% indetraibile (imponibile),template_impcode_pagata
-IVC4ind,template_ivacode_pagata_4ind,IVA a credito 4% indetraibile,template_ivacode_pagata
+IVC4ind,template_ivacode_pagata_4ind,IVA a credito 4% indetraibile,template_ivacode_pagata_ind
IVC4Iind,template_impcode_pagata_4ind,IVA a credito 4% indetraibile (imponibile),template_impcode_pagata
IVC20det10,template_ivacode_pagata_20det10,IVA a credito 20% detraibile 10%,template_ivacode_pagata
+IVC20Ndet10,template_ivacode_pagata_20det10ind,IVA a credito 20% detraibile 10% (indetraibile),template_ivacode_pagata_ind
IVC20Idet10,template_impcode_pagata_20det10,IVA a credito 20% detraibile 10% (imponibile),template_impcode_pagata
IVC20det15,template_ivacode_pagata_20det15,IVA a credito 20% detraibile 15%,template_ivacode_pagata
+IVC20Ndet15,template_ivacode_pagata_20det15ind,IVA a credito 20% detraibile 15% (indetraibile),template_ivacode_pagata_ind
IVC20Idet15,template_impcode_pagata_20det15,IVA a credito 20% detraibile 15% (imponibile),template_impcode_pagata
IVC20det40,template_ivacode_pagata_20det40,IVA a credito 20% detraibile 40%,template_ivacode_pagata
+IVC20Ndet40,template_ivacode_pagata_20det40ind,IVA a credito 20% detraibile 40% (indetraibile),template_ivacode_pagata_ind
IVC20Idet40,template_impcode_pagata_20det40,IVA a credito 20% detraibile 40% (imponibile),template_impcode_pagata
IVC20det50,template_ivacode_pagata_20det50,IVA a credito 20% detraibile 50%,template_ivacode_pagata
+IVC20Ndet50,template_ivacode_pagata_20det50ind,IVA a credito 20% detraibile 50% (indetraibile),template_ivacode_pagata_ind
IVC20Idet50,template_impcode_pagata_20det50,IVA a credito 20% detraibile 50% (imponibile),template_impcode_pagata
IVC10det50,template_ivacode_pagata_10det50,IVA a credito 10% detraibile 50%,template_ivacode_pagata
+IVC10Ndet50,template_ivacode_pagata_10det50ind,IVA a credito 10% detraibile 50% (indetraibile),template_ivacode_pagata_ind
IVC10Idet50,template_impcode_pagata_10det50,IVA a credito 10% detraibile 50% (imponibile),template_impcode_pagata
IVC4det50,template_ivacode_pagata_4det50,IVA a credito 4% detraibile 50%,template_ivacode_pagata
+IVC4Ndet50,template_ivacode_pagata_4det50ind,IVA a credito 4% detraibile 50% (indetraibile),template_ivacode_pagata_ind
IVC4Idet50,template_impcode_pagata_4det50,IVA a credito 4% detraibile 50% (imponibile),template_impcode_pagata
IVC20,template_ivacode_pagata_20,IVA a credito 20%,template_ivacode_pagata
IVC20I,template_impcode_pagata_20,IVA a credito 20% (imponibile),template_impcode_pagata
@@ -35,9 +44,11 @@ IVC12I,template_impcode_pagata_12,IVA a credito 12% (imponibile),template_impco
IVC2,template_ivacode_pagata_2,IVA a credito 2%,template_ivacode_pagata
IVC2I,template_impcode_pagata_2,IVA a credito 2% (imponibile),template_impcode_pagata
IVD,template_ivacode_riscossa,IVA a debito,vat_code_chart_root
-IVD0,template_ivacode_riscossa_0,Esente IVA (debito),template_ivacode_riscossa
+IVD0,template_ivacode_riscossa_0,Fuori Campo IVA (debito),template_ivacode_riscossa
IVDI,template_impcode_riscossa,IVA a debito (imponibile),vat_code_chart_root
-IVD0I,template_impcode_riscossa_0,Esente IVA a debito (imponibile),template_impcode_riscossa
+IVD0I,template_impcode_riscossa_0,Fuori Campo IVA (debito) (imponibile),template_impcode_riscossa
+IVDart15,template_ivacode_riscossa_art15,Escluso Art.15 (debito),template_ivacode_riscossa
+IVDart15I,template_impcode_riscossa_art15,Escluso Art.15 (debito) (imponibile),template_impcode_riscossa
IVD10,template_ivacode_riscossa_10,IVA a debito 10%,template_ivacode_riscossa
IVD10I,template_impcode_riscossa_10,IVA a debito 10% (imponibile),template_impcode_riscossa
IVD20,template_ivacode_riscossa_20,IVA a debito 20%,template_ivacode_riscossa
@@ -50,13 +61,17 @@ IVD12,template_ivacode_riscossa_12,IVA a debito 12%,template_ivacode_riscossa
IVD12I,template_impcode_riscossa_12,IVA a debito 12% (imponibile),template_impcode_riscossa
IVD2,template_ivacode_riscossa_2,IVA a debito 2%,template_ivacode_riscossa
IVD2I,template_impcode_riscossa_2,IVA a debito 2% (imponibile),template_impcode_riscossa
-IVC21ind,template_ivacode_pagata_21ind,IVA a credito 21% indetraibile,template_ivacode_pagata
+IVC21ind,template_ivacode_pagata_21ind,IVA a credito 21% indetraibile,template_ivacode_pagata_ind
IVC21Iind,template_impcode_pagata_21ind,IVA a credito 21% indetraibile (imponibile),template_impcode_pagata
IVC21det10,template_ivacode_pagata_21det10,IVA a credito 21% detraibile 10%,template_ivacode_pagata
+IVC21Ndet10,template_ivacode_pagata_21det10ind,IVA a credito 21% detraibile 10% (indetraibile),template_ivacode_pagata_ind
IVC21Idet10,template_impcode_pagata_21det10,IVA a credito 21% detraibile 10% (imponibile),template_impcode_pagata
IVC21det15,template_ivacode_pagata_21det15,IVA a credito 21% detraibile 15%,template_ivacode_pagata
+IVC21Ndet15,template_ivacode_pagata_21det15ind,IVA a credito 21% detraibile 15% (indetraibile),template_ivacode_pagata_ind
IVC21Idet15,template_impcode_pagata_21det15,IVA a credito 21% detraibile 15% (imponibile),template_impcode_pagata
IVC21det40,template_ivacode_pagata_21det40,IVA a credito 21% detraibile 40%,template_ivacode_pagata
+IVC21Ndet40,template_ivacode_pagata_21det40ind,IVA a credito 21% detraibile 40% (indetraibile),template_ivacode_pagata_ind
IVC21Idet40,template_impcode_pagata_21det40,IVA a credito 21% detraibile 40% (imponibile),template_impcode_pagata
IVC21det50,template_ivacode_pagata_21det50,IVA a credito 21% detraibile 50%,template_ivacode_pagata
+IVC21Ndet50,template_ivacode_pagata_21det50ind,IVA a credito 21% detraibile 50% (indetraibile),template_ivacode_pagata_ind
IVC21Idet50,template_impcode_pagata_21det50,IVA a credito 21% detraibile 50% (imponibile),template_impcode_pagata
diff --git a/addons/l10n_it/data/account.tax.template.csv b/addons/l10n_it/data/account.tax.template.csv
index e003afd1a23..5654b32e5e9 100644
--- a/addons/l10n_it/data/account.tax.template.csv
+++ b/addons/l10n_it/data/account.tax.template.csv
@@ -1,71 +1,66 @@
id,description,chart_template_id:id,name,sequence,amount,parent_id:id,child_depend,type,account_collected_id:id,account_paid_id:id,type_tax_use,base_code_id:id,tax_code_id:id,ref_base_code_id:id,ref_tax_code_id:id,ref_base_sign,ref_tax_sign,price_include,base_sign,tax_sign
-21a,21a,l10n_it_chart_template_generic,Iva al 21% (debito),,0.21,,False,percent,2601,2601,sale,template_impcode_riscossa_21,template_ivacode_riscossa_21,template_impcode_riscossa_21,template_ivacode_riscossa_21,-1,-1,False,,
-21b,21b,l10n_it_chart_template_generic,Iva al 21% (credito),,0.21,,False,percent,1601,1601,purchase,template_impcode_pagata_21,template_ivacode_pagata_21,template_impcode_pagata_21,template_ivacode_pagata_21,,,False,-1,-1
-20a,20a,l10n_it_chart_template_generic,Iva al 20% (debito),,0.2,,False,percent,2601,2601,sale,template_impcode_riscossa_20,template_ivacode_riscossa_20,template_impcode_riscossa_20,template_ivacode_riscossa_20,-1,-1,False,,
-20b,20b,l10n_it_chart_template_generic,Iva al 20% (credito),,0.2,,False,percent,1601,1601,purchase,template_impcode_pagata_20,template_ivacode_pagata_20,template_impcode_pagata_20,template_ivacode_pagata_20,,,False,-1,-1
-10a,10a,l10n_it_chart_template_generic,Iva al 10% (debito),,0.1,,False,percent,2601,2601,sale,template_impcode_riscossa_10,template_ivacode_riscossa_10,template_impcode_riscossa_10,template_ivacode_riscossa_10,-1,-1,False,,
-10b,10b,l10n_it_chart_template_generic,Iva al 10% (credito),,0.1,,False,percent,1601,1601,purchase,template_impcode_pagata_10,template_ivacode_pagata_10,template_impcode_pagata_10,template_ivacode_pagata_10,,,False,-1,-1
-10AO,10AO,l10n_it_chart_template_generic,Iva al 10% indetraibile,,0.1,,True,percent,,,purchase,template_impcode_pagata_10ind,,template_impcode_pagata_10ind,,,,False,-1,-1
-10AOa,10AOa,l10n_it_chart_template_generic,Iva al 10% indetraibile (D),2,0,10AO,False,balance,1601,1601,purchase,,template_ivacode_pagata_10ind,,template_ivacode_pagata_10ind,,,False,,
-10AOb,10AOb,l10n_it_chart_template_generic,Iva al 10% indetraibile (I),1,1,10AO,False,percent,,,purchase,,,,,,,False,,
-12a,12a,l10n_it_chart_template_generic,Iva 12% (debito),,0.12,,False,percent,2601,2601,sale,template_impcode_riscossa_12,template_ivacode_riscossa_12,template_impcode_riscossa_12,template_ivacode_riscossa_12,-1,-1,False,,
-12b,12b,l10n_it_chart_template_generic,Iva 12% (credito),,0.12,,False,percent,1601,1601,purchase,template_impcode_pagata_12,template_ivacode_pagata_12,template_impcode_pagata_12,template_ivacode_pagata_12,,,False,-1,-1
-2010,2010,l10n_it_chart_template_generic,Iva al 20% detraibile 10%,,0.2,,True,percent,,,purchase,template_impcode_pagata_20det10,,template_impcode_pagata_20det10,,,,False,-1,-1
-2010a,2010a,l10n_it_chart_template_generic,Iva al 20% detraibile 10% (D),2,0,2010,False,balance,1601,1601,purchase,,template_ivacode_pagata_20det10,,template_ivacode_pagata_20det10,,,False,,
-2010b,2010b,l10n_it_chart_template_generic,Iva al 20% detraibile 10% (I),1,0.9,2010,False,percent,,,purchase,,,,,,,False,,
-2015,2015,l10n_it_chart_template_generic,Iva al 20% detraibile 15%,,0.2,,True,percent,,,purchase,template_impcode_pagata_20det15,,template_impcode_pagata_20det15,,,,False,-1,-1
-2015a,2015a,l10n_it_chart_template_generic,Iva al 20% detraibile 15% (D),2,0,2015,False,balance,1601,1601,purchase,,template_ivacode_pagata_20det15,,template_ivacode_pagata_20det15,,,False,,
-2015b,2015b,l10n_it_chart_template_generic,Iva al 20% detraibile 15% (I),1,0.85,2015,False,percent,,,purchase,,,,,,,False,,
-2040,2040,l10n_it_chart_template_generic,Iva al 20% detraibile 40%,,0.2,,True,percent,,,purchase,template_impcode_pagata_20det40,,template_impcode_pagata_20det40,,,,False,-1,-1
-2040a,2040a,l10n_it_chart_template_generic,Iva al 20% detraibile 40% (D),2,0,2040,False,balance,1601,1601,purchase,,template_ivacode_pagata_20det40,,template_ivacode_pagata_20det40,,,False,,
-2040b,2040b,l10n_it_chart_template_generic,Iva al 20% detraibile 40% (I),1,0.6,2040,False,percent,,,purchase,,,,,,,False,,
-20AO,20AO,l10n_it_chart_template_generic,Iva al 20% indetraibile,,0.2,,True,percent,,,purchase,template_impcode_pagata_20ind,,template_impcode_pagata_20ind,,,,False,-1,-1
-20AOa,20AOa,l10n_it_chart_template_generic,Iva al 20% indetraibile (D),2,0,20AO,False,balance,1601,1601,purchase,,template_ivacode_pagata_20ind,,template_ivacode_pagata_20ind,,,False,,
-20AOb,20AOb,l10n_it_chart_template_generic,Iva al 20% indetraibile (I),1,1,20AO,False,percent,,,purchase,,,,,,,False,,
-20I5,20I5,l10n_it_chart_template_generic,IVA al 20% detraibile al 50%,,0.2,,True,percent,,,purchase,template_impcode_pagata_20det50,,template_impcode_pagata_20det50,,,,False,-1,-1
-20I5b,20I5b,l10n_it_chart_template_generic,IVA al 20% detraibile al 50% (I),1,0.5,20I5,False,percent,,,purchase,,,,,,,False,,
-20I5a,20I5a,l10n_it_chart_template_generic,IVA al 20% detraibile al 50% (D),2,0,20I5,False,balance,1601,1601,purchase,,template_ivacode_pagata_20det50,,template_ivacode_pagata_20det50,,,False,,
-22a,22a,l10n_it_chart_template_generic,Iva 2% (debito),,0.02,,False,percent,2601,2601,sale,template_impcode_riscossa_2,template_ivacode_riscossa_2,template_impcode_riscossa_2,template_ivacode_riscossa_2,-1,-1,False,,
-22b,22b,l10n_it_chart_template_generic,Iva 2% (credito),,0.02,,False,percent,1601,1601,purchase,template_impcode_pagata_2,template_ivacode_pagata_2,template_impcode_pagata_2,template_ivacode_pagata_2,,,False,-1,-1
-4a,4a,l10n_it_chart_template_generic,Iva 4% (debito),,0.04,,False,percent,2601,2601,sale,template_impcode_riscossa_4,template_ivacode_riscossa_4,template_impcode_riscossa_4,template_ivacode_riscossa_4,-1,-1,False,,
-4b,4b,l10n_it_chart_template_generic,Iva 4% (credito),,0.04,,False,percent,1601,1601,purchase,template_impcode_pagata_4,template_ivacode_pagata_4,template_impcode_pagata_4,template_ivacode_pagata_4,,,False,-1,-1
-4AO,4AO,l10n_it_chart_template_generic,Iva al 4% indetraibile,,0.04,,True,percent,,,purchase,template_impcode_pagata_4ind,,template_impcode_pagata_4ind,,,,False,-1,-1
-4AOa,4AOa,l10n_it_chart_template_generic,Iva al 4% indetraibile (D),2,0,4AO,False,balance,1601,1601,purchase,,template_ivacode_pagata_4ind,,template_ivacode_pagata_4ind,,,False,,
-4AOb,4AOb,l10n_it_chart_template_generic,Iva al 4% indetraibile (I),1,1,4AO,False,percent,,,purchase,,,,,,,False,,
-10I5,10I5,l10n_it_chart_template_generic,IVA al 10% detraibile al 50%,,0.1,,True,percent,,,purchase,template_impcode_pagata_10det50,,template_impcode_pagata_10det50,,,,False,-1,-1
-10I5a,10I5a,l10n_it_chart_template_generic,IVA al 10% detraibile al 50% (D),2,0,10I5,False,balance,1601,1601,purchase,,template_ivacode_pagata_10det50,,template_ivacode_pagata_10det50,,,False,,
-10I5b,10I5b,l10n_it_chart_template_generic,IVA al 10% detraibile al 50% (I),1,0.5,10I5,False,percent,,,purchase,,,,,,,False,,
-4I5,4I5,l10n_it_chart_template_generic,IVA al 4% detraibile al 50%,,0.04,,True,percent,,,purchase,template_impcode_pagata_4det50,,template_impcode_pagata_4det50,,,,False,-1,-1
-4I5a,4I5a,l10n_it_chart_template_generic,IVA al 4% detraibile al 50% (D),2,0,4I5,False,balance,1601,1601,purchase,,template_ivacode_pagata_4det50,,template_ivacode_pagata_4det50,,,False,,
-4I5b,4I5b,l10n_it_chart_template_generic,IVA al 4% detraibile al 50% (I),1,0.5,4I5,False,percent,,,purchase,,,,,,,False,,
-00a,00a,l10n_it_chart_template_generic,Esente IVA (debito),,0,,False,percent,2601,2601,sale,template_impcode_riscossa_0,template_ivacode_riscossa_0,template_impcode_riscossa_0,template_ivacode_riscossa_0,-1,-1,False,,
-00b,00b,l10n_it_chart_template_generic,Esente IVA (credito),,0,,False,percent,1601,1601,purchase,template_impcode_pagata_0,template_ivacode_pagata_0,template_impcode_pagata_0,template_ivacode_pagata_0,,,False,-1,-1
-21a INC,21a INC,l10n_it_chart_template_generic,Iva al 21% (debito) INC,,0.21,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_21,l10n_it.template_ivacode_riscossa_21,l10n_it.template_impcode_riscossa_21,l10n_it.template_ivacode_riscossa_21,-1,-1,True,,
-21b INC,21b INC,l10n_it_chart_template_generic,Iva al 21% (credito) INC,,0.21,,False,percent,1601,1601,purchase,template_impcode_pagata_21,template_ivacode_pagata_21,template_impcode_pagata_21,template_ivacode_pagata_21,,,True,-1,-1
-20a INC,20a INC,l10n_it_chart_template_generic,Iva al 20% (debito) INC,,0.2,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_20,l10n_it.template_ivacode_riscossa_20,l10n_it.template_impcode_riscossa_20,l10n_it.template_ivacode_riscossa_20,-1,-1,True,,
-20b INC,20b INC,l10n_it_chart_template_generic,Iva al 20% (credito) INC,,0.2,,False,percent,1601,1601,purchase,template_impcode_pagata_20,template_ivacode_pagata_20,template_impcode_pagata_20,template_ivacode_pagata_20,,,True,-1,-1
-10a INC,10a INC,l10n_it_chart_template_generic,Iva al 10% (debito) INC,,0.1,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_10,l10n_it.template_ivacode_riscossa_10,l10n_it.template_impcode_riscossa_10,l10n_it.template_ivacode_riscossa_10,-1,-1,True,,
-10b INC,10b INC,l10n_it_chart_template_generic,Iva al 10% (credito) INC,,0.1,,False,percent,1601,1601,purchase,template_impcode_pagata_10,template_ivacode_pagata_10,template_impcode_pagata_10,template_ivacode_pagata_10,,,True,-1,-1
-12a INC,12a INC,l10n_it_chart_template_generic,Iva 12% (debito) INC,,0.12,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_12,l10n_it.template_ivacode_riscossa_12,l10n_it.template_impcode_riscossa_12,l10n_it.template_ivacode_riscossa_12,-1,-1,True,,
-12b INC,12b INC,l10n_it_chart_template_generic,Iva 12% (credito) INC,,0.12,,False,percent,1601,1601,purchase,template_impcode_pagata_12,template_ivacode_pagata_12,template_impcode_pagata_12,template_ivacode_pagata_12,,,True,-1,-1
-22a INC,22a INC,l10n_it_chart_template_generic,Iva 2% (debito) INC,,0.02,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_2,l10n_it.template_ivacode_riscossa_2,l10n_it.template_impcode_riscossa_2,l10n_it.template_ivacode_riscossa_2,-1,-1,True,,
-22b INC,22b INC,l10n_it_chart_template_generic,Iva 2% (credito) INC,,0.02,,False,percent,1601,1601,purchase,template_impcode_pagata_2,template_ivacode_pagata_2,template_impcode_pagata_2,template_ivacode_pagata_2,,,True,-1,-1
-4a INC,4a INC,l10n_it_chart_template_generic,Iva 4% (debito) INC,,0.04,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_4,l10n_it.template_ivacode_riscossa_4,l10n_it.template_impcode_riscossa_4,l10n_it.template_ivacode_riscossa_4,-1,-1,True,,
-4b INC,4b INC,l10n_it_chart_template_generic,Iva 4% (credito) INC,,0.04,,False,percent,1601,1601,purchase,template_impcode_pagata_4,template_ivacode_pagata_4,template_impcode_pagata_4,template_ivacode_pagata_4,,,True,-1,-1
-00a INC,00a INC,l10n_it_chart_template_generic,Esente IVA (debito) INC,,0,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_0,l10n_it.template_ivacode_riscossa_0,l10n_it.template_impcode_riscossa_0,l10n_it.template_ivacode_riscossa_0,-1,-1,True,,
-2110,2110,l10n_it_chart_template_generic,Iva al 21% detraibile 10%,,0.21,,True,percent,,,purchase,template_impcode_pagata_21det10,,template_impcode_pagata_21det10,,,,False,-1,-1
-2110a,2110a,l10n_it_chart_template_generic,Iva al 21% detraibile 10% (D),2,0,2110,False,balance,1601,1601,purchase,,template_ivacode_pagata_21det10,,template_ivacode_pagata_21det10,,,False,,
-2110b,2110b,l10n_it_chart_template_generic,Iva al 21% detraibile 10% (I),1,0.9,2110,False,percent,,,purchase,,,,,,,False,,
-2115,2115,l10n_it_chart_template_generic,Iva al 21% detraibile 15%,,0.21,,True,percent,,,purchase,template_impcode_pagata_21det15,,template_impcode_pagata_21det15,,,,False,-1,-1
-2115a,2115a,l10n_it_chart_template_generic,Iva al 21% detraibile 15% (D),2,0,2115,False,balance,1601,1601,purchase,,template_ivacode_pagata_21det15,,template_ivacode_pagata_21det15,,,False,,
-2115b,2115b,l10n_it_chart_template_generic,Iva al 21% detraibile 15% (I),1,0.85,2115,False,percent,,,purchase,,,,,,,False,,
-2140,2140,l10n_it_chart_template_generic,Iva al 21% detraibile 40%,,0.21,,True,percent,,,purchase,template_impcode_pagata_21det40,,template_impcode_pagata_21det40,,,,False,-1,-1
-2140a,2140a,l10n_it_chart_template_generic,Iva al 21% detraibile 40% (D),2,0,2140,False,balance,1601,1601,purchase,,template_ivacode_pagata_21det40,,template_ivacode_pagata_21det40,,,False,,
-2140b,2140b,l10n_it_chart_template_generic,Iva al 21% detraibile 40% (I),1,0.6,2140,False,percent,,,purchase,,,,,,,False,,
-21AO,21AO,l10n_it_chart_template_generic,Iva al 21% indetraibile,,0.21,,True,percent,,,purchase,template_impcode_pagata_21ind,,template_impcode_pagata_21ind,,,,False,-1,-1
-21AOa,21AOa,l10n_it_chart_template_generic,Iva al 21% indetraibile (D),2,0,21AO,False,balance,1601,1601,purchase,,template_ivacode_pagata_21ind,,template_ivacode_pagata_21ind,,,False,,
-21AOb,21AOb,l10n_it_chart_template_generic,Iva al 21% indetraibile (I),1,1,21AO,False,percent,,,purchase,,,,,,,False,,
-21I5,21I5,l10n_it_chart_template_generic,IVA al 21% detraibile al 50%,,0.21,,True,percent,,,purchase,template_impcode_pagata_21det50,,template_impcode_pagata_21det50,,,,False,-1,-1
-21I5b,21I5b,l10n_it_chart_template_generic,IVA al 21% detraibile al 50% (I),1,0.5,21I5,False,percent,,,purchase,,,,,,,False,,
-21I5a,21I5a,l10n_it_chart_template_generic,IVA al 21% detraibile al 50% (D),2,0,21I5,False,balance,1601,1601,purchase,,template_ivacode_pagata_21det50,,template_ivacode_pagata_21det50,,,False,,
-
+21v,21v,l10n_it_chart_template_generic,Iva al 21% (debito),1,0.21,,False,percent,2601,2601,sale,template_impcode_riscossa_21,template_ivacode_riscossa_21,template_impcode_riscossa_21,template_ivacode_riscossa_21,-1,-1,False,1,1
+21a,21a,l10n_it_chart_template_generic,Iva al 21% (credito),2,0.21,,False,percent,1601,1601,purchase,template_impcode_pagata_21,template_ivacode_pagata_21,template_impcode_pagata_21,template_ivacode_pagata_21,1,1,False,-1,-1
+20v,20v,l10n_it_chart_template_generic,Iva al 20% (debito),3,0.2,,False,percent,2601,2601,sale,template_impcode_riscossa_20,template_ivacode_riscossa_20,template_impcode_riscossa_20,template_ivacode_riscossa_20,-1,-1,False,1,1
+20a,20a,l10n_it_chart_template_generic,Iva al 20% (credito),4,0.2,,False,percent,1601,1601,purchase,template_impcode_pagata_20,template_ivacode_pagata_20,template_impcode_pagata_20,template_ivacode_pagata_20,1,1,False,-1,-1
+10v,10v,l10n_it_chart_template_generic,Iva al 10% (debito),5,0.1,,False,percent,2601,2601,sale,template_impcode_riscossa_10,template_ivacode_riscossa_10,template_impcode_riscossa_10,template_ivacode_riscossa_10,-1,-1,False,1,1
+10a,10a,l10n_it_chart_template_generic,Iva al 10% (credito),6,0.1,,False,percent,1601,1601,purchase,template_impcode_pagata_10,template_ivacode_pagata_10,template_impcode_pagata_10,template_ivacode_pagata_10,1,1,False,-1,-1
+10AO,10AO,l10n_it_chart_template_generic,Iva al 10% indetraibile,7,0.1,,True,percent,,,purchase,template_impcode_pagata_10ind,,template_impcode_pagata_10ind,,1,1,False,-1,-1
+10AOb,10AOb,l10n_it_chart_template_generic,Iva al 10% indetraibile (D),200,0,10AO,False,balance,1601,1601,purchase,,template_ivacode_pagata_10,,template_ivacode_pagata_10,1,1,False,-1,-1
+10AOa,10AOa,l10n_it_chart_template_generic,Iva al 10% indetraibile (I),100,1,10AO,False,percent,,,purchase,,template_ivacode_pagata_10ind,,template_ivacode_pagata_10ind,1,1,False,-1,-1
+12v,12v,l10n_it_chart_template_generic,Iva 12% (debito),8,0.12,,False,percent,2601,2601,sale,template_impcode_riscossa_12,template_ivacode_riscossa_12,template_impcode_riscossa_12,template_ivacode_riscossa_12,-1,-1,False,1,1
+12a,12a,l10n_it_chart_template_generic,Iva 12% (credito),9,0.12,,False,percent,1601,1601,purchase,template_impcode_pagata_12,template_ivacode_pagata_12,template_impcode_pagata_12,template_ivacode_pagata_12,1,1,False,-1,-1
+2010,2010,l10n_it_chart_template_generic,Iva al 20% detraibile 10%,10,0.2,,True,percent,,,purchase,template_impcode_pagata_20det10,,template_impcode_pagata_20det10,,1,1,False,-1,-1
+2010b,2010b,l10n_it_chart_template_generic,Iva al 20% detraibile 10% (D),200,0,2010,False,balance,1601,1601,purchase,,template_ivacode_pagata_20det10,,template_ivacode_pagata_20det10,1,1,False,-1,-1
+2010a,2010a,l10n_it_chart_template_generic,Iva al 20% detraibile 10% (I),100,0.9,2010,False,percent,,,purchase,,template_ivacode_pagata_20det10ind,,template_ivacode_pagata_20det10ind,1,1,False,-1,-1
+2015,2015,l10n_it_chart_template_generic,Iva al 20% detraibile 15%,11,0.2,,True,percent,,,purchase,template_impcode_pagata_20det15,,template_impcode_pagata_20det15,,1,1,False,-1,-1
+2015b,2015b,l10n_it_chart_template_generic,Iva al 20% detraibile 15% (D),200,0,2015,False,balance,1601,1601,purchase,,template_ivacode_pagata_20det15,,template_ivacode_pagata_20det15,1,1,False,-1,-1
+2015a,2015a,l10n_it_chart_template_generic,Iva al 20% detraibile 15% (I),100,0.85,2015,False,percent,,,purchase,,template_ivacode_pagata_20det15ind,,template_ivacode_pagata_20det15ind,1,1,False,-1,-1
+2040,2040,l10n_it_chart_template_generic,Iva al 20% detraibile 40%,12,0.2,,True,percent,,,purchase,template_impcode_pagata_20det40,,template_impcode_pagata_20det40,,1,1,False,-1,-1
+2040b,2040b,l10n_it_chart_template_generic,Iva al 20% detraibile 40% (D),200,0,2040,False,balance,1601,1601,purchase,,template_ivacode_pagata_20det40,,template_ivacode_pagata_20det40,1,1,False,-1,-1
+2040a,2040a,l10n_it_chart_template_generic,Iva al 20% detraibile 40% (I),100,0.6,2040,False,percent,,,purchase,,template_ivacode_pagata_20det40ind,,template_ivacode_pagata_20det40ind,1,1,False,-1,-1
+20AO,20AO,l10n_it_chart_template_generic,Iva al 20% indetraibile,13,0.2,,True,percent,,,purchase,template_impcode_pagata_20ind,,template_impcode_pagata_20ind,,1,1,False,-1,-1
+20AOb,20AOb,l10n_it_chart_template_generic,Iva al 20% indetraibile (D),200,0,20AO,False,balance,1601,1601,purchase,,template_ivacode_pagata_20ind,,template_ivacode_pagata_20ind,1,1,False,-1,-1
+20AOa,20AOa,l10n_it_chart_template_generic,Iva al 20% indetraibile (I),100,1,20AO,False,percent,,,purchase,,template_ivacode_pagata_20ind,,template_ivacode_pagata_20ind,1,1,False,-1,-1
+20I5,20I5,l10n_it_chart_template_generic,IVA al 20% detraibile al 50%,14,0.2,,True,percent,,,purchase,template_impcode_pagata_20det50,,template_impcode_pagata_20det50,,1,1,False,-1,-1
+20I5b,20I5b,l10n_it_chart_template_generic,IVA al 20% detraibile al 50% (D),200,0,20I5,False,balance,1601,1601,purchase,,template_ivacode_pagata_20det50,,template_ivacode_pagata_20det50,1,1,False,-1,-1
+20I5a,20I5a,l10n_it_chart_template_generic,IVA al 20% detraibile al 50% (I),100,0.5,20I5,False,percent,,,purchase,,template_ivacode_pagata_20det50ind,,template_ivacode_pagata_20det50ind,1,1,False,-1,-1
+22v,22v,l10n_it_chart_template_generic,Iva 2% (debito),15,0.02,,False,percent,2601,2601,sale,template_impcode_riscossa_2,template_ivacode_riscossa_2,template_impcode_riscossa_2,template_ivacode_riscossa_2,-1,-1,False,1,1
+22a,22a,l10n_it_chart_template_generic,Iva 2% (credito),16,0.02,,False,percent,1601,1601,purchase,template_impcode_pagata_2,template_ivacode_pagata_2,template_impcode_pagata_2,template_ivacode_pagata_2,1,1,False,-1,-1
+4v,4v,l10n_it_chart_template_generic,Iva 4% (debito),17,0.04,,False,percent,2601,2601,sale,template_impcode_riscossa_4,template_ivacode_riscossa_4,template_impcode_riscossa_4,template_ivacode_riscossa_4,-1,-1,False,1,1
+4a,4a,l10n_it_chart_template_generic,Iva 4% (credito),18,0.04,,False,percent,1601,1601,purchase,template_impcode_pagata_4,template_ivacode_pagata_4,template_impcode_pagata_4,template_ivacode_pagata_4,1,1,False,-1,-1
+4AO,4AO,l10n_it_chart_template_generic,Iva al 4% indetraibile,19,0.04,,True,percent,,,purchase,template_impcode_pagata_4ind,,template_impcode_pagata_4ind,,1,1,False,-1,-1
+4AOb,4AOb,l10n_it_chart_template_generic,Iva al 4% indetraibile (D),200,0,4AO,False,balance,1601,1601,purchase,,template_ivacode_pagata_4ind,,template_ivacode_pagata_4ind,1,1,False,-1,-1
+4AOa,4AOa,l10n_it_chart_template_generic,Iva al 4% indetraibile (I),100,1,4AO,False,percent,,,purchase,,template_ivacode_pagata_4ind,,template_ivacode_pagata_4ind,1,1,False,-1,-1
+10I5,10I5,l10n_it_chart_template_generic,IVA al 10% detraibile al 50%,20,0.1,,True,percent,,,purchase,template_impcode_pagata_10det50,,template_impcode_pagata_10det50,,1,1,False,-1,-1
+10I5b,10I5b,l10n_it_chart_template_generic,IVA al 10% detraibile al 50% (D),200,0,10I5,False,balance,1601,1601,purchase,,template_ivacode_pagata_10det50,,template_ivacode_pagata_10det50,1,1,False,-1,-1
+10I5a,10I5a,l10n_it_chart_template_generic,IVA al 10% detraibile al 50% (I),100,0.5,10I5,False,percent,,,purchase,,template_ivacode_pagata_10det50ind,,template_ivacode_pagata_10det50ind,1,1,False,-1,-1
+4I5,4I5,l10n_it_chart_template_generic,IVA al 4% detraibile al 50%,21,0.04,,True,percent,,,purchase,template_impcode_pagata_4det50,,template_impcode_pagata_4det50,,1,1,False,-1,-1
+4I5b,4I5b,l10n_it_chart_template_generic,IVA al 4% detraibile al 50% (D),200,0,4I5,False,balance,1601,1601,purchase,,template_ivacode_pagata_4det50,,template_ivacode_pagata_4det50,1,1,False,-1,-1
+4I5a,4I5a,l10n_it_chart_template_generic,IVA al 4% detraibile al 50% (I),100,0.5,4I5,False,percent,,,purchase,,template_ivacode_pagata_4det50ind,,template_ivacode_pagata_4det50ind,1,1,False,-1,-1
+00v,00v,l10n_it_chart_template_generic,Fuori Campo IVA (debito),22,0,,False,percent,2601,2601,sale,template_impcode_riscossa_0,template_ivacode_riscossa_0,template_impcode_riscossa_0,template_ivacode_riscossa_0,-1,-1,False,1,1
+00a,00a,l10n_it_chart_template_generic,Fuori Campo IVA (credito),23,0,,False,percent,1601,1601,purchase,template_impcode_pagata_0,template_ivacode_pagata_0,template_impcode_pagata_0,template_ivacode_pagata_0,1,1,False,-1,-1
+00art15v,00art15v,l10n_it_chart_template_generic,Imponibile Escluso Art.15 (debito),22,0,,False,percent,2601,2601,sale,template_impcode_riscossa_art15,template_ivacode_riscossa_art15,template_impcode_riscossa_art15,template_ivacode_riscossa_art15,-1,-1,False,1,1
+00art15a,00art15a,l10n_it_chart_template_generic,Imponibile Escluso Art.15 (credito),23,0,,False,percent,1601,1601,purchase,template_impcode_pagata_art15,template_ivacode_pagata_art15,template_impcode_pagata_art15,template_ivacode_pagata_art15,1,1,False,-1,-1
+21v INC,21v INC,l10n_it_chart_template_generic,Iva al 21% (debito) INC,24,0.21,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_21,l10n_it.template_ivacode_riscossa_21,l10n_it.template_impcode_riscossa_21,l10n_it.template_ivacode_riscossa_21,-1,-1,True,1,1
+20v INC,20v INC,l10n_it_chart_template_generic,Iva al 20% (debito) INC,25,0.2,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_20,l10n_it.template_ivacode_riscossa_20,l10n_it.template_impcode_riscossa_20,l10n_it.template_ivacode_riscossa_20,-1,-1,True,1,1
+10v INC,10v INC,l10n_it_chart_template_generic,Iva al 10% (debito) INC,26,0.1,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_10,l10n_it.template_ivacode_riscossa_10,l10n_it.template_impcode_riscossa_10,l10n_it.template_ivacode_riscossa_10,-1,-1,True,1,1
+12v INC,12v INC,l10n_it_chart_template_generic,Iva 12% (debito) INC,27,0.12,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_12,l10n_it.template_ivacode_riscossa_12,l10n_it.template_impcode_riscossa_12,l10n_it.template_ivacode_riscossa_12,-1,-1,True,1,1
+22v INC,22v INC,l10n_it_chart_template_generic,Iva 2% (debito) INC,28,0.02,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_2,l10n_it.template_ivacode_riscossa_2,l10n_it.template_impcode_riscossa_2,l10n_it.template_ivacode_riscossa_2,-1,-1,True,1,1
+4v INC,4v INC,l10n_it_chart_template_generic,Iva 4% (debito) INC,29,0.04,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_4,l10n_it.template_ivacode_riscossa_4,l10n_it.template_impcode_riscossa_4,l10n_it.template_ivacode_riscossa_4,-1,-1,True,1,1
+00v INC,00v INC,l10n_it_chart_template_generic,Fuori Campo IVA (debito) INC,30,0,,False,percent,l10n_it.2601,l10n_it.2601,sale,l10n_it.template_impcode_riscossa_0,l10n_it.template_ivacode_riscossa_0,l10n_it.template_impcode_riscossa_0,l10n_it.template_ivacode_riscossa_0,-1,-1,True,1,1
+2110,2110,l10n_it_chart_template_generic,Iva al 21% detraibile 10%,31,0.21,,True,percent,,,purchase,template_impcode_pagata_21det10,,template_impcode_pagata_21det10,,1,1,False,-1,-1
+2110b,2110b,l10n_it_chart_template_generic,Iva al 21% detraibile 10% (D),200,0,2110,False,balance,1601,1601,purchase,,template_ivacode_pagata_21det10,,template_ivacode_pagata_21det10,1,1,False,-1,-1
+2110a,2110a,l10n_it_chart_template_generic,Iva al 21% detraibile 10% (I),100,0.9,2110,False,percent,,,purchase,,template_ivacode_pagata_21det10ind,,template_ivacode_pagata_21det10ind,1,1,False,-1,-1
+2115,2115,l10n_it_chart_template_generic,Iva al 21% detraibile 15%,32,0.21,,True,percent,,,purchase,template_impcode_pagata_21det15,,template_impcode_pagata_21det15,,1,1,False,-1,-1
+2115b,2115b,l10n_it_chart_template_generic,Iva al 21% detraibile 15% (D),200,0,2115,False,balance,1601,1601,purchase,,template_ivacode_pagata_21det15,,template_ivacode_pagata_21det15,1,1,False,-1,-1
+2115a,2115a,l10n_it_chart_template_generic,Iva al 21% detraibile 15% (I),100,0.85,2115,False,percent,,,purchase,,template_ivacode_pagata_21det15ind,,template_ivacode_pagata_21det15ind,1,1,False,-1,-1
+2140,2140,l10n_it_chart_template_generic,Iva al 21% detraibile 40%,33,0.21,,True,percent,,,purchase,template_impcode_pagata_21det40,,template_impcode_pagata_21det40,,1,1,False,-1,-1
+2140b,2140b,l10n_it_chart_template_generic,Iva al 21% detraibile 40% (D),200,0,2140,False,balance,1601,1601,purchase,,template_ivacode_pagata_21det40,,template_ivacode_pagata_21det40,1,1,False,-1,-1
+2140a,2140a,l10n_it_chart_template_generic,Iva al 21% detraibile 40% (I),100,0.6,2140,False,percent,,,purchase,,template_ivacode_pagata_21det40ind,,template_ivacode_pagata_21det40ind,1,1,False,-1,-1
+21AO,21AO,l10n_it_chart_template_generic,Iva al 21% indetraibile,34,0.21,,True,percent,,,purchase,template_impcode_pagata_21ind,,template_impcode_pagata_21ind,,1,1,False,-1,-1
+21AOb,21AOb,l10n_it_chart_template_generic,Iva al 21% indetraibile (D),200,0,21AO,False,balance,1601,1601,purchase,,template_ivacode_pagata_21ind,,template_ivacode_pagata_21ind,1,1,False,-1,-1
+21AOa,21AOa,l10n_it_chart_template_generic,Iva al 21% indetraibile (I),100,1,21AO,False,percent,,,purchase,,template_ivacode_pagata_21ind,,template_ivacode_pagata_21ind,1,1,False,-1,-1
+21I5,21I5,l10n_it_chart_template_generic,IVA al 21% detraibile al 50%,35,0.21,,True,percent,,,purchase,template_impcode_pagata_21det50,,template_impcode_pagata_21det50,,1,1,False,-1,-1
+21I5b,21I5b,l10n_it_chart_template_generic,IVA al 21% detraibile al 50% (D),200,0,21I5,False,balance,1601,1601,purchase,,template_ivacode_pagata_21det50,,template_ivacode_pagata_21det50,1,1,False,-1,-1
+21I5a,21I5a,l10n_it_chart_template_generic,IVA al 21% detraibile al 50% (I),100,0.5,21I5,False,percent,,,purchase,,template_ivacode_pagata_21det50ind,,template_ivacode_pagata_21det50ind,1,1,False,-1,-1
diff --git a/addons/l10n_lu/account_financial_report.xml b/addons/l10n_lu/account_financial_report.xml
index b39b0ceb15f..62a7a8c8d7e 100644
--- a/addons/l10n_lu/account_financial_report.xml
+++ b/addons/l10n_lu/account_financial_report.xml
@@ -84,7 +84,7 @@
- 2. Concessions, brevets, licences, marques, ainsi que droits et valeurs similaires s’ils ont été
+ 2. Concessions, brevets, licences, marques, ainsi que droits et valeurs similaires s’ils ont été
115
detail_flat
@@ -256,7 +256,7 @@
- I. Stocks
+ I. Stocks
153
detail_flat
@@ -292,7 +292,7 @@
- 4. Acomptes versés
+ 4. Acomptes versés
161
no_detail
@@ -301,7 +301,7 @@
- II. Créances
+ II. Créances
163
detail_flat
@@ -364,7 +364,7 @@
- 3. Créances sur des entreprises avec lesquelles la société a un
+ 3. Créances sur des entreprises avec lesquelles la société a un lien de participation
177
detail_flat
@@ -436,7 +436,7 @@
- 2. Actions propres ou parts propres
+ 2. Actions propres ou parts propres
193
no_detail
@@ -445,7 +445,7 @@
- 3. Autres valeurs mobilières
+ 3. Autres valeurs mobilières
195
no_detail
@@ -963,7 +963,7 @@
- CHARGES
+ A. CHARGES
641
detail_flat
@@ -972,7 +972,7 @@
- 1. Consommation de marchandises et de matières premières et consommables
+ 1. Consommation de marchandises et de matières premières et consommables
601
no_detail
@@ -1044,7 +1044,7 @@
- a) sur frais d'établissement et sur immobilisations corporelles
+ a) sur frais d'établissement et sur immobilisations corporelles et incorporelles
617
no_detail
@@ -1071,7 +1071,7 @@
- 6. Corrections de valeur sur immobilisations financières et aj
+ 6. Corrections de valeur sur immobilisations financières et ajustement de juste valeur sur immobilisations financières
623
no_detail
@@ -1080,7 +1080,7 @@
- 7. Corrections de valeur et ajustement de juste valeur sur élém
+ 7. Corrections de valeur et ajustement de juste valeur sur éléments financiers de l'actif circulant. Moins-values de cessions des valeurs mobilières
625
no_detail
@@ -1143,7 +1143,7 @@
- PRODUITS
+ B. PRODUITS
737
detail_flat
@@ -1161,7 +1161,7 @@
- 2. Variation des stocks de produits finis, et de produits et de commandes en cours
+ 2. Variation des stocks de produits finis, et de produits et de commandes en cours
703
no_detail
@@ -1188,7 +1188,7 @@
- a) sur frais d'établissement et sur immobilisations corporelles
+ a) sur frais d'établissement et sur immobilisations corporelles et incorporelles
709
no_detail
diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py
index 8fab4347d0d..bd2b9c3f18a 100644
--- a/addons/mail/mail_mail.py
+++ b/addons/mail/mail_mail.py
@@ -60,9 +60,6 @@ class mail_mail(osv.Model):
'recipient_ids': fields.many2many('res.partner', string='To (Partners)'),
'email_cc': fields.char('Cc', help='Carbon copy message recipients'),
'body_html': fields.text('Rich-text Contents', help="Rich-text/HTML message"),
- # If not set in create values, auto-detected based on create values (res_id, model, email_from)
- 'reply_to': fields.char('Reply-To',
- help='Preferred response address for the message'),
# Auto-detected based on create() - if 'mail_message_id' was passed then this mail is a notification
# and during unlink() we will not cascade delete the parent and its attachments
'notification': fields.boolean('Is Notification',
diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py
index c30d00f5af7..252179614c6 100644
--- a/addons/mail/mail_message.py
+++ b/addons/mail/mail_message.py
@@ -158,6 +158,7 @@ class mail_message(osv.Model):
'author_id': fields.many2one('res.partner', 'Author', select=1,
ondelete='set null',
help="Author of the message. If not set, email_from may hold an email address that did not match any partner."),
+ 'author_avatar': fields.related('author_id', 'image_small', type="binary", string="Author's Avatar"),
'partner_ids': fields.many2many('res.partner', string='Recipients'),
'notified_partner_ids': fields.many2many('res.partner', 'mail_notification',
'message_id', 'partner_id', 'Notified partners',
@@ -291,7 +292,7 @@ class mail_message(osv.Model):
}
if starred:
values['read'] = False
-
+
notif_ids = notification_obj.search(cr, uid, domain, context=context)
# all message have notifications: already set them as (un)starred
@@ -398,6 +399,7 @@ class mail_message(osv.Model):
'parent_id': parent_id,
'is_private': is_private,
'author_id': False,
+ 'author_avatar': message.author_avatar,
'is_author': False,
'partner_ids': [],
'vote_nb': vote_nb,
@@ -528,7 +530,6 @@ class mail_message(osv.Model):
message_unload_ids = message_unload_ids if message_unload_ids is not None else []
if message_unload_ids:
domain += [('id', 'not in', message_unload_ids)]
- notification_obj = self.pool.get('mail.notification')
limit = limit or self._message_read_limit
message_tree = {}
message_list = []
@@ -738,12 +739,10 @@ class mail_message(osv.Model):
for model, doc_dict in model_record_ids.items():
model_obj = self.pool[model]
mids = model_obj.exists(cr, uid, doc_dict.keys())
- if operation in ['create', 'write', 'unlink']:
- model_obj.check_access_rights(cr, uid, 'write')
- model_obj.check_access_rule(cr, uid, mids, 'write', context=context)
+ if hasattr(model_obj, 'check_mail_message_access'):
+ model_obj.check_mail_message_access(cr, uid, mids, operation, context=context)
else:
- model_obj.check_access_rights(cr, uid, operation)
- model_obj.check_access_rule(cr, uid, mids, operation, context=context)
+ self.pool['mail.thread'].check_mail_message_access(cr, uid, mids, operation, model_obj=model_obj, context=context)
document_related_ids += [mid for mid, message in message_values.iteritems()
if message.get('model') == model and message.get('res_id') in mids]
diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py
index 80df8ad6e99..a46f416f44b 100644
--- a/addons/mail/mail_thread.py
+++ b/addons/mail/mail_thread.py
@@ -101,12 +101,16 @@ class mail_thread(osv.AbstractModel):
if catchall_domain and model and res_id: # specific res_id -> find its alias (i.e. section_id specified)
object_id = self.pool.get(model).browse(cr, uid, res_id, context=context)
- alias = object_id.alias_id
+ # check that the alias effectively creates new records
+ if object_id.alias_id and object_id.alias_id.alias_model_id and \
+ object_id.alias_id.alias_model_id.model == self._name and \
+ object_id.alias_id.alias_force_thread_id == 0:
+ alias = object_id.alias_id
elif catchall_domain and model: # no specific res_id given -> generic help message, take an example alias (i.e. alias of some section_id)
model_id = self.pool.get('ir.model').search(cr, uid, [("model", "=", self._name)], context=context)[0]
alias_obj = self.pool.get('mail.alias')
- alias_ids = alias_obj.search(cr, uid, [("alias_model_id", "=", model_id)], context=context, limit=1, order='id ASC')
- if alias_ids:
+ alias_ids = alias_obj.search(cr, uid, [("alias_model_id", "=", model_id), ('alias_force_thread_id', '=', 0)], context=context, order='id ASC')
+ if alias_ids and len(alias_ids) == 1: # if several aliases -> incoherent to propose one guessed from nowhere, therefore avoid if several aliases
alias = alias_obj.browse(cr, uid, alias_ids[0], context=context)
if alias:
@@ -281,14 +285,21 @@ class mail_thread(osv.AbstractModel):
context = {}
thread_id = super(mail_thread, self).create(cr, uid, values, context=context)
+ # automatic logging unless asked not to (mainly for various testing purpose)
+ if not context.get('mail_create_nolog'):
+ self.message_post(cr, uid, thread_id, body=_('%s created') % (self._description), context=context)
+
# subscribe uid unless asked not to
if not context.get('mail_create_nosubscribe'):
self.message_subscribe_users(cr, uid, [thread_id], [uid], context=context)
self.message_auto_subscribe(cr, uid, [thread_id], values.keys(), context=context)
- # automatic logging unless asked not to (mainly for various testing purpose)
- if not context.get('mail_create_nolog'):
- self.message_post(cr, uid, thread_id, body=_('%s created') % (self._description), context=context)
+ # track values
+ tracked_fields = self._get_tracked_fields(cr, uid, values.keys(), context=context)
+ if tracked_fields:
+ initial_values = {thread_id: dict((item, False) for item in tracked_fields)}
+ self.message_track(cr, uid, [thread_id], tracked_fields, initial_values, context=context)
+
return thread_id
def write(self, cr, uid, ids, values, context=None):
@@ -449,6 +460,20 @@ class mail_thread(osv.AbstractModel):
ir_attachment_obj.unlink(cr, uid, attach_ids, context=context)
return True
+ def check_mail_message_access(self, cr, uid, mids, operation, model_obj=None, context=None):
+ """ mail.message check permission rules for related document. This method is
+ meant to be inherited in order to implement addons-specific behavior.
+ A common behavior would be to allow creating messages when having read
+ access rule on the document, for portal document such as issues. """
+ if not model_obj:
+ model_obj = self
+ if operation in ['create', 'write', 'unlink']:
+ model_obj.check_access_rights(cr, uid, 'write')
+ model_obj.check_access_rule(cr, uid, mids, 'write', context=context)
+ else:
+ model_obj.check_access_rights(cr, uid, operation)
+ model_obj.check_access_rule(cr, uid, mids, operation, context=context)
+
def _get_formview_action(self, cr, uid, id, model=None, context=None):
""" Return an action to open the document. This method is meant to be
overridden in addons that want to give specific view ids for example.
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index 8631bc70baa..7df6cdbef0d 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -219,6 +219,7 @@ openerp.mail = function (session) {
this.type = datasets.type || false,
this.subtype = datasets.subtype || false,
this.is_author = datasets.is_author || false,
+ this.author_avatar = datasets.author_avatar || false,
this.is_private = datasets.is_private || false,
this.subject = datasets.subject || false,
this.name = datasets.name || false,
@@ -260,8 +261,10 @@ openerp.mail = function (session) {
this.date = this.date ? session.web.str_to_datetime(this.date) : false;
if (this.date && new Date().getTime()-this.date.getTime() < 7*24*60*60*1000) {
this.timerelative = $.timeago(this.date);
- }
- if (this.type == 'email' && (!this.author_id || !this.author_id[0])) {
+ }
+ if (this.author_avatar) {
+ this.avatar = "data:image/png;base64," + this.author_avatar;
+ } else if (this.type == 'email' && (!this.author_id || !this.author_id[0])) {
this.avatar = ('/mail/static/src/img/email_icon.png');
} else if (this.author_id && this.template != 'mail.compose_message') {
this.avatar = mail.ChatterUtils.get_image(this.session, 'res.partner', 'image_small', this.author_id[0]);
@@ -850,9 +853,9 @@ openerp.mail = function (session) {
on_checked_recipient: function (event) {
var $input = $(event.target);
- var email = $input.attr("data");
+ var full_name = $input.attr("data");
_.each(this.recipients, function (recipient) {
- if (recipient.email_address == email) {
+ if (recipient.full_name == full_name) {
recipient.checked = $input.is(":checked");
}
});
diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml
index ab82d650f30..f5004941a8d 100644
--- a/addons/mail/static/src/xml/mail.xml
+++ b/addons/mail/static/src/xml/mail.xml
@@ -143,7 +143,7 @@
-
+
( )
(no email address)
diff --git a/addons/mail/tests/test_mail_gateway.py b/addons/mail/tests/test_mail_gateway.py
index ee166b82dde..5615e22b2c2 100644
--- a/addons/mail/tests/test_mail_gateway.py
+++ b/addons/mail/tests/test_mail_gateway.py
@@ -147,6 +147,8 @@ class TestMailgateway(TestMailBase):
self.assertEqual(mail.reply_to, 'other@example.com',
'mail_mail: reply_to should be equal to the one coming from creation values')
# Do: create a mail_mail with the previous mail_message
+ self.mail_message.write(cr, uid, [msg_id], {'reply_to': 'custom@example.com'})
+ msg.refresh()
mail_id = self.mail_mail.create(cr, uid, {'mail_message_id': msg_id, 'state': 'cancel'})
mail = self.mail_mail.browse(cr, uid, mail_id)
# Test: mail_mail content
@@ -177,12 +179,15 @@ class TestMailgateway(TestMailBase):
mail = self.mail_mail.browse(cr, uid, mail_id)
# Test: mail_mail content
self.assertEqual(mail.reply_to, msg.email_from,
- 'mail_mail: reply_to should equal to mail_message.email_from when having no document or default alias')
+ 'mail_mail: reply_to should be equal to mail_message.email_from when having no document or default alias')
# Data: set catchall domain
self.registry('ir.config_parameter').set_param(cr, uid, 'mail.catchall.domain', 'schlouby.fr')
self.registry('ir.config_parameter').unlink(cr, uid, self.registry('ir.config_parameter').search(cr, uid, [('key', '=', 'mail.catchall.alias')]))
+ # Update message
+ self.mail_message.write(cr, uid, [msg_id], {'email_from': False, 'reply_to': False})
+ msg.refresh()
# Do: create a mail_mail based on the previous mail_message
mail_id = self.mail_mail.create(cr, uid, {'mail_message_id': msg_id, 'state': 'cancel'})
mail = self.mail_mail.browse(cr, uid, mail_id)
@@ -191,7 +196,7 @@ class TestMailgateway(TestMailBase):
'mail_mail: reply_to should equal the mail.group alias')
# Update message
- self.mail_message.write(cr, uid, [msg_id], {'res_id': False, 'email_from': 'someone@schlouby.fr'})
+ self.mail_message.write(cr, uid, [msg_id], {'res_id': False, 'email_from': 'someone@schlouby.fr', 'reply_to': False})
msg.refresh()
# Do: create a mail_mail based on the previous mail_message
mail_id = self.mail_mail.create(cr, uid, {'mail_message_id': msg_id, 'state': 'cancel'})
@@ -203,6 +208,9 @@ class TestMailgateway(TestMailBase):
# Data: set catchall alias
self.registry('ir.config_parameter').set_param(self.cr, self.uid, 'mail.catchall.alias', 'gateway')
+ # Update message
+ self.mail_message.write(cr, uid, [msg_id], {'email_from': False, 'reply_to': False})
+ msg.refresh()
# Do: create a mail_mail based on the previous mail_message
mail_id = self.mail_mail.create(cr, uid, {'mail_message_id': msg_id, 'state': 'cancel'})
mail = self.mail_mail.browse(cr, uid, mail_id)
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py
index dfda3038de8..7bf4d47d1ff 100644
--- a/addons/mail/wizard/mail_compose_message.py
+++ b/addons/mail/wizard/mail_compose_message.py
@@ -270,6 +270,7 @@ class mail_compose_message(osv.TransientModel):
context.pop('default_partner_ids', None)
# post the message
if mass_mail_mode and not wizard.post:
+ post_values['body_html'] = post_values.get('body', '')
post_values['recipient_ids'] = [(4, id) for id in post_values.pop('partner_ids', [])]
self.pool.get('mail.mail').create(cr, uid, post_values, context=context)
else:
diff --git a/addons/mrp/procurement.py b/addons/mrp/procurement.py
index 3ad7155dad6..6347e22d576 100644
--- a/addons/mrp/procurement.py
+++ b/addons/mrp/procurement.py
@@ -33,6 +33,11 @@ class procurement_order(osv.osv):
'production_id': fields.many2one('mrp.production', 'Manufacturing Order'),
}
+ def _prepare_order_line_procurement(self, cr, uid, order, line, move_id, date_planned, context=None):
+ result = super(procurement_order, self)._prepare_order_line_procurement(cr, uid, order, line, move_id, date_planned, context)
+ result['property_ids'] = [(6, 0, [x.id for x in line.property_ids])]
+ return result
+
def check_produce_product(self, cr, uid, procurement, context=None):
''' Depict the capacity of the procurement workflow to produce products (not services)'''
return True
diff --git a/addons/mrp/report/order.rml b/addons/mrp/report/order.rml
index 8833d08e596..f413a6cfc70 100644
--- a/addons/mrp/report/order.rml
+++ b/addons/mrp/report/order.rml
@@ -139,37 +139,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -178,16 +159,16 @@
- Product
+ Product
- Quantity
+ Quantity
- Source Location
+ Source Location
- Destination Location
+ Destination Location
@@ -196,20 +177,20 @@
- Production Order N° : [[ o.name ]]
+ Production Order N° : [[ o.name ]]
- Source Document
+ Source Document
- Product
+ Product
- Quantity
+ Quantity
@@ -232,16 +213,16 @@
- Scheduled Date
+ Scheduled Date
- Printing date
+ Printing date
- Partner Ref
+ Partner Ref
- SO Number
+ SO Number
@@ -266,26 +247,26 @@
- Work Orders [[ o.workcenter_lines ==[] and removeParentNode('para')]]
+ Work Orders [[ o.workcenter_lines ==[] and removeParentNode('para')]]
- Sequence
+ Sequence
- Name [[ o.workcenter_lines ==[] and removeParentNode('blockTable')]]
+ Name [[ o.workcenter_lines ==[] and removeParentNode('blockTable')]]
- WorkCenter
+ WorkCenter
- No. Of Cycles
+ No. Of Cycles
- No. Of Hours
+ No. Of Hours
@@ -317,28 +298,28 @@
- Bill Of Material
+ Bill Of Material
- Product
+ Product
- Quantity
+ Quantity
- Source Location
+ Source Location
- Destination Location
+ Destination Location
- Products to Consume [[ o.move_lines ==[] and removeParentNode('section')]]
+ Products to Consume [[ o.move_lines ==[] and removeParentNode('section')]]
[[ repeatIn(o.move_lines,'line') ]]
@@ -363,7 +344,7 @@
- Consumed Products [[ o.move_lines2 ==[] and removeParentNode('section')]]
+ Consumed Products [[ o.move_lines2 ==[] and removeParentNode('section')]]
[[ repeatIn(o.move_lines2,'line2') ]]
diff --git a/addons/portal/security/portal_security.xml b/addons/portal/security/portal_security.xml
index b2a76800023..02080bdc0ab 100644
--- a/addons/portal/security/portal_security.xml
+++ b/addons/portal/security/portal_security.xml
@@ -5,7 +5,7 @@
res_partner: read access on my partner
- [('user_ids', 'in', user.id)]
+ [('id', 'child_of', user.commercial_partner_id.id)]
diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py
index e363afa47cb..dc3211d0a71 100644
--- a/addons/portal/wizard/portal_wizard.py
+++ b/addons/portal/wizard/portal_wizard.py
@@ -20,7 +20,6 @@
##############################################################################
import logging
-import random
from openerp.osv import fields, osv
from openerp.tools.translate import _
@@ -34,14 +33,15 @@ _logger = logging.getLogger(__name__)
WELCOME_EMAIL_SUBJECT = _("Your OpenERP account at %(company)s")
WELCOME_EMAIL_BODY = _("""Dear %(name)s,
-You have been given access to %(portal)s.
+You have been given access to %(company)s's %(portal)s.
Your login account data is:
-Database: %(db)s
-Username: %(login)s
+ Username: %(login)s
+ Portal: %(portal_url)s
+ Database: %(db)s
-In order to complete the signin process, click on the following url:
-%(url)s
+You can set or change your password via the following url:
+ %(signup_url)s
%(welcome_message)s
@@ -116,24 +116,57 @@ class wizard_user(osv.osv_memory):
_description = 'Portal User Config'
_columns = {
- 'wizard_id': fields.many2one('portal.wizard', string='Wizard', required=True),
+ 'wizard_id': fields.many2one('portal.wizard', string='Wizard', required=True, ondelete='cascade'),
'partner_id': fields.many2one('res.partner', string='Contact', required=True, readonly=True),
'email': fields.char(size=240, string='Email'),
'in_portal': fields.boolean('In Portal'),
}
- def create(self, cr, uid, values, context=None):
- """ overridden to update the partner's email (if necessary) """
- id = super(wizard_user, self).create(cr, uid, values, context)
- wuser = self.browse(cr, uid, id, context)
- if wuser.partner_id.email != wuser.email:
- wuser.partner_id.write({'email': wuser.email})
- return id
+ def get_error_messages(self, cr, uid, ids, context=None):
+ res_users = self.pool.get('res.users')
+ emails = []
+ error_empty = []
+ error_emails = []
+ error_user = []
+ ctx = dict(context or {}, active_test=False)
+ for wizard_user in self.browse(cr, SUPERUSER_ID, ids, context):
+ if wizard_user.in_portal and not self._retrieve_user(cr, SUPERUSER_ID, wizard_user, context):
+ email = extract_email(wizard_user.email)
+ if not email:
+ error_empty.append(wizard_user.partner_id)
+ elif email in emails and email not in error_emails:
+ error_emails.append(wizard_user.partner_id)
+ user = res_users.search(cr, SUPERUSER_ID, [('login', '=', email)], context=ctx)
+ if user:
+ error_user.append(wizard_user.partner_id)
+ emails.append(email)
+
+ error_msg = []
+ if error_empty:
+ error_msg.append("%s\n- %s" % (_("Some contacts don't have a valid email: "),
+ '\n- '.join(['%s' % (p.display_name,) for p in error_empty])))
+ if error_emails:
+ error_msg.append("%s\n- %s" % (_("Several contacts have the same email: "),
+ '\n- '.join([p.email for p in error_emails])))
+ if error_user:
+ error_msg.append("%s\n- %s" % (_("Some contacts have the same email as an existing portal user:"),
+ '\n- '.join(['%s <%s>' % (p.display_name, p.email) for p in error_user])))
+ if error_msg:
+ error_msg.append(_("To resolve this error, you can: \n"
+ "- Correct the emails of the relevant contacts\n"
+ "- Grant access only to contacts with unique emails"))
+ return error_msg
def action_apply(self, cr, uid, ids, context=None):
+ error_msg = self.get_error_messages(cr, uid, ids, context=context)
+ if error_msg:
+ raise osv.except_osv(_('Contacts Error'), "\n\n".join(error_msg))
+
for wizard_user in self.browse(cr, SUPERUSER_ID, ids, context):
portal = wizard_user.wizard_id.portal_id
user = self._retrieve_user(cr, SUPERUSER_ID, wizard_user, context)
+ if wizard_user.partner_id.email != wizard_user.email:
+ wizard_user.partner_id.write({'email': wizard_user.email})
if wizard_user.in_portal:
# create a user if necessary, and make sure it is in the portal group
if not user:
@@ -142,8 +175,8 @@ class wizard_user(osv.osv_memory):
user.write({'active': True, 'groups_id': [(4, portal.id)]})
# prepare for the signup process
user.partner_id.signup_prepare()
- wizard_user = self.browse(cr, SUPERUSER_ID, wizard_user.id, context)
- self._send_email(cr, uid, wizard_user, context)
+ wizard_user.refresh()
+ self._send_email(cr, uid, wizard_user, context)
else:
# remove the user (if it exists) from the portal group
if user and (portal in user.groups_id):
@@ -158,13 +191,11 @@ class wizard_user(osv.osv_memory):
@param wizard_user: browse record of model portal.wizard.user
@return: browse record of model res.users
"""
- if wizard_user.partner_id.user_ids:
- return wizard_user.partner_id.user_ids[0]
- # the user may be inactive, search for it
+ context = dict(context or {}, active_test=False)
res_users = self.pool.get('res.users')
- domain = [('partner_id', '=', wizard_user.partner_id.id), ('active', '=', False)]
- user_ids = res_users.search(cr, uid, domain)
- return user_ids and res_users.browse(cr, uid, user_ids[0], context) or False
+ domain = [('partner_id', '=', wizard_user.partner_id.id)]
+ user_ids = res_users.search(cr, uid, domain, context=context)
+ return user_ids and res_users.browse(cr, uid, user_ids[0], context=context) or False
def _create_user(self, cr, uid, wizard_user, context=None):
""" create a new user for wizard_user.partner_id
@@ -174,6 +205,7 @@ class wizard_user(osv.osv_memory):
res_users = self.pool.get('res.users')
create_context = dict(context or {}, noshortcut=True, no_reset_password=True) # to prevent shortcut creation
values = {
+ 'email': extract_email(wizard_user.email),
'login': extract_email(wizard_user.email),
'partner_id': wizard_user.partner_id.id,
'groups_id': [(6, 0, [])],
@@ -187,6 +219,7 @@ class wizard_user(osv.osv_memory):
@param wizard_user: browse record of model portal.wizard.user
@return: the id of the created mail.mail record
"""
+ res_partner = self.pool['res.partner']
this_context = context
this_user = self.pool.get('res.users').browse(cr, SUPERUSER_ID, uid, context)
if not this_user.email:
@@ -196,6 +229,12 @@ class wizard_user(osv.osv_memory):
# determine subject and body in the portal user's language
user = self._retrieve_user(cr, SUPERUSER_ID, wizard_user, context)
context = dict(this_context or {}, lang=user.lang)
+ ctx_portal_url = dict(context, signup_force_type_in_url='')
+ portal_url = res_partner._get_signup_url_for_action(cr, uid,
+ [user.partner_id.id],
+ context=ctx_portal_url)[user.partner_id.id]
+ res_partner.signup_prepare(cr, uid, [user.partner_id.id], context=context)
+
data = {
'company': this_user.company_id.name,
'portal': wizard_user.wizard_id.portal_id.name,
@@ -203,7 +242,8 @@ class wizard_user(osv.osv_memory):
'db': cr.dbname,
'name': user.name,
'login': user.login,
- 'url': user.signup_url,
+ 'signup_url': user.signup_url,
+ 'portal_url': portal_url,
}
mail_mail = self.pool.get('mail.mail')
mail_values = {
diff --git a/addons/portal_hr_employees/hr_employee_view.xml b/addons/portal_hr_employees/hr_employee_view.xml
index ace0daaff87..eca13258ff9 100644
--- a/addons/portal_hr_employees/hr_employee_view.xml
+++ b/addons/portal_hr_employees/hr_employee_view.xml
@@ -33,8 +33,9 @@
- HR - Employess Kanban
+ HR - Employees Kanban
hr.employee
+
diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index 7f0a28d94dc..76432157555 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -18,6 +18,7 @@
+
diff --git a/addons/project/project.py b/addons/project/project.py
index 5d5abce3066..e907e4b3652 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -85,7 +85,7 @@ class project(osv.osv):
if context and context.get('user_preference'):
cr.execute("""SELECT project.id FROM project_project project
LEFT JOIN account_analytic_account account ON account.id = project.analytic_account_id
- LEFT JOIN project_user_rel rel ON rel.project_id = project.analytic_account_id
+ LEFT JOIN project_user_rel rel ON rel.project_id = project.id
WHERE (account.user_id = %s or rel.uid = %s)"""%(user, user))
return [(r[0]) for r in cr.fetchall()]
return super(project, self).search(cr, user, args, offset=offset, limit=limit, order=order,
@@ -581,12 +581,12 @@ class task(base_stage, osv.osv):
_track = {
'state': {
- 'project.mt_task_new': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'new',
+ 'project.mt_task_new': lambda self, cr, uid, obj, ctx=None: obj['state'] in ['new', 'draft'],
'project.mt_task_started': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'open',
'project.mt_task_closed': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'done',
},
'stage_id': {
- 'project.mt_task_stage': lambda self, cr, uid, obj, ctx=None: obj['state'] not in ['new', 'done', 'open'],
+ 'project.mt_task_stage': lambda self, cr, uid, obj, ctx=None: obj['state'] not in ['new', 'draft', 'done', 'open'],
},
'kanban_state': { # kanban state: tracked, but only block subtype
'project.mt_task_blocked': lambda self, cr, uid, obj, ctx=None: obj['kanban_state'] == 'blocked',
@@ -1120,10 +1120,12 @@ class task(base_stage, osv.osv):
context = {}
if not vals.get('stage_id'):
ctx = context.copy()
- if vals.get('project_id'):
+ if vals.get('project_id'):
ctx['default_project_id'] = vals['project_id']
vals['stage_id'] = self._get_default_stage_id(cr, uid, context=ctx)
- task_id = super(task, self).create(cr, uid, vals, context=context)
+ # context: no_log, because subtype already handle this
+ create_context = dict(context, mail_create_nolog=True)
+ task_id = super(task, self).create(cr, uid, vals, context=create_context)
self._store_history(cr, uid, [task_id], context=context)
return task_id
@@ -1197,6 +1199,17 @@ class task(base_stage, osv.osv):
return [task.project_id.message_get_reply_to()[0] if task.project_id else False
for task in self.browse(cr, uid, ids, context=context)]
+ def check_mail_message_access(self, cr, uid, mids, operation, model_obj=None, context=None):
+ """ mail.message document permission rule: can post a new message if can read
+ because of portal document. """
+ if not model_obj:
+ model_obj = self
+ if operation == 'create':
+ model_obj.check_access_rights(cr, uid, 'read')
+ model_obj.check_access_rule(cr, uid, mids, 'read', context=context)
+ else:
+ return super(task, self).check_mail_message_access(cr, uid, mids, operation, model_obj=model_obj, context=context)
+
def message_new(self, cr, uid, msg, custom_values=None, context=None):
""" Override to updates the document according to the email. """
if custom_values is None: custom_values = {}
@@ -1205,7 +1218,7 @@ class task(base_stage, osv.osv):
'planned_hours': 0.0,
}
defaults.update(custom_values)
- return super(task,self).message_new(cr, uid, msg, custom_values=defaults, context=context)
+ return super(task, self).message_new(cr, uid, msg, custom_values=defaults, context=context)
def message_update(self, cr, uid, ids, msg, update_vals=None, context=None):
""" Override to update the task according to the email. """
diff --git a/addons/project/report/project_cumulative.xml b/addons/project/report/project_cumulative.xml
index c30c91fe6c0..17e059c8de7 100644
--- a/addons/project/report/project_cumulative.xml
+++ b/addons/project/report/project_cumulative.xml
@@ -6,7 +6,7 @@
project.task.history.cumulative.tree
project.task.history.cumulative
-
+
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index a008c670138..8bcac4581c3 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -19,11 +19,12 @@
#
##############################################################################
+from openerp import SUPERUSER_ID
from openerp.addons.base_status.base_stage import base_stage
from openerp.addons.project.project import _TASK_STATE
from openerp.addons.crm import crm
from datetime import datetime
-from openerp.osv import fields,osv
+from openerp.osv import fields, osv, orm
from openerp.tools.translate import _
import binascii
import time
@@ -49,12 +50,12 @@ class project_issue(base_stage, osv.osv):
_track = {
'state': {
- 'project_issue.mt_issue_new': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'new',
+ 'project_issue.mt_issue_new': lambda self, cr, uid, obj, ctx=None: obj['state'] in ['new', 'draft'],
'project_issue.mt_issue_closed': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'done',
'project_issue.mt_issue_started': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'open',
},
'stage_id': {
- 'project_issue.mt_issue_stage': lambda self, cr, uid, obj, ctx=None: obj['state'] not in ['new', 'done', 'open'],
+ 'project_issue.mt_issue_stage': lambda self, cr, uid, obj, ctx=None: obj['state'] not in ['new', 'draft', 'done', 'open'],
},
'kanban_state': {
'project_issue.mt_issue_blocked': lambda self, cr, uid, obj, ctx=None: obj['kanban_state'] == 'blocked',
@@ -69,7 +70,9 @@ class project_issue(base_stage, osv.osv):
if vals.get('project_id'):
ctx['default_project_id'] = vals['project_id']
vals['stage_id'] = self._get_default_stage_id(cr, uid, context=ctx)
- return super(project_issue, self).create(cr, uid, vals, context=context)
+ # context: no_log, because subtype already handle this
+ create_context = dict(context, mail_create_nolog=True)
+ return super(project_issue, self).create(cr, uid, vals, context=create_context)
def _get_default_project_id(self, cr, uid, context=None):
""" Gives default project by checking if present in the context """
@@ -492,13 +495,27 @@ class project_issue(base_stage, osv.osv):
return [issue.project_id.message_get_reply_to()[0] if issue.project_id else False
for issue in self.browse(cr, uid, ids, context=context)]
+ def check_mail_message_access(self, cr, uid, mids, operation, model_obj=None, context=None):
+ """ mail.message document permission rule: can post a new message if can read
+ because of portal document. """
+ if not model_obj:
+ model_obj = self
+ if operation == 'create':
+ model_obj.check_access_rights(cr, uid, 'read')
+ model_obj.check_access_rule(cr, uid, mids, 'read', context=context)
+ else:
+ return super(project_issue, self).check_mail_message_access(cr, uid, mids, operation, model_obj=model_obj, context=context)
+
def message_get_suggested_recipients(self, cr, uid, ids, context=None):
recipients = super(project_issue, self).message_get_suggested_recipients(cr, uid, ids, context=context)
- for issue in self.browse(cr, uid, ids, context=context):
- if issue.email_from:
- self._message_add_suggested_recipient(cr, uid, recipients, issue, email=issue.email_from, reason=_('Customer Email'))
- elif issue.partner_id:
- self._message_add_suggested_recipient(cr, uid, recipients, issue, partner=issue.partner_id, reason=_('Customer'))
+ try:
+ for issue in self.browse(cr, uid, ids, context=context):
+ if issue.partner_id:
+ self._message_add_suggested_recipient(cr, uid, recipients, issue, partner=issue.partner_id, reason=_('Customer'))
+ elif issue.email_from:
+ self._message_add_suggested_recipient(cr, uid, recipients, issue, email=issue.email_from, reason=_('Customer Email'))
+ except (osv.except_osv, orm.except_orm): # no read access rights -> just ignore suggested recipients because this imply modifying followers
+ pass
return recipients
def message_new(self, cr, uid, msg, custom_values=None, context=None):
@@ -560,13 +577,10 @@ class project_issue(base_stage, osv.osv):
"""
if context is None:
context = {}
-
res = super(project_issue, self).message_post(cr, uid, thread_id, body=body, subject=subject, type=type, subtype=subtype, parent_id=parent_id, attachments=attachments, context=context, content_subtype=content_subtype, **kwargs)
-
if thread_id:
- self.write(cr, uid, thread_id, {'date_action_last': time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)}, context=context)
-
- return res
+ self.write(cr, SUPERUSER_ID, thread_id, {'date_action_last': time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)}, context=context)
+ return res
class project(osv.Model):
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index f15355e9cc8..46caba0021e 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -68,15 +68,16 @@
-
+
-
-
+
+
-
+
@@ -150,8 +151,8 @@
-
-
+
+
@@ -160,13 +161,13 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/addons/project_issue_sheet/project_issue_sheet_view.xml b/addons/project_issue_sheet/project_issue_sheet_view.xml
index fb245a0510a..4911cac8f25 100644
--- a/addons/project_issue_sheet/project_issue_sheet_view.xml
+++ b/addons/project_issue_sheet/project_issue_sheet_view.xml
@@ -19,7 +19,8 @@
-
+
diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml
index 4066b6133c1..e61af0c6c32 100644
--- a/addons/project_long_term/project_long_term_view.xml
+++ b/addons/project_long_term/project_long_term_view.xml
@@ -120,7 +120,8 @@
+ name="%(act_project_phases)d" type="action"
+ groups="base.group_user">
Phases
Phase
@@ -322,7 +323,7 @@
-
+
diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml
index 1794bea19c4..6eb1b2167ee 100644
--- a/addons/purchase/report/order.rml
+++ b/addons/purchase/report/order.rml
@@ -94,38 +94,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -136,22 +114,22 @@
- Description
+ Description
- Taxes
+ Taxes
- Date Req.
+ Date Req.
- Qty
+ Qty
- Unit Price
+ Unit Price
- Net Price
+ Net Price
@@ -165,7 +143,7 @@
- Shipping address :
+ Shipping address :
[[ (o.dest_address_id and o.dest_address_id.name) or (o.warehouse_id and o.warehouse_id.name) or '']]
[[ (o.dest_address_id and display_address(o.dest_address_id)) or (o.warehouse_id and display_address(o.warehouse_id.partner_id)) or '']]
@@ -195,24 +173,24 @@
- [[ o.state=='draft' and removeParentNode('para') ]] Purchase Order Confirmation N° [[ o.name ]]
- [[ o.state<>'draft' and removeParentNode('para') ]] Request for Quotation N° [[ o.name ]]
+ [[ o.state=='draft' and removeParentNode('para') ]] Purchase Order Confirmation N° [[ o.name ]]
+ [[ o.state<>'draft' and removeParentNode('para') ]] Request for Quotation N° [[ o.name ]]
- Our Order Reference
+ Our Order Reference
- Your Order Reference
+ Your Order Reference
- Order Date
+ Order Date
- Validated By
+ Validated By
@@ -238,22 +216,22 @@
- Description
+ Description
- Taxes
+ Taxes
- Date Req.
+ Date Req.
- Qty
+ Qty
- Unit Price
+ Unit Price
- Net Price
+ Net Price
@@ -316,10 +294,10 @@
- Total :
+ Total :
- [[ formatLang(o.amount_total, digits=get_digits(dp='Account') , currency_obj=o.pricelist_id.currency_id) ]]
+ [[ formatLang(o.amount_total, digits=get_digits(dp='Account') , currency_obj=o.pricelist_id.currency_id) ]]
diff --git a/addons/purchase/report/request_quotation.rml b/addons/purchase/report/request_quotation.rml
index 8e5e73ee588..b7b4776d635 100644
--- a/addons/purchase/report/request_quotation.rml
+++ b/addons/purchase/report/request_quotation.rml
@@ -36,40 +36,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -84,7 +61,7 @@
- Expected Delivery address:
+ Expected Delivery address:
[[ (order.dest_address_id and order.dest_address_id.name) or (order.warehouse_id and order.warehouse_id.name) or '']]
[[ order.dest_address_id and display_address(order.dest_address_id) ]]
@@ -114,20 +91,20 @@
- Request for Quotation : [[order.name]]
+ Request for Quotation : [[order.name]]
- Description
+ Description
- Expected Date
+ Expected Date
- Qty
+ Qty
diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py
index 82061daa758..5e65afaae25 100644
--- a/addons/report_webkit/webkit_report.py
+++ b/addons/report_webkit/webkit_report.py
@@ -280,7 +280,7 @@ class WebKitParser(report_sxw):
template = False
if report_xml.report_file :
- path = get_module_resource(*report_xml.report_file.split(os.path.sep))
+ path = get_module_resource(*report_xml.report_file.split('/'))
if path and os.path.exists(path) :
template = file(path).read()
if not template and report_xml.report_webkit_data :
diff --git a/addons/sale/report/sale_order.rml b/addons/sale/report/sale_order.rml
index 130220535f9..3bddf81ade8 100644
--- a/addons/sale/report/sale_order.rml
+++ b/addons/sale/report/sale_order.rml
@@ -89,40 +89,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -133,22 +112,22 @@
- Description
+ Description
- Tax
+ Tax
- Quantity
+ Quantity
- Unit Price
+ Unit Price
- Disc.(%)
+ Disc.(%)
- Price
+ Price
@@ -162,13 +141,13 @@
- Shipping address :
+ Shipping address :
[[ (o.partner_shipping_id and o.partner_id.title and o.partner_shipping_id.title.name) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.name) or '' ]]
[[ o.partner_shipping_id and display_address(o.partner_shipping_id) ]]
- Invoice address :
+ Invoice address :
[[ (o.partner_invoice_id and o.partner_invoice_id.title and o.partner_invoice_id.title.name) or '' ]] [[ (o.partner_invoice_id and o.partner_invoice_id.name) or '' ]]
[[ o.partner_invoice_id and display_address(o.partner_invoice_id) ]]
@@ -195,25 +174,25 @@
- [[ o.state not in ['draft','sent'] and removeParentNode('para') ]] Quotation N° [[ o.name ]]
- [[ o.state in ['draft','sent'] and removeParentNode('para') ]] Order N° [[ o.name ]]
+ [[ o.state not in ['draft','sent'] and removeParentNode('para') ]] Quotation N° [[ o.name ]]
+ [[ o.state in ['draft','sent'] and removeParentNode('para') ]] Order N° [[ o.name ]]
- Your Reference
+ Your Reference
- [[ o.state in ['draft','sent'] and removeParentNode('para') ]] Date Ordered
- [[ o.state not in ['draft','sent'] and removeParentNode('para') ]] Quotation Date
+ [[ o.state in ['draft','sent'] and removeParentNode('para') ]] Date Ordered
+ [[ o.state not in ['draft','sent'] and removeParentNode('para') ]] Quotation Date
- Salesperson
+ Salesperson
- Payment Term
+ Payment Term
@@ -239,22 +218,22 @@
- Description
+ Description
- Tax
+ Tax
- Quantity
+ Quantity
- Unit Price
+ Unit Price
- [[not show_discount(user.id) and removeParentNode('para') ]]Disc.(%)
+ [[not show_discount(user.id) and removeParentNode('para') ]]Disc.(%)
- Price
+ Price
@@ -317,10 +296,10 @@
- Total :
+ Total :
- [[ formatLang(o.amount_total, dp='Account', currency_obj=o.pricelist_id.currency_id) ]]
+ [[ formatLang(o.amount_total, dp='Account', currency_obj=o.pricelist_id.currency_id) ]]
diff --git a/addons/sale/res_partner.py b/addons/sale/res_partner.py
index 1b37b609179..8201e147e34 100644
--- a/addons/sale/res_partner.py
+++ b/addons/sale/res_partner.py
@@ -41,7 +41,7 @@ class res_partner(osv.osv):
default.update({'sale_order_ids': []})
- super(res_partner, self).copy(cr, uid, record_id, default, context)
+ return super(res_partner, self).copy(cr, uid, record_id, default, context)
_columns = {
'sale_order_count': fields.function(_sale_order_count, string='# of Sales Order', type='integer'),
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 210e4dd3be6..f00fb6afd19 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -695,7 +695,7 @@ class sale_order_line(osv.osv):
_description = 'Sales Order Line'
_columns = {
'order_id': fields.many2one('sale.order', 'Order Reference', required=True, ondelete='cascade', select=True, readonly=True, states={'draft':[('readonly',False)]}),
- 'name': fields.text('Description', required=True, select=True, readonly=True, states={'draft': [('readonly', False)]}),
+ 'name': fields.text('Description', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of sales order lines."),
'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], change_default=True),
'invoice_lines': fields.many2many('account.invoice.line', 'sale_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True),
diff --git a/addons/sale_margin/sale_margin_view.xml b/addons/sale_margin/sale_margin_view.xml
index 88647ea3c46..be16429526a 100644
--- a/addons/sale_margin/sale_margin_view.xml
+++ b/addons/sale_margin/sale_margin_view.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/addons/sale_stock/test/cancel_order_sale_stock.yml b/addons/sale_stock/test/cancel_order_sale_stock.yml
index 9081cac9fa3..d970e0c9cad 100644
--- a/addons/sale_stock/test/cancel_order_sale_stock.yml
+++ b/addons/sale_stock/test/cancel_order_sale_stock.yml
@@ -8,7 +8,7 @@
-
!python {model: stock.picking}: |
delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))])
- first_picking = self.browse(cr, uid, delivery_orders[0], context=context)
+ first_picking = self.browse(cr, uid, delivery_orders[-1], context=context)
if first_picking.force_assign(cr, uid, first_picking):
first_move = first_picking.move_lines[0]
values = {'move%s'%(first_move.id): {'product_qty': 2, 'product_uom':ref('product.product_uom_unit')}}
@@ -18,7 +18,7 @@
-
!python {model: stock.picking}: |
delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))])
- last_delivery_order_id = delivery_orders[0]
+ last_delivery_order_id = delivery_orders[-1]
self.pool.get('stock.picking').signal_button_cancel(cr, uid, [last_delivery_order_id])
-
I run the scheduler.
diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py
index b45e3b17ea2..68c30949161 100644
--- a/addons/share/wizard/share_wizard.py
+++ b/addons/share/wizard/share_wizard.py
@@ -414,7 +414,8 @@ class share_wizard(osv.TransientModel):
relation_model_id = model_obj.search(cr, UID_ROOT, [('model','=',coldef._obj)])[0]
relation_model_browse = model_obj.browse(cr, UID_ROOT, relation_model_id, context=context)
relation_osv = self.pool[coldef._obj]
- if coltype == 'one2many':
+ #skip virtual one2many fields (related, ...) as there is no reverse relationship
+ if coltype == 'one2many' and hasattr(coldef, '_fields_id'):
# don't record reverse path if it's not a real m2o (that happens, but rarely)
dest_model_ci = relation_osv._all_columns
reverse_rel = coldef._fields_id
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index db73bae3b6c..e0b93af1f4f 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -543,6 +543,7 @@ class stock_picking(osv.osv):
_name = "stock.picking"
_inherit = ['mail.thread']
_description = "Picking List"
+ _order = "id desc"
def _set_maximum_date(self, cr, uid, ids, name, value, arg, context=None):
""" Calculates planned date if it is greater than 'value'.
diff --git a/addons/stock/wizard/stock_partial_picking.py b/addons/stock/wizard/stock_partial_picking.py
index 47599d5f99e..5f9f09e0074 100644
--- a/addons/stock/wizard/stock_partial_picking.py
+++ b/addons/stock/wizard/stock_partial_picking.py
@@ -144,7 +144,7 @@ class stock_partial_picking(osv.osv_memory):
def _partial_move_for(self, cr, uid, move):
partial_move = {
'product_id' : move.product_id.id,
- 'quantity' : move.product_qty if move.state in ('assigned','draft','confirmed') else 0,
+ 'quantity' : move.product_qty if move.state == 'assigned' else 0,
'product_uom' : move.product_uom.id,
'prodlot_id' : move.prodlot_id.id,
'move_id' : move.id,