[MERGE] forward port branch saas-11 up to 71773e1f1c

This commit is contained in:
Christophe Simonis
2017-02-01 19:08:14 +01:00
14 changed files with 88 additions and 41 deletions
+2 -2
View File
@@ -526,7 +526,7 @@ class AccountInvoice(models.Model):
self.date_due = self.date_due or self.date_invoice
else:
pterm = self.payment_term_id
pterm_list = pterm.with_context(currency_id=self.currency_id.id).compute(value=1, date_ref=date_invoice)[0]
pterm_list = pterm.with_context(currency_id=self.company_id.currency_id.id).compute(value=1, date_ref=date_invoice)[0]
self.date_due = max(line[0] for line in pterm_list)
@api.multi
@@ -831,7 +831,7 @@ class AccountInvoice(models.Model):
name = inv.name or '/'
if inv.payment_term_id:
totlines = inv.with_context(ctx).payment_term_id.with_context(currency_id=inv.currency_id.id).compute(total, date_invoice)[0]
totlines = inv.with_context(ctx).payment_term_id.with_context(currency_id=company_currency.id).compute(total, date_invoice)[0]
res_amount_currency = total_currency
ctx['date'] = date_invoice
for i, t in enumerate(totlines):
@@ -85,6 +85,13 @@
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<record id="invoice_analysis_comp_rule" model="ir.rule">
<field name="name">Invoice Analysis multi-company</field>
<field name="model_id" ref="model_account_invoice_report"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<record id="account_fiscal_position_comp_rule" model="ir.rule">
<field name="name">Account fiscal Mapping company rule</field>
<field name="model_id" ref="model_account_fiscal_position"/>
+1 -1
View File
@@ -233,7 +233,7 @@ class HrExpense(models.Model):
#convert eml into an osv-valid format
lines = map(lambda x: (0, 0, expense._prepare_move_line(x)), move_lines)
move.write({'line_ids': lines})
move.with_context(dont_create_taxes=True).write({'line_ids': lines})
expense.sheet_id.write({'account_move_id': move.id})
move.post()
if expense.payment_mode == 'company_account':
@@ -32,6 +32,7 @@ var LivechatButton = Widget.extend({
this.channel = null;
this.chat_window = null;
this.messages = [];
this.server_url = server_url;
},
willStart: function () {
@@ -203,10 +204,11 @@ var LivechatButton = Widget.extend({
this.options.default_username;
// Compute the avatar_url
msg.avatar_src = this.server_url;
if (msg.author_id && msg.author_id[0]) {
msg.avatar_src = "/web/image/res.partner/" + msg.author_id[0] + "/image_small";
msg.avatar_src += "/web/image/res.partner/" + msg.author_id[0] + "/image_small";
} else {
msg.avatar_src = "/mail/static/src/img/smiley/avatar.jpg";
msg.avatar_src += "/mail/static/src/img/smiley/avatar.jpg";
}
if (options && options.prepend) {
+1 -1
View File
@@ -12,7 +12,7 @@
<field name="name">Plantilla de cuentas de Guatemala (sencilla)</field>
<field name="bank_account_code_prefix">1.0.01.0</field>
<field name="cash_account_code_prefix">1.0.02.0</field>
<field name="code_digits">6</field>
<field name="code_digits">9</field>
<field name="currency_id" ref="base.QTQ"/>
<field name="transfer_account_id" ref="transfer_account_id"/>
</record>
+9 -2
View File
@@ -675,6 +675,8 @@ exports.PosModel = Backbone.Model.extend({
flushed.always(function(ids){
pushed.resolve();
});
return flushed;
});
return pushed;
},
@@ -775,6 +777,11 @@ exports.PosModel = Backbone.Model.extend({
var self = this;
var timeout = typeof options.timeout === 'number' ? options.timeout : 7500 * orders.length;
// Keep the order ids that are about to be sent to the
// backend. In between create_from_ui and the success callback
// new orders may have been added to it.
var order_ids_to_sync = _.pluck(orders, 'id');
// we try to send the order. shadow prevents a spinner if it takes too long. (unless we are sending an invoice,
// then we want to notify the user that we are waiting on something )
var posOrderModel = new Model('pos.order');
@@ -789,8 +796,8 @@ exports.PosModel = Backbone.Model.extend({
timeout: timeout
}
).then(function (server_ids) {
_.each(orders, function (order) {
self.db.remove_order(order.id);
_.each(order_ids_to_sync, function (order_id) {
self.db.remove_order(order_id);
});
self.set('failed',false);
return server_ids;
+25 -25
View File
@@ -106,7 +106,7 @@
<data noupdate="1">
<record id="project_project_data" model="project.project">
<record forcecreate="False" id="project_project_data" model="project.project">
<field name="name">Start here to discover Odoo</field>
<field name="privacy_visibility">followers</field>
<field name="user_id" ref="base.user_root"/>
@@ -120,25 +120,25 @@
<field name="alias_parent_model_id" ref="model_project_project"/>
</record>
<record id="project_stage_data_0" model="project.task.type">
<record forcecreate="False" id="project_stage_data_0" model="project.task.type">
<field name="sequence">1</field>
<field name="name">New</field>
<field name="project_ids" eval="[(4, ref('project_project_data'))]"/>
</record>
<record id="project_stage_data_1" model="project.task.type">
<record forcecreate="False" id="project_stage_data_1" model="project.task.type">
<field name="sequence">2</field>
<field name="name">Basic</field>
<field name="project_ids" eval="[(4, ref('project_project_data'))]"/>
</record>
<record id="project_stage_data_2" model="project.task.type">
<record forcecreate="False" id="project_stage_data_2" model="project.task.type">
<field name="sequence">3</field>
<field name="name">Advanced</field>
<field name="project_ids" eval="[(4, ref('project_project_data'))]"/>
</record>
<record id="project_task_data_0" model="project.task">
<record forcecreate="False" id="project_task_data_0" model="project.task">
<field name="sequence">1</field>
<field name="user_id" ref="base.user_root"/>
<field name="priority">0</field>
@@ -150,7 +150,7 @@
<field name="stage_id" ref="project_stage_data_0"/>
</record>
<record id="project_task_data_1" model="project.task">
<record forcecreate="False" id="project_task_data_1" model="project.task">
<field name="sequence">2</field>
<field name="user_id" ref="base.user_root"/>
<field name="priority">0</field>
@@ -161,7 +161,7 @@
<field name="stage_id" ref="project_stage_data_0"/>
</record>
<record id="project_task_data_5" model="project.task">
<record forcecreate="False" id="project_task_data_5" model="project.task">
<field name="sequence">3</field>
<field name="user_id" ref="base.user_root"/>
<field name="priority">0</field>
@@ -172,7 +172,7 @@
<field name="stage_id" ref="project_stage_data_0"/>
</record>
<record id="project_task_data_2" model="project.task">
<record forcecreate="False" id="project_task_data_2" model="project.task">
<field name="sequence">4</field>
<field name="user_id" ref="base.user_root"/>
<field name="priority">0</field>
@@ -183,7 +183,7 @@
<field name="stage_id" ref="project_stage_data_0"/>
</record>
<record id="project_task_data_4" model="project.task">
<record forcecreate="False" id="project_task_data_4" model="project.task">
<field name="user_id" ref="base.user_root"/>
<field name="priority">0</field>
<field name="project_id" ref="project.project_project_data"/>
@@ -193,7 +193,7 @@
<field name="stage_id" ref="project_stage_data_2"/>
</record>
<record id="msg_task_4" model="mail.message">
<record forcecreate="False" id="msg_task_4" model="mail.message">
<field name="subject">Converse with your customers and colleagues</field>
<field name="model">project.task</field>
<field name="author_id" ref="base.partner_root"/>
@@ -203,12 +203,12 @@
<field name="subtype_id" ref="mail.mt_comment"/>
</record>
<record id="project_tag_data" model="project.tags">
<record forcecreate="False" id="project_tag_data" model="project.tags">
<field name="name">NeedAssistance</field>
<field name="color" eval="5"/>
</record>
<record id="project_task_data_6" model="project.task">
<record forcecreate="False" id="project_task_data_6" model="project.task">
<field name="sequence">3</field>
<field name="user_id" ref="base.user_root"/>
<field name="priority">0</field>
@@ -221,7 +221,7 @@
<field name="tag_ids" eval="[(6,0,[ref('project.project_tag_data')])]"/>
</record>
<record id="project_task_data_12" model="project.task">
<record forcecreate="False" id="project_task_data_12" model="project.task">
<field name="sequence">4</field>
<field name="user_id" ref="base.user_root"/>
<field name="priority">0</field>
@@ -233,7 +233,7 @@
<field name="stage_id" ref="project_stage_data_1"/>
</record>
<record id="project_task_data_13" model="project.task">
<record forcecreate="False" id="project_task_data_13" model="project.task">
<field name="sequence">5</field>
<field name="user_id" ref="base.user_root"/>
<field name="priority">0</field>
@@ -244,7 +244,7 @@
<field name="stage_id" ref="project_stage_data_1"/>
</record>
<record id="project_task_data_8" model="project.task">
<record forcecreate="False" id="project_task_data_8" model="project.task">
<field name="user_id" ref="base.user_root"/>
<field name="priority">0</field>
<field name="project_id" ref="project.project_project_data"/>
@@ -254,7 +254,7 @@
<field name="description">Click on the bar in the upper right corner</field>
</record>
<record id="msg_task_data_8_attach" model="ir.attachment">
<record forcecreate="False" id="msg_task_data_8_attach" model="ir.attachment">
<field name="name">planner_icon.png</field>
<field name="datas_fname">planner_icon.png</field>
<field name="datas" type="base64" file="project/static/src/img/planner_icon.png"></field>
@@ -262,7 +262,7 @@
<field name="res_id" ref="project_task_data_8"/>
</record>
<record id="msg_task_data_8" model="mail.message">
<record forcecreate="False" id="msg_task_data_8" model="mail.message">
<field name="subject">How to open the implementation guide ?</field>
<field name="model">project.task</field>
<field name="res_id" ref="project_task_data_8"/>
@@ -273,11 +273,11 @@
<field name="attachment_ids" eval="[(6, 0, [ref('msg_task_data_8_attach')])]"/>
</record>
<record id="project_task_data_8" model="project.task">
<record forcecreate="False" id="project_task_data_8" model="project.task">
<field name="displayed_image_id" ref="msg_task_data_8_attach"/>
</record>
<record id="project_task_data_7" model="project.task">
<record forcecreate="False" id="project_task_data_7" model="project.task">
<field name="user_id" ref="base.user_root"/>
<field name="priority">0</field>
<field name="project_id" ref="project.project_project_data"/>
@@ -287,7 +287,7 @@
<field name="description">Click on the gear icon on the column, to archive the stage, with all the tasks in it. You can also archive one card only, by clicking on the button in the task form view.</field>
</record>
<record id="project_task_data_9" model="project.task">
<record forcecreate="False" id="project_task_data_9" model="project.task">
<field name="user_id" ref="base.user_root"/>
<field name="priority">0</field>
<field name="project_id" ref="project.project_project_data"/>
@@ -297,7 +297,7 @@
<field name="description">Click on the last column to create a stage. The name depends on the process. For example, in a customer service process, a stage name may be 'Backlog', 'Waiting Customer Feedback' or 'Done'.</field>
</record>
<record id="project_task_data_11" model="project.task">
<record forcecreate="False" id="project_task_data_11" model="project.task">
<field name="user_id" ref="base.user_root"/>
<field name="priority">0</field>
<field name="project_id" ref="project.project_project_data"/>
@@ -307,7 +307,7 @@
<field name="date_deadline" eval="datetime.now()+timedelta(days=30)"/>
</record>
<record id="project_task_data_14" model="project.task">
<record forcecreate="False" id="project_task_data_14" model="project.task">
<field name="user_id" ref="base.user_root"/>
<field name="priority">0</field>
<field name="project_id" ref="project.project_project_data"/>
@@ -317,7 +317,7 @@
<field name="description">In the chatter, sending an email with an attachment will display the picture on the card. When there are several image attachments, you can choose which one you want to display.</field>
</record>
<record id="msg_task_data_14_attach" model="ir.attachment">
<record forcecreate="False" id="msg_task_data_14_attach" model="ir.attachment">
<field name="name">bird.jpg</field>
<field name="datas_fname">bird.jpg</field>
<field name="datas" type="base64" file="project/static/src/img/bird.jpg"></field>
@@ -326,7 +326,7 @@
</record>
<record id="msg_task_data_14" model="mail.message">
<record forcecreate="False" id="msg_task_data_14" model="mail.message">
<field name="subject">How to open the planner?</field>
<field name="model">project.task</field>
<field name="res_id" ref="project_task_data_14"/>
@@ -336,7 +336,7 @@
<field name="attachment_ids" eval="[(6, 0, [ref('msg_task_data_14_attach')])]"/>
</record>
<record id="project_task_data_14" model="project.task">
<record forcecreate="False" id="project_task_data_14" model="project.task">
<field name="displayed_image_id" ref="msg_task_data_14_attach"/>
</record>
+1 -1
View File
@@ -51,7 +51,7 @@ class ReportController(Controller):
#------------------------------------------------------
# Misc. route utils
#------------------------------------------------------
@route(['/report/barcode', '/report/barcode/<type>/<path:value>'], type='http', auth="user")
@route(['/report/barcode', '/report/barcode/<type>/<path:value>'], type='http', auth="public")
def report_barcode(self, type, value, width=600, height=100, humanreadable=0):
"""Contoller able to render barcode images thanks to reportlab.
Samples:
+2 -5
View File
@@ -13,7 +13,7 @@ OPERATORS = {
'>': py_operator.gt,
'<=': py_operator.le,
'>=': py_operator.ge,
'==': py_operator.eq,
'=': py_operator.eq,
'!=': py_operator.ne
}
@@ -260,9 +260,6 @@ class Product(models.Model):
if not isinstance(value, (float, int)):
raise UserError('Invalid domain right operand')
if operator == '=':
operator = '=='
# TODO: Still optimization possible when searching virtual quantities
ids = []
for product in self.search([]):
@@ -272,7 +269,7 @@ class Product(models.Model):
def _search_qty_available(self, operator, value):
# TDE FIXME: should probably clean the search methods
if value == 0.0 and operator in ('==', '>=', '<='):
if value == 0.0 and operator in ('=', '>=', '<='):
return self._search_product_quantity(operator, value, 'qty_available')
product_ids = self._search_qty_available_new(operator, value, self._context.get('lot_id'), self._context.get('owner_id'), self._context.get('package_id'))
return [('id', 'in', product_ids)]
@@ -36,7 +36,7 @@ class ProductChangeQuantity(models.TransientModel):
def onchange_location_id(self):
# TDE FIXME: should'nt we use context / location ?
if self.location_id and self.product_id:
availability = self.product_id._product_available()
availability = self.product_id.with_context(compute_child=False)._product_available()
self.new_quantity = availability[self.product_id.id]['qty_available']
@api.onchange('product_id')
+5 -1
View File
@@ -186,7 +186,7 @@ var PivotView = View.extend({
this.initial_row_groupby = context.pivot_row_groupby || this.initial_row_groupby;
this.initial_col_groupby = context.pivot_col_groupby || this.initial_col_groupby;
}
this.main_row.groupbys = group_by.length ? group_by : this.initial_row_groupby.slice(0);
this.main_row.groupbys = group_by.length ? group_by : (context.pivot_row_groupby || this.initial_row_groupby.slice(0));
this.main_col.groupbys = context.pivot_column_groupby || this.initial_col_groupby.slice(0);
this.active_measures = context.pivot_measures || this.active_measures;
@@ -206,6 +206,10 @@ var PivotView = View.extend({
this.do_push_state({});
return this.data_loaded.done(function () {
self.display_table();
self.$buttons.find('.o_pivot_measures_list li').removeClass('selected');
self.active_measures.forEach(function (measure) {
self.$buttons.find('li[data-field="' + measure + '"]').addClass('selected');
});
_super();
});
},
@@ -177,6 +177,10 @@ var Translate = Widget.extend({
},
rte_changed: function (node) {
var $node = $(node);
$node.find("p").each(function () { // remove <p/> element which might have been inserted because of copy-paste
var $p = $(this);
$p.after($p.html()).remove();
});
var trans = this.getTranlationObject($node[0]);
$node.toggleClass('o_dirty', trans.value !== $node.html().replace(/[ \t\n\r]+/, ' '));
},
+15
View File
@@ -0,0 +1,15 @@
Colombia, 2017-01-21
Nubark agrees to the terms of the Odoo Corporate Contributor License
Agreement v1.0.
I declare that I am authorized and able to make this agreement and sign this
declaration.
Signed,
Esteban Echeverry eecheverry@nubark.com https://github.com/nubark
List of contributors:
Esteban Echeverry eecheverry@nubark.com https://github.com/tebanep
+11
View File
@@ -0,0 +1,11 @@
Indonesia, 2017-01-25
I hereby agree to the terms of the Odoo Individual Contributor License
Agreement v1.0.
I declare that I am authorized and able to make this agreement and sign this
declaration.
Signed,
Hendrik hendrikwidjaja25@gmail.com https://github.com/hendrikw25