diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e565d30638f..40daace4eda 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -6,5 +6,6 @@ Contributing to Odoo
TL;DR
* Use this [template](https://github.com/odoo/odoo/wiki/Contributing#reporting-issues) when reporting issues, and please search for duplicates first!
+* The issues not linked to pull requests will be handled with a low priority.
* Pull requests must be made against the [correct version](https://github.com/odoo/odoo/wiki/Contributing#against-which-version-should-i-submit-a-patch)
* There are restrictions on the kind of [changes allowed in stable series](https://github.com/odoo/odoo/wiki/Contributing#what-does-stable-mean)
diff --git a/README.md b/README.md
index aa774a03057..106ffeed09d 100644
--- a/README.md
+++ b/README.md
@@ -5,43 +5,23 @@ Odoo
Odoo is a suite of web based open source business apps.
-The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...
+The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...
+
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get
a full-featured Open Source ERP when you install several Apps.
-Getting started with Odoo development
---------------------------------------
+Getting started with Odoo
+-------------------------
-If you are a developer type the following command at your terminal:
+For a standard installation please follow the Setup instructions
+from the documentation.
+
+If you are a developer you may type the following command at your terminal:
wget -O- https://raw.githubusercontent.com/odoo/odoo/master/odoo.py | python
-Then follow the developer tutorial
-
-
-
-Packages, tarballs and installers
----------------------------------
-
-* Debian packages
-
- Add this apt repository to your /etc/apt/sources.list file
-
- deb http://nightly.odoo.com/master/nightly/deb/ ./
-
- Then type:
-
- $ sudo apt-get update
- $ sudo apt-get install odoo
-
- If you plan to use Odoo with a local database, please make sure to install PostgreSQL *before* installing the Odoo Debian package.
-
-* Source tarballs
-
-* Windows installer
-
-* RPM package
+Then follow the developer tutorials
For Odoo employees
diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index d7ae034469c..dc8c0fd9d8b 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -1261,7 +1261,7 @@ class account_invoice_line(models.Model):
uos_id = fields.Many2one('product.uom', string='Unit of Measure',
ondelete='set null', index=True)
product_id = fields.Many2one('product.product', string='Product',
- ondelete='set null', index=True)
+ ondelete='restrict', index=True)
account_id = fields.Many2one('account.account', string='Account',
required=True, domain=[('type', 'not in', ['view', 'closed'])],
default=_default_account,
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index e2a92a9926f..07bf1cf0c99 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -1197,7 +1197,7 @@ class account_move_line(osv.osv):
if journal.centralisation:
self._check_moves(cr, uid, context=ctx)
result = super(account_move_line, self).write(cr, uid, ids, vals, context)
- if check:
+ if check and not context.get('novalidate'):
done = []
for line in self.browse(cr, uid, ids):
if line.move_id.id not in done:
@@ -1339,24 +1339,23 @@ class account_move_line(osv.osv):
account_id = 'account_paid_id'
base_sign = 'ref_base_sign'
tax_sign = 'ref_tax_sign'
- tmp_cnt = 0
+ base_adjusted = False
for tax in tax_obj.compute_all(cr, uid, [tax_id], total, 1.00, force_excluded=False).get('taxes'):
#create the base movement
- if tmp_cnt == 0:
- if tax[base_code]:
- tmp_cnt += 1
- if tax_id.price_include:
- total = tax['price_unit']
- newvals = {
- 'tax_code_id': tax[base_code],
- 'tax_amount': tax[base_sign] * abs(total),
- }
- if tax_id.price_include:
- if tax['price_unit'] < 0:
- newvals['credit'] = abs(tax['price_unit'])
- else:
- newvals['debit'] = tax['price_unit']
- self.write(cr, uid, [result], newvals, context=context)
+ if base_adjusted == False:
+ base_adjusted = True
+ if tax_id.price_include:
+ total = tax['price_unit']
+ newvals = {
+ 'tax_code_id': tax[base_code],
+ 'tax_amount': tax[base_sign] * abs(total),
+ }
+ if tax_id.price_include:
+ if tax['price_unit'] < 0:
+ newvals['credit'] = abs(tax['price_unit'])
+ else:
+ newvals['debit'] = tax['price_unit']
+ self.write(cr, uid, [result], newvals, context=context)
else:
data = {
'move_id': vals['move_id'],
@@ -1372,8 +1371,7 @@ class account_move_line(osv.osv):
'credit': 0.0,
'debit': 0.0,
}
- if data['tax_code_id']:
- self.create(cr, uid, data, context)
+ self.create(cr, uid, data, context)
#create the Tax movement
data = {
'move_id': vals['move_id'],
@@ -1389,8 +1387,7 @@ class account_move_line(osv.osv):
'credit': tax['amount']<0 and -tax['amount'] or 0.0,
'debit': tax['amount']>0 and tax['amount'] or 0.0,
}
- if data['tax_code_id']:
- self.create(cr, uid, data, context)
+ self.create(cr, uid, data, context)
del vals['account_tax_id']
if check and not context.get('novalidate') and (context.get('recompute', True) or journal.entry_posted):
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 2e434fde466..061fe7f4e2e 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -625,7 +625,7 @@
-
+
@@ -1097,7 +1097,9 @@
-
+
@@ -1170,7 +1172,9 @@
-
+
@@ -1214,7 +1218,9 @@
-
+
@@ -1396,7 +1402,9 @@
-
+
@@ -1460,7 +1468,9 @@
-
+
diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py
index 9b155ea7b7a..5b2a5dc0a13 100644
--- a/addons/account/report/account_aged_partner_balance.py
+++ b/addons/account/report/account_aged_partner_balance.py
@@ -155,10 +155,10 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
dates_query += ' BETWEEN %s AND %s)'
args_list += (form[str(i)]['start'], form[str(i)]['stop'])
elif form[str(i)]['start']:
- dates_query += ' > %s)'
+ dates_query += ' >= %s)'
args_list += (form[str(i)]['start'],)
else:
- dates_query += ' < %s)'
+ dates_query += ' <= %s)'
args_list += (form[str(i)]['stop'],)
args_list += (self.date_from,)
self.cr.execute('''SELECT l.partner_id, SUM(l.debit-l.credit), l.reconcile_partial_id
@@ -181,11 +181,21 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
# in case of partial reconciliation, we want to keep the left amount in the oldest period
self.cr.execute('''SELECT MIN(COALESCE(date_maturity,date)) FROM account_move_line WHERE reconcile_partial_id = %s''', (partner_info[2],))
date = self.cr.fetchall()
- if date and args_list[-3] <= date[0][0] <= args_list[-2]:
+ partial = False
+ if 'BETWEEN' in dates_query:
+ partial = date and args_list[-3] <= date[0][0] <= args_list[-2]
+ elif '>=' in dates_query:
+ partial = date and date[0][0] >= form[str(i)]['start']
+ else:
+ partial = date and date[0][0] <= form[str(i)]['stop']
+ if partial:
# partial reconcilation
+ limit_date = 'COALESCE(l.date_maturity,l.date) %s %%s' % '<=' if self.direction_selection == 'past' else '>='
self.cr.execute('''SELECT SUM(l.debit-l.credit)
- FROM account_move_line AS l
- WHERE l.reconcile_partial_id = %s''', (partner_info[2],))
+ FROM account_move_line AS l, account_move AS am
+ WHERE l.move_id = am.id AND am.state in %s
+ AND l.reconcile_partial_id = %s
+ AND ''' + limit_date, (tuple(move_state), partner_info[2], self.date_from))
unreconciled_amount = self.cr.fetchall()
partners_amount[partner_info[0]] += unreconciled_amount[0][0]
else:
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 087ca8b756b..155b0f8497f 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -115,7 +115,8 @@
groups="group_account_manager"
context="{'search_default_partner_id':[active_id], 'search_default_month':1,'search_default_user':1,'group_by_no_leaf':1,'group_by':[]}"
res_model="account.invoice.report"
- src_model="res.partner"/>
+ src_model="res.partner"
+ view_mode="graph"/>
diff --git a/addons/account/static/src/css/account_bank_statement_reconciliation.css b/addons/account/static/src/css/account_bank_statement_reconciliation.css
index 818e3e537d8..cd217914e68 100644
--- a/addons/account/static/src/css/account_bank_statement_reconciliation.css
+++ b/addons/account/static/src/css/account_bank_statement_reconciliation.css
@@ -163,10 +163,6 @@
width: 100%; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view tr, .openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .match table tr {
cursor: pointer; }
- .openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view tr.created_line, .openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .match table tr.created_line {
- cursor: default !important; }
- .openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view tr.created_line .line_remove_button, .openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .match table tr.created_line .line_remove_button {
- cursor: pointer; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view td, .openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .match table td {
padding: 1px 8px;
vertical-align: middle; }
@@ -225,10 +221,14 @@
padding-bottom: 3px; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view caption {
text-align: left;
- font-size: 1.1em;
- font-weight: bold;
height: 26px;
margin: 0 15px 4px 15px; }
+ .openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view caption .partner_name {
+ font-size: 1.1em;
+ font-weight: bold; }
+ .openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view caption .tip_reconciliation_not_balanced {
+ float: right;
+ padding-right: 7px; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view caption button {
float: right;
position: relative;
@@ -238,8 +238,7 @@
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view caption > span, .openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view caption > input {
position: relative;
top: 7px;
- /* meh */
- font-weight: bold; }
+ /* meh */ }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view td.cell_credit {
border-left: 1px solid #000; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .match .match_controls {
diff --git a/addons/account/static/src/css/account_bank_statement_reconciliation.scss b/addons/account/static/src/css/account_bank_statement_reconciliation.scss
index 938965a896d..1fcdeac3389 100644
--- a/addons/account/static/src/css/account_bank_statement_reconciliation.scss
+++ b/addons/account/static/src/css/account_bank_statement_reconciliation.scss
@@ -267,14 +267,6 @@ $aestetic_animation_speed: 300ms;
tr {
cursor: pointer;
-
- &.created_line {
- cursor: default !important;
-
- .line_remove_button {
- cursor: pointer;
- }
- }
}
td {
@@ -373,11 +365,19 @@ $aestetic_animation_speed: 300ms;
caption {
text-align: left;
- font-size: 1.1em;
- font-weight: bold;
height: 26px;
margin: 0 $actionColWidth 4px $actionColWidth;
+ .partner_name {
+ font-size: 1.1em;
+ font-weight: bold;
+ }
+
+ .tip_reconciliation_not_balanced {
+ float: right;
+ padding-right: 7px;
+ }
+
button {
float: right;
position: relative;
@@ -390,7 +390,6 @@ $aestetic_animation_speed: 300ms;
> span, > input {
position: relative; top: 7px; /* meh */
- font-weight: bold;
}
}
diff --git a/addons/account/static/src/js/account_widgets.js b/addons/account/static/src/js/account_widgets.js
index 16ee2362684..7767ceb7a07 100644
--- a/addons/account/static/src/js/account_widgets.js
+++ b/addons/account/static/src/js/account_widgets.js
@@ -1172,7 +1172,7 @@ openerp.account = function (instance) {
var self = this;
$.each(self.$(".tbody_matched_lines .bootstrap_popover"), function(){ $(this).popover('destroy') });
self.$(".tbody_matched_lines").empty();
-
+
_(self.get("mv_lines_selected")).each(function(line){
var $line = $(QWeb.render("bank_statement_reconciliation_move_line", {line: line, selected: true}));
self.bindPopoverTo($line.find(".line_info_button"));
@@ -1189,7 +1189,7 @@ openerp.account = function (instance) {
_(self.getCreatedLines()).each(function(line){
var $line = $(QWeb.render("bank_statement_reconciliation_created_line", {line: line}));
- $line.find(".line_remove_button").click(function(){ self.removeLine($(this).closest(".created_line")) });
+ $line.click(function(){ self.removeLine($(this)) });
self.$(".tbody_created_lines").append($line);
if (line.no_remove_action) {
// Then the previous line's remove button deletes this line too
@@ -1241,50 +1241,62 @@ openerp.account = function (instance) {
/** Properties changed */
- // Updates the validation button and the "open balance" line
+ // Updates the validation button, the "open balance" line and the partial reconciliation sign
balanceChanged: function() {
var self = this;
- var balance = self.get("balance");
+
+ // 'reset' the widget to invalid state
+ self.is_valid = false;
+ self.$(".tip_reconciliation_not_balanced").show();
self.$(".tbody_open_balance").empty();
- // Special case hack : no identified partner
- if (self.st_line.has_no_partner) {
- if (Math.abs(balance).toFixed(3) === "0.000") {
- self.$(".button_ok").addClass("btn-primary");
- self.$(".button_ok").removeAttr("disabled");
- self.$(".button_ok").text("OK");
- self.is_valid = true;
+ self.$(".button_ok").text("OK").removeClass("btn-primary").attr("disabled", "disabled");
+
+ // Find out if the counterpart is lower than, equal or greater than the transaction being reconciled
+ var balance_type = undefined;
+ if (Math.abs(self.get("balance")).toFixed(3) === "0.000") balance_type = "equal";
+ else if (self.get("balance") * self.st_line.amount > 0) balance_type = "greater";
+ else if (self.get("balance") * self.st_line.amount < 0) balance_type = "lower";
+
+ // Adjust to different cases
+ if (balance_type === "equal") {
+ displayValidState(true);
+ } else if (balance_type === "greater") {
+ createOpenBalance("Create Write-off");
+ } else if (balance_type === "lower") {
+ if (self.st_line.has_no_partner) {
+ createOpenBalance("Choose counterpart");
} else {
- self.$(".button_ok").removeClass("btn-primary");
- self.$(".button_ok").attr("disabled", "disabled");
- self.$(".button_ok").text("OK");
- self.is_valid = false;
- var debit = (balance > 0 ? self.formatCurrency(balance, self.st_line.currency_id) : "");
- var credit = (balance < 0 ? self.formatCurrency(-1*balance, self.st_line.currency_id) : "");
- var $line = $(QWeb.render("bank_statement_reconciliation_line_open_balance", {
- debit: debit,
- credit: credit,
- account_code: self.map_account_id_code[self.st_line.open_balance_account_id]
- }));
- $line.find('.js_open_balance')[0].innerHTML = _t("Choose counterpart");
- self.$(".tbody_open_balance").append($line);
+ displayValidState(false, "Keep open");
+ createOpenBalance("Open balance");
}
- return;
}
-
- if (Math.abs(balance).toFixed(3) === "0.000") {
- self.$(".button_ok").addClass("btn-primary");
- self.$(".button_ok").text("OK");
- } else {
- self.$(".button_ok").removeClass("btn-primary");
- self.$(".button_ok").text("Keep open");
- var debit = (balance > 0 ? self.formatCurrency(balance, self.st_line.currency_id) : "");
- var credit = (balance < 0 ? self.formatCurrency(-1*balance, self.st_line.currency_id) : "");
+
+ // Show or hide partial reconciliation
+ if (self.get("mv_lines_selected").length > 0) {
+ var propose_partial = self.getCreatedLines().length === 0 && self.get("mv_lines_selected").length === 1 && balance_type === "greater" && ! self.get("mv_lines_selected")[0].partial_reconcile;
+ self.get("mv_lines_selected")[0].propose_partial_reconcile = propose_partial;
+ self.updateAccountingViewMatchedLines();
+ }
+
+ function displayValidState(higlight_ok_button, ok_button_text) {
+ self.is_valid = true;
+ self.$(".tip_reconciliation_not_balanced").hide();
+ self.$(".button_ok").removeAttr("disabled");
+ if (higlight_ok_button) self.$(".button_ok").addClass("btn-primary");
+ if (ok_button_text !== undefined) self.$(".button_ok").text(ok_button_text)
+ }
+
+ function createOpenBalance(name) {
+ var balance = self.get("balance");
+ var amount = self.formatCurrency(Math.abs(balance), self.st_line.currency_id);
var $line = $(QWeb.render("bank_statement_reconciliation_line_open_balance", {
- debit: debit,
- credit: credit,
+ debit: balance > 0 ? amount : "",
+ credit: balance < 0 ? amount : "",
account_code: self.map_account_id_code[self.st_line.open_balance_account_id]
}));
- self.$(".tbody_open_balance").append($line);
+ if (name !== undefined)
+ $line.find(".cell_label").text(name);
+ self.$(".tbody_open_balance").empty().append($line);
}
},
@@ -1430,6 +1442,8 @@ openerp.account = function (instance) {
line_created_being_edited[index].amount = Math.round(val.amount*rounding)/rounding;
line_created_being_edited[index].amount_str = self.formatCurrency(Math.abs(val.amount), val.currency_id);
}
+ if (val.amount_with_tax)
+ line_created_being_edited[index].amount_with_tax = Math.round(val.amount_with_tax*rounding)/rounding;
});
self.set("line_created_being_edited", line_created_being_edited);
self.createdLinesChanged(); // TODO For some reason, previous line doesn't trigger change handler
@@ -1527,20 +1541,8 @@ openerp.account = function (instance) {
});
// Dealing with floating-point
balance = Math.round(balance*1000)/1000;
+
self.set("balance", balance);
-
- // Propose partial reconciliation if necessary
- if (lines_selected_num === 1 &&
- self.st_line.amount * balance > 0 &&
- self.st_line.amount * (mv_lines_selected[0].debit - mv_lines_selected[0].credit) < 0 &&
- ! mv_lines_selected[0].partial_reconcile) {
-
- mv_lines_selected[0].propose_partial_reconcile = true;
- self.updateAccountingViewMatchedLines();
- } else if (lines_selected_num === 1) {
- mv_lines_selected[0].propose_partial_reconcile = false;
- self.updateAccountingViewMatchedLines();
- }
},
// Loads move lines according to the widget's state
@@ -1627,7 +1629,7 @@ openerp.account = function (instance) {
var dict = {};
dict['account_id'] = this.st_line.open_balance_account_id;
- dict['name'] = _t("Open balance");
+ dict['name'] = this.st_line.name + ' : ' + _t("Open balance");
if (balance > 0) dict['debit'] = balance;
if (balance < 0) dict['credit'] = -1*balance;
diff --git a/addons/account/static/src/xml/account_bank_statement_reconciliation.xml b/addons/account/static/src/xml/account_bank_statement_reconciliation.xml
index c0ad724ab03..0f482743e58 100644
--- a/addons/account/static/src/xml/account_bank_statement_reconciliation.xml
+++ b/addons/account/static/src/xml/account_bank_statement_reconciliation.xml
@@ -64,6 +64,7 @@
+ You must balance the reconciliation
@@ -175,7 +176,7 @@
-
+
@@ -190,7 +191,7 @@
-
Open balance
+
Open balance
diff --git a/addons/account/tests/test_reconciliation.py b/addons/account/tests/test_reconciliation.py
index e8fd83316a0..a7256bba853 100644
--- a/addons/account/tests/test_reconciliation.py
+++ b/addons/account/tests/test_reconciliation.py
@@ -1,4 +1,5 @@
from openerp.tests.common import TransactionCase
+import time
class TestReconciliation(TransactionCase):
"""Tests for reconciliation (account.tax)
@@ -36,7 +37,8 @@ class TestReconciliation(TransactionCase):
'currency_id': self.currency_swiss_id,
'name': 'invoice to client',
'account_id': self.account_rcv_id,
- 'type': 'out_invoice'
+ 'type': 'out_invoice',
+ 'date_invoice': time.strftime('%Y')+'-07-01', # to use USD rate rateUSDbis
})
self.account_invoice_line_model.create(cr, uid, {'product_id': self.product_id,
'quantity': 1,
@@ -49,14 +51,18 @@ class TestReconciliation(TransactionCase):
invoice_record = self.account_invoice_model.browse(cr, uid, [invoice_id])
#we pay half of it on a journal with currency in dollar (bank statement)
- bank_stmt_id = self.acc_bank_stmt_model.create(cr, uid, {'journal_id': self.bank_journal_usd_id,})
+ bank_stmt_id = self.acc_bank_stmt_model.create(cr, uid, {
+ 'journal_id': self.bank_journal_usd_id,
+ 'date': time.strftime('%Y')+'-07-15',
+ })
bank_stmt_line_id = self.acc_bank_stmt_line_model.create(cr, uid, {'name': 'half payment',
'statement_id': bank_stmt_id,
'partner_id': self.partner_agrolait_id,
'amount': 42,
'amount_currency': 50,
- 'currency_id': self.currency_swiss_id,})
+ 'currency_id': self.currency_swiss_id,
+ 'date': time.strftime('%Y')+'-07-15',})
#reconcile the payment with the invoice
for l in invoice_record.move_id.line_id:
@@ -103,7 +109,8 @@ class TestReconciliation(TransactionCase):
'currency_id': self.currency_swiss_id,
'name': 'invoice to client',
'account_id': self.account_rcv_id,
- 'type': 'in_invoice'
+ 'type': 'in_invoice',
+ 'date_invoice': time.strftime('%Y')+'-07-01',
})
self.account_invoice_line_model.create(cr, uid, {'product_id': self.product_id,
'quantity': 1,
@@ -116,14 +123,18 @@ class TestReconciliation(TransactionCase):
invoice_record = self.account_invoice_model.browse(cr, uid, [invoice_id])
#we pay half of it on a journal with currency in dollar (bank statement)
- bank_stmt_id = self.acc_bank_stmt_model.create(cr, uid, {'journal_id': self.bank_journal_usd_id,})
+ bank_stmt_id = self.acc_bank_stmt_model.create(cr, uid, {
+ 'journal_id': self.bank_journal_usd_id,
+ 'date': time.strftime('%Y')+'-07-15',
+ })
bank_stmt_line_id = self.acc_bank_stmt_line_model.create(cr, uid, {'name': 'half payment',
'statement_id': bank_stmt_id,
'partner_id': self.partner_agrolait_id,
'amount': -42,
'amount_currency': -50,
- 'currency_id': self.currency_swiss_id,})
+ 'currency_id': self.currency_swiss_id,
+ 'date': time.strftime('%Y')+'-07-15',})
#reconcile the payment with the invoice
for l in invoice_record.move_id.line_id:
diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml
index 3f86952b009..1e244d5a40c 100644
--- a/addons/account/views/report_invoice.xml
+++ b/addons/account/views/report_invoice.xml
@@ -71,7 +71,7 @@
-
+
@@ -142,7 +142,7 @@
-
+
Fiscal Position Remark:
diff --git a/addons/account/wizard/account_chart.py b/addons/account/wizard/account_chart.py
index 1f3f7908ec7..b6c0a96a578 100644
--- a/addons/account/wizard/account_chart.py
+++ b/addons/account/wizard/account_chart.py
@@ -51,7 +51,7 @@ class account_chart(osv.osv_memory):
FROM account_period p
LEFT JOIN account_fiscalyear f ON (p.fiscalyear_id = f.id)
WHERE f.id = %s
- ORDER BY p.date_start ASC
+ ORDER BY p.date_start ASC, p.special DESC
LIMIT 1) AS period_start
UNION ALL
SELECT * FROM (SELECT p.id
diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
index 8dfcd0516af..4561e45de2c 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
@@ -80,7 +80,7 @@
@@ -198,6 +198,7 @@
account.analytic.account.list.contractaccount.analytic.account
+
diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py
index ebcdda50186..2d2f117dc86 100644
--- a/addons/account_analytic_plans/account_analytic_plans.py
+++ b/addons/account_analytic_plans/account_analytic_plans.py
@@ -442,7 +442,9 @@ class sale_order_line(osv.osv):
if ids:
sale_line = self.browse(cr, uid, ids[0], context=context)
for line in inv_line_obj.browse(cr, uid, create_ids, context=context):
- rec = acct_anal_def_obj.account_get(cr, uid, line.product_id.id, sale_line.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context)
+ rec = acct_anal_def_obj.account_get(cr, uid, line.product_id.id,
+ sale_line.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'),
+ sale_line.order_id.company_id.id, context=context)
if rec:
inv_line_obj.write(cr, uid, [line.id], {'analytics_id': rec.analytics_id.id}, context=context)
diff --git a/addons/account_anglo_saxon/invoice.py b/addons/account_anglo_saxon/invoice.py
index 3642e41e4da..1e08296d73d 100644
--- a/addons/account_anglo_saxon/invoice.py
+++ b/addons/account_anglo_saxon/invoice.py
@@ -50,14 +50,9 @@ class account_invoice_line(osv.osv):
return res
if type in ('in_invoice','in_refund'):
product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context)
- if type == 'in_invoice':
- oa = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id
- if not oa:
- oa = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id
- else:
- oa = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id
- if not oa:
- oa = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id
+ oa = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id
+ if not oa:
+ oa = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id
if oa:
fpos = fposition_id and fiscal_pool.browse(cr, uid, fposition_id, context=context) or False
a = fiscal_pool.map_account(cr, uid, fpos, oa)
@@ -82,7 +77,7 @@ class account_invoice_line(osv.osv):
inv = i_line.invoice_id
company_currency = inv.company_id.currency_id.id
- if i_line.product_id and i_line.product_id.valuation == 'real_time':
+ if i_line.product_id.type != 'service' and i_line.product_id.valuation == 'real_time':
# debit account dacc will be the output account
# first check the product, if empty check the category
dacc = i_line.product_id.property_stock_account_output and i_line.product_id.property_stock_account_output.id
diff --git a/addons/account_anglo_saxon/stock.py b/addons/account_anglo_saxon/stock.py
index fb7c507cc91..e7f7548747b 100644
--- a/addons/account_anglo_saxon/stock.py
+++ b/addons/account_anglo_saxon/stock.py
@@ -21,42 +21,33 @@
from openerp.osv import osv
-#----------------------------------------------------------
-# Stock Picking
-#----------------------------------------------------------
+class stock_move(osv.Model):
+ _inherit = "stock.move"
+
+ def _get_invoice_line_vals(self, cr, uid, move, partner, inv_type, context=None):
+ """ Add a reference to the stock.move in the invoice line
+
+ In anglo-saxon the price for COGS should be taken from stock.move
+ if possible (fallback on standard_price)
+ """
+ res = super(stock_move, self)._get_invoice_line_vals(cr, uid, move, partner, inv_type, context=context)
+ res.update({
+ 'move_id': move.id,
+ })
+ return res
+
class stock_picking(osv.osv):
_inherit = "stock.picking"
_description = "Picking List"
- def _prepare_invoice_line(self, cr, uid, group, picking, move_line, invoice_id,
- invoice_vals, context=None):
- """Overwrite to add move_id reference"""
- res = super(stock_picking, self)._prepare_invoice_line(cr, uid, group, picking, move_line, invoice_id, invoice_vals, context=context)
- res.update({
- 'move_id': move_line.id,
- })
- return res
-
def action_invoice_create(self, cr, uid, ids, journal_id=False,
group=False, type='out_invoice', context=None):
'''Return ids of created invoices for the pickings'''
res = super(stock_picking,self).action_invoice_create(cr, uid, ids, journal_id, group, type, context=context)
- if type == 'in_refund':
+ if type in ('in_invoice', 'in_refund'):
for inv in self.pool.get('account.invoice').browse(cr, uid, res, context=context):
for ol in inv.invoice_line:
- if ol.product_id:
- oa = ol.product_id.property_stock_account_output and ol.product_id.property_stock_account_output.id
- if not oa:
- oa = ol.product_id.categ_id.property_stock_account_output_categ and ol.product_id.categ_id.property_stock_account_output_categ.id
- if oa:
- fpos = ol.invoice_id.fiscal_position or False
- a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
- self.pool.get('account.invoice.line').write(cr, uid, [ol.id], {'account_id': a})
-
- elif type == 'in_invoice':
- for inv in self.pool.get('account.invoice').browse(cr, uid, res, context=context):
- for ol in inv.invoice_line:
- if ol.product_id:
+ if ol.product_id.type != 'service':
oa = ol.product_id.property_stock_account_input and ol.product_id.property_stock_account_input.id
if not oa:
oa = ol.product_id.categ_id.property_stock_account_input_categ and ol.product_id.categ_id.property_stock_account_input_categ.id
diff --git a/addons/account_check_writing/account_voucher_view.xml b/addons/account_check_writing/account_voucher_view.xml
index f10fff102f8..609d288892c 100644
--- a/addons/account_check_writing/account_voucher_view.xml
+++ b/addons/account_check_writing/account_voucher_view.xml
@@ -12,14 +12,14 @@
-
+
-
+
diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py
index 392cf96eb1f..55068bf2742 100644
--- a/addons/auth_oauth/controllers/main.py
+++ b/addons/auth_oauth/controllers/main.py
@@ -24,6 +24,7 @@ _logger = logging.getLogger(__name__)
def fragment_to_query_string(func):
@functools.wraps(func)
def wrapper(self, *a, **kw):
+ kw.pop('debug', False)
if not kw:
return """