[MERGE] forward port branch 11.0 up to d82c0d133e
This commit is contained in:
@@ -399,9 +399,9 @@ var LineRenderer = Widget.extend(FieldManagerMixin, {
|
||||
.attr("data-content", qweb.render('reconciliation.line.mv_line.details', {'line': line}));
|
||||
}
|
||||
if (line.already_paid === false &&
|
||||
((state.balance.amount_currency < 0 || line.partial_reconcile)
|
||||
(((state.balance.amount_currency < 0 || line.partial_reconcile)
|
||||
&& line.amount > 0 && state.st_line.amount > 0 && targetLineAmount < line.amount && partialDebitProps <= 1) ||
|
||||
((state.balance.amount_currency > 0 || line.partial_reconcile)
|
||||
((state.balance.amount_currency > 0 || line.partial_reconcile))
|
||||
&& line.amount < 0 && state.st_line.amount < 0 && targetLineAmount > line.amount && partialCreditProps <= 1)) {
|
||||
var $cell = $line.find(line.amount > 0 ? '.cell_right' : '.cell_left');
|
||||
var text;
|
||||
|
||||
@@ -395,6 +395,7 @@ var mv_lines = {
|
||||
'[6,"",0,6]': [
|
||||
{'account_type': "liquidity", 'amount_currency_str': "", 'currency_id': false, 'date_maturity': "2017-01-23", 'date': "2017-01-23", 'total_amount_str': "$ 376.00", 'partner_id': 7, 'account_name': "Bank", 'name': "BNK1/2017/0002: SUPP.OUT/2017/0002", 'partner_name': "ASUSTeK", 'total_amount_currency_str': "", 'id': 392, 'credit': 376.0, 'journal_id': "Bank", 'amount_str': "$ 376.00", 'debit': 0.0, 'account_code': "101401", 'ref': "BILL/2017/0003", 'already_paid': true},
|
||||
{'account_type': "liquidity", 'amount_currency_str': "", 'currency_id': false, 'date_maturity': "2017-01-23", 'date': "2017-01-23", 'total_amount_str': "$ 100.00", 'partner_id': 8, 'account_name': "Bank", 'name': "BNK1/2017/0003: CUST.IN/2017/0001", 'partner_name': "Agrolait", 'total_amount_currency_str': "", 'id': 394, 'credit': 0.0, 'journal_id': "Bank", 'amount_str': "$ 100.00", 'debit': 100.0, 'account_code': "101401", 'ref': "", 'already_paid': true},
|
||||
{'account_type': "payable", 'amount_currency_str': "", 'currency_id': false, 'date_maturity': "2017-02-28", 'date': "2017-01-01", 'total_amount_str': "$ 10,000.00", 'partner_id': 12, 'account_name': "Account Payable", 'name': "BILL/2017/0001", 'partner_name': "Camptocamp", 'total_amount_currency_str': "", 'id': 114, 'credit': 10000.0, 'journal_id': [2, "Vendor Bills"], 'amount_str': "$ 10,000.00", 'debit': 0.0, 'account_code': "111100", 'ref': "", 'already_paid': false},
|
||||
{'account_type': "liquidity", 'amount_currency_str': "", 'currency_id': false, 'date_maturity': "2017-01-23", 'date': "2017-01-23", 'total_amount_str': "$ 525.50", 'partner_id': 8, 'account_name': "Bank", 'name': "BNK1/2017/0004: CUST.IN/2017/0002", 'partner_name': "Agrolait", 'total_amount_currency_str': "", 'id': 396, 'credit': 0.0, 'journal_id': "Bank", 'amount_str': "$ 525.50", 'debit': 525.5, 'account_code': "101401", 'ref': "INV/2017/0003", 'already_paid': true},
|
||||
{'account_type': "receivable", 'amount_currency_str': "", 'currency_id': false, 'date_maturity': "2017-02-07", 'date': "2017-01-08", 'total_amount_str': "$ 650.00", 'partner_id': 8, 'account_name': "101200 Account Receivable", 'name': "INV/2017/0002", 'partner_name': "Agrolait", 'total_amount_currency_str': "", 'id': 109, 'credit': 0.0, 'journal_id': [1, "Customer Invoices"], 'amount_str': "$ 650.00", 'debit': 650.0, 'account_code': "101200", 'ref': "", 'already_paid': false},
|
||||
{'account_type': "receivable", 'amount_currency_str': "", 'currency_id': false, 'date_maturity': "2017-02-22", 'date': "2017-01-23", 'total_amount_str': "$ 525.00", 'partner_id': 8, 'account_name': "101200 Account Receivable", 'name': "INV/2017/0004", 'partner_name': "Agrolait", 'total_amount_currency_str': "", 'id': 399, 'credit': 0.0, 'journal_id': [1, "Customer Invoices"], 'amount_str': "$ 525.00", 'debit': 525.0, 'account_code': "101200", 'ref': "", 'already_paid': false},
|
||||
@@ -650,12 +651,12 @@ QUnit.module('account', {
|
||||
|
||||
clientAction.widgets[1].$('.accounting_view thead td:first').trigger('click');
|
||||
assert.strictEqual(clientAction.widgets[1].$('.mv_line').length, 5, "should display 5 account move lines");
|
||||
assert.strictEqual(clientAction.widgets[1].$('.mv_line .cell_right:not(:empty)').length, 4, "should display only the credit account move lines (hide the debit)");
|
||||
assert.strictEqual(clientAction.widgets[1].$('.mv_line .cell_right:not(:empty)').length, 3, "should display only the credit account move lines (hide the debit)");
|
||||
assert.strictEqual(clientAction.widgets[1].$('.mv_line.already_reconciled').length, 3, "should display 3 already reconciled account move lines");
|
||||
assert.strictEqual(clientAction.widgets[1].$('.mv_line').text().replace(/[\n\r\s]+/g, ' '),
|
||||
" 101401 2017-01-23 ASUSTeK: BNK1/2017/0002: SUPP.OUT/2017/0002 : BILL/2017/0003 $ 376.00 101401 2017-01-23 Agrolait: BNK1/2017/0003: CUST.IN/2017/0001 $ 100.00 101401 2017-01-23 Agrolait: BNK1/2017/0004: CUST.IN/2017/0002 : INV/2017/0003 $ 525.50 101200 2017-02-07 Agrolait: INV/2017/0002 $ 650.00 101200 2017-02-22 Agrolait: INV/2017/0004 $ 525.00 ",
|
||||
" 101401 2017-01-23 ASUSTeK: BNK1/2017/0002: SUPP.OUT/2017/0002 : BILL/2017/0003 $ 376.00 101401 2017-01-23 Agrolait: BNK1/2017/0003: CUST.IN/2017/0001 $ 100.00 111100 2017-02-28 Camptocamp: BILL/2017/0001 $ 10,000.00 101401 2017-01-23 Agrolait: BNK1/2017/0004: CUST.IN/2017/0002 : INV/2017/0003 $ 525.50 101200 2017-02-07 Agrolait: INV/2017/0002 $ 650.00 ",
|
||||
"should display 4 account move lines who contains the account_code, due_date, label and the credit");
|
||||
assert.strictEqual(clientAction.widgets[1].$('.mv_line .cell_left:not(:empty)').length, 1, "should display only 1 debit account move lines");
|
||||
assert.strictEqual(clientAction.widgets[1].$('.mv_line .cell_left:not(:empty)').length, 2, "should display only 2 debit account move lines");
|
||||
clientAction.widgets[1].$('.match_controls .fa-chevron-right').trigger('click');
|
||||
assert.strictEqual(clientAction.widgets[1].$('.mv_line').text().replace(/[\n\r\s]+/g, ' '),
|
||||
" 101200 2017-02-28 Camptocamp: INV/2017/0001 $ 4,610.00 111100 2017-02-28 Camptocamp: BILL/2017/0001 $ 10,000.00 111100 2017-02-28 ASUSTeK: BILL/2017/0002 $ 5,749.99 ",
|
||||
@@ -807,8 +808,13 @@ QUnit.module('account', {
|
||||
[6],
|
||||
[{
|
||||
partner_id: false,
|
||||
counterpart_aml_dicts:[],
|
||||
payment_aml_ids: [392],
|
||||
counterpart_aml_dicts:[{
|
||||
"counterpart_aml_id": 114,
|
||||
"credit": 0,
|
||||
"debit": 32.57999999999993,
|
||||
"name": "BILL/2017/0001"
|
||||
}],
|
||||
payment_aml_ids: [],
|
||||
new_aml_dicts: [],
|
||||
}]
|
||||
], "should call process_bank_statement_line with partial reconcile values");
|
||||
@@ -837,7 +843,7 @@ QUnit.module('account', {
|
||||
|
||||
assert.notOk( widget.$('.cell_left .line_info_button').length, "should not display the partial reconciliation alert");
|
||||
widget.$('.accounting_view thead td:first').trigger('click');
|
||||
widget.$('.match .cell_account_code:first').trigger('click');
|
||||
widget.$('.match .mv_line[data-line-id=114] .cell_account_code').trigger('click');
|
||||
assert.equal( widget.$('.accounting_view tbody .cell_left .line_info_button').length, 1, "should display the partial reconciliation alert");
|
||||
assert.ok( widget.$('button.btn-primary:not(hidden)').length, "should not display the reconcile button");
|
||||
assert.ok( widget.$('.text-danger:not(hidden)').length, "should display counterpart alert");
|
||||
|
||||
@@ -180,9 +180,9 @@ class HrPayslip(models.Model):
|
||||
for interval in day_intervals:
|
||||
holiday = interval[2]['leaves'].holiday_id
|
||||
current_leave_struct = leaves.setdefault(holiday.holiday_status_id, {
|
||||
'name': holiday.holiday_status_id.name,
|
||||
'name': holiday.holiday_status_id.name or _('Global Leaves'),
|
||||
'sequence': 5,
|
||||
'code': holiday.holiday_status_id.name,
|
||||
'code': holiday.holiday_status_id.name or 'GLOBAL',
|
||||
'number_of_days': 0.0,
|
||||
'number_of_hours': 0.0,
|
||||
'contract_id': contract.id,
|
||||
|
||||
@@ -66,7 +66,7 @@ def jsonrpc(url, method='call', params=None):
|
||||
e.data = response['error']['data']
|
||||
raise e
|
||||
return response.get('result')
|
||||
except (ValueError, requests.exceptions.ConnectionError, requests.exceptions.MissingSchema) as e:
|
||||
except (ValueError, requests.exceptions.ConnectionError, requests.exceptions.MissingSchema, requests.exceptions.Timeout, requests.exceptions.HTTPError) as e:
|
||||
raise exceptions.AccessError('The url that this service requested returned an error. Please contact the author the app. The url it tried to contact was ' + url)
|
||||
|
||||
#----------------------------------------------------------
|
||||
@@ -78,7 +78,7 @@ class IapTransaction(object):
|
||||
self.credit = None
|
||||
|
||||
@contextlib.contextmanager
|
||||
def charge(env, key, account_token, credit, description=None, credit_template=None):
|
||||
def charge(env, key, account_token, credit, description=None, credit_template=None, dbuuid=False):
|
||||
"""
|
||||
Account charge context manager: takes a hold for ``credit``
|
||||
amount before executing the body, then captures it if there
|
||||
@@ -102,6 +102,7 @@ def charge(env, key, account_token, credit, description=None, credit_template=No
|
||||
'credit': credit,
|
||||
'key': key,
|
||||
'description': description,
|
||||
'dbuuid': dbuuid,
|
||||
}
|
||||
try:
|
||||
transaction_token = jsonrpc(endpoint + '/iap/1/authorize', params=params)
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
<record id="tax_group_6" model="account.tax.group">
|
||||
<field name="name">BTW 6%</field>
|
||||
</record>
|
||||
<record id="tax_group_9" model="account.tax.group">
|
||||
<field name="name">BTW 9%</field>
|
||||
</record>
|
||||
<record id="tax_group_21" model="account.tax.group">
|
||||
<field name="name">BTW 21%</field>
|
||||
</record>
|
||||
@@ -18,6 +21,9 @@
|
||||
<record id="tax_group_6_eu" model="account.tax.group">
|
||||
<field name="name">BTW 6% EU</field>
|
||||
</record>
|
||||
<record id="tax_group_9_eu" model="account.tax.group">
|
||||
<field name="name">BTW 9% EU</field>
|
||||
</record>
|
||||
<record id="tax_group_21_eu" model="account.tax.group">
|
||||
<field name="name">BTW 21% EU</field>
|
||||
</record>
|
||||
@@ -27,6 +33,9 @@
|
||||
<record id="tax_group_6_niet_eu" model="account.tax.group">
|
||||
<field name="name">BTW 6% Niet EU</field>
|
||||
</record>
|
||||
<record id="tax_group_9_niet_eu" model="account.tax.group">
|
||||
<field name="name">BTW 9% Niet EU</field>
|
||||
</record>
|
||||
<record id="tax_group_21_niet_eu" model="account.tax.group">
|
||||
<field name="name">BTW 21% Niet EU</field>
|
||||
</record>
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
<field name="tax_src_id" ref="btw_6"/>
|
||||
<field name="tax_dest_id" ref="btw_X1"/>
|
||||
</record>
|
||||
<record id="position_tax_extracom_9" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_non_eu"/>
|
||||
<field name="tax_src_id" ref="btw_9"/>
|
||||
<field name="tax_dest_id" ref="btw_X1"/>
|
||||
</record>
|
||||
<record id="position_tax_extracom_21" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_non_eu"/>
|
||||
<field name="tax_src_id" ref="btw_21"/>
|
||||
@@ -36,6 +41,11 @@
|
||||
<field name="tax_src_id" ref="btw_6_d"/>
|
||||
<field name="tax_dest_id" ref="btw_X3"/>
|
||||
</record>
|
||||
<record id="position_tax_extracom_d_9" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_non_eu"/>
|
||||
<field name="tax_src_id" ref="btw_9_d"/>
|
||||
<field name="tax_dest_id" ref="btw_X3"/>
|
||||
</record>
|
||||
<record id="position_tax_extracom_d_21" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_non_eu"/>
|
||||
<field name="tax_src_id" ref="btw_21_d"/>
|
||||
@@ -52,6 +62,11 @@
|
||||
<field name="tax_src_id" ref="btw_6_buy"/>
|
||||
<field name="tax_dest_id" ref="btw_E1"/>
|
||||
</record>
|
||||
<record id="position_tax_extracom_9" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_non_eu"/>
|
||||
<field name="tax_src_id" ref="btw_9_buy"/>
|
||||
<field name="tax_dest_id" ref="btw_E1"/>
|
||||
</record>
|
||||
<record id="position_tax_extracom_7" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_non_eu"/>
|
||||
<field name="tax_src_id" ref="btw_21_buy"/>
|
||||
@@ -67,6 +82,11 @@
|
||||
<field name="tax_src_id" ref="btw_6_buy_d"/>
|
||||
<field name="tax_dest_id" ref="btw_E1"/>
|
||||
</record>
|
||||
<record id="position_tax_extracom_d_9" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_non_eu"/>
|
||||
<field name="tax_src_id" ref="btw_9_buy_d"/>
|
||||
<field name="tax_dest_id" ref="btw_E1"/>
|
||||
</record>
|
||||
<record id="position_tax_extracom_d_7" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_non_eu"/>
|
||||
<field name="tax_src_id" ref="btw_21_buy_d"/>
|
||||
@@ -89,6 +109,11 @@
|
||||
<field name="tax_src_id" ref="btw_6"/>
|
||||
<field name="tax_dest_id" ref="btw_X0"/>
|
||||
</record>
|
||||
<record id="position_tax_intracom_2_9" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu"/>
|
||||
<field name="tax_src_id" ref="btw_9"/>
|
||||
<field name="tax_dest_id" ref="btw_X0"/>
|
||||
</record>
|
||||
<record id="position_tax_intracom_3" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu"/>
|
||||
<field name="tax_src_id" ref="btw_21"/>
|
||||
@@ -109,6 +134,11 @@
|
||||
<field name="tax_src_id" ref="btw_6_d"/>
|
||||
<field name="tax_dest_id" ref="btw_X2"/>
|
||||
</record>
|
||||
<record id="position_tax_intracom_d_2_9" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu"/>
|
||||
<field name="tax_src_id" ref="btw_9_d"/>
|
||||
<field name="tax_dest_id" ref="btw_X2"/>
|
||||
</record>
|
||||
<record id="position_tax_intracom_d_3" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu"/>
|
||||
<field name="tax_src_id" ref="btw_21_d"/>
|
||||
@@ -124,6 +154,11 @@
|
||||
<field name="tax_src_id" ref="btw_6_buy"/>
|
||||
<field name="tax_dest_id" ref="btw_I_6"/>
|
||||
</record>
|
||||
<record id="position_tax_intracom_9" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu"/>
|
||||
<field name="tax_src_id" ref="btw_9_buy"/>
|
||||
<field name="tax_dest_id" ref="btw_I_9"/>
|
||||
</record>
|
||||
<record id="position_tax_intracom_7" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu"/>
|
||||
<field name="tax_src_id" ref="btw_21_buy"/>
|
||||
@@ -139,6 +174,11 @@
|
||||
<field name="tax_src_id" ref="btw_6_buy_d"/>
|
||||
<field name="tax_dest_id" ref="btw_I_6"/>
|
||||
</record>
|
||||
<record id="position_tax_intracom_d_9" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu"/>
|
||||
<field name="tax_src_id" ref="btw_9_buy_d"/>
|
||||
<field name="tax_dest_id" ref="btw_I_9"/>
|
||||
</record>
|
||||
<record id="position_tax_intracom_d_7" model="account.fiscal.position.tax.template">
|
||||
<field name="position_id" ref="fiscal_position_template_eu"/>
|
||||
<field name="tax_src_id" ref="btw_21_buy_d"/>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<record id="btw_6" model="account.tax.template">
|
||||
<field name="sequence">10</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Verkopen/omzet laag</field>
|
||||
<field name="name">Verkopen/omzet laag 6%</field>
|
||||
<field name="description">6% BTW</field>
|
||||
<field eval="6" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -30,6 +30,19 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_05'),ref('tag_nl_22')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6"/>
|
||||
</record>
|
||||
<record id="btw_9" model="account.tax.template">
|
||||
<field name="sequence">10</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Verkopen/omzet laag 9%</field>
|
||||
<field name="description">9% BTW</field>
|
||||
<field eval="9" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="vat_payable_l"/>
|
||||
<field name="account_id" ref="vat_payable_l"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_05'),ref('tag_nl_22')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9"/>
|
||||
</record>
|
||||
<record id="btw_21" model="account.tax.template">
|
||||
<field name="sequence">5</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
@@ -73,7 +86,7 @@
|
||||
<record id="btw_6_d" model="account.tax.template">
|
||||
<field name="sequence">10</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Verkopen/omzet laag diensten</field>
|
||||
<field name="name">Verkopen/omzet laag diensten 6%</field>
|
||||
<field name="description">6% BTW diensten</field>
|
||||
<field eval="6" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -83,6 +96,19 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_05'),ref('tag_nl_22')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6"/>
|
||||
</record>
|
||||
<record id="btw_9_d" model="account.tax.template">
|
||||
<field name="sequence">10</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Verkopen/omzet laag diensten 9%</field>
|
||||
<field name="description">9% BTW diensten</field>
|
||||
<field eval="9" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="vat_payable_l_d"/>
|
||||
<field name="account_id" ref="vat_payable_l_d"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_05'),ref('tag_nl_22')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9"/>
|
||||
</record>
|
||||
<record id="btw_21_d" model="account.tax.template">
|
||||
<field name="sequence">6</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
@@ -113,7 +139,7 @@
|
||||
<record id="btw_6_buy" model="account.tax.template">
|
||||
<field name="sequence">10</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">BTW te vorderen laag (inkopen)</field>
|
||||
<field name="name">BTW te vorderen laag (inkopen) 6%</field>
|
||||
<field name="description">6% BTW</field>
|
||||
<field eval="6" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -123,10 +149,24 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6"/>
|
||||
</record>
|
||||
<record id="btw_9_buy" model="account.tax.template">
|
||||
<field name="sequence">10</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">BTW te vorderen laag (inkopen) 9%</field>
|
||||
<field name="description">9% BTW</field>
|
||||
<field eval="9" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="vat_refund_l"/>
|
||||
<field name="account_id" ref="vat_refund_l"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9"/>
|
||||
</record>
|
||||
|
||||
<record id="btw_6_buy_incl" model="account.tax.template">
|
||||
<field name="sequence">10</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">BTW te vorderen laag (inkopen incl. BTW)</field>
|
||||
<field name="name">BTW te vorderen laag (inkopen incl. BTW) 6%</field>
|
||||
<field name="description">6% BTW Incl.</field>
|
||||
<field eval="6" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -137,6 +177,20 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6"/>
|
||||
</record>
|
||||
<record id="btw_9_buy_incl" model="account.tax.template">
|
||||
<field name="sequence">10</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">BTW te vorderen laag (inkopen incl. BTW) 9%</field>
|
||||
<field name="description">9% BTW Incl.</field>
|
||||
<field eval="9" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="price_include">True</field>
|
||||
<field name="refund_account_id" ref="vat_refund_l"/>
|
||||
<field name="account_id" ref="vat_refund_l"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9"/>
|
||||
</record>
|
||||
<record id="btw_21_buy" model="account.tax.template">
|
||||
<field name="sequence">5</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
@@ -181,7 +235,7 @@
|
||||
<record id="btw_6_buy_d" model="account.tax.template">
|
||||
<field name="sequence">10</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">BTW te vorderen laag (inkopen) diensten</field>
|
||||
<field name="name">BTW te vorderen laag (inkopen) diensten 6%</field>
|
||||
<field name="description">6% BTW diensten</field>
|
||||
<field eval="6" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -191,6 +245,19 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6"/>
|
||||
</record>
|
||||
<record id="btw_9_buy_d" model="account.tax.template">
|
||||
<field name="sequence">10</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">BTW te vorderen laag (inkopen) diensten 9%</field>
|
||||
<field name="description">9% BTW diensten</field>
|
||||
<field eval="9" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="vat_refund_l_d"/>
|
||||
<field name="account_id" ref="vat_refund_l_d"/>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9"/>
|
||||
</record>
|
||||
<record id="btw_21_buy_d" model="account.tax.template">
|
||||
<field name="sequence">6</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
@@ -231,7 +298,7 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_08')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_0"/>
|
||||
</record>
|
||||
<record id="btw_ink_0_1" model="account.tax.template">
|
||||
<record id="btw_ink_0_1" model="account.tax.template">
|
||||
<field name="sequence">98</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">BTW te vorderen verlegd (inkopen1)</field>
|
||||
@@ -276,7 +343,7 @@
|
||||
<record id="btw_I_6_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="sequence">21</field>
|
||||
<field name="name">Inkopen import binnen EU laag(1)</field>
|
||||
<field name="name">Inkopen import binnen EU laag(1) 6%</field>
|
||||
<field name="description">Inkopen import binnen EU laag(1)</field>
|
||||
<field eval="-6" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -286,10 +353,23 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_30')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6_eu"/>
|
||||
</record>
|
||||
<record id="btw_I_9_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="sequence">21</field>
|
||||
<field name="name">Inkopen import binnen EU laag(1) 9%</field>
|
||||
<field name="description">Inkopen import binnen EU laag(1)</field>
|
||||
<field eval="-9" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="vat_payable_l_eu"/>
|
||||
<field name="account_id" ref="vat_payable_l_eu"/>
|
||||
<field name="type_tax_use">none</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_30')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9_eu"/>
|
||||
</record>
|
||||
<record id="btw_I_6_2" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="sequence">22</field>
|
||||
<field name="name">Inkopen import binnen EU laag(2)</field>
|
||||
<field name="name">Inkopen import binnen EU laag(2) 6%</field>
|
||||
<field name="description">Inkopen import binnen EU laag(2)</field>
|
||||
<field eval="6" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -299,10 +379,23 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6_eu"/>
|
||||
</record>
|
||||
<record id="btw_I_9_2" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="sequence">22</field>
|
||||
<field name="name">Inkopen import binnen EU laag(2) 9%</field>
|
||||
<field name="description">Inkopen import binnen EU laag(2)</field>
|
||||
<field eval="9" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="vat_refund_l_eu"/>
|
||||
<field name="account_id" ref="vat_refund_l_eu"/>
|
||||
<field name="type_tax_use">none</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9_eu"/>
|
||||
</record>
|
||||
<record id="btw_I_6" model="account.tax.template">
|
||||
<field name="sequence">20</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import binnen EU laag</field>
|
||||
<field name="name">Inkopen import binnen EU laag 6%</field>
|
||||
<field name="description">6% BTW import binnen EU</field>
|
||||
<field eval="6" name="amount"/>
|
||||
<field name="amount_type">group</field>
|
||||
@@ -311,6 +404,18 @@
|
||||
<field name="children_tax_ids" eval="[(6, 0, [ref('btw_I_6_1'), ref('btw_I_6_2')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6_eu"/>
|
||||
</record>
|
||||
<record id="btw_I_9" model="account.tax.template">
|
||||
<field name="sequence">20</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import binnen EU laag 9%</field>
|
||||
<field name="description">9% BTW import binnen EU</field>
|
||||
<field eval="9" name="amount"/>
|
||||
<field name="amount_type">group</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_17')])]"/>
|
||||
<field name="children_tax_ids" eval="[(6, 0, [ref('btw_I_9_1'), ref('btw_I_9_2')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9_eu"/>
|
||||
</record>
|
||||
<record id="btw_I_21_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="sequence">21</field>
|
||||
@@ -418,7 +523,7 @@
|
||||
<record id="btw_I_6_d_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="sequence">21</field>
|
||||
<field name="name">Inkopen import binnen EU laag(1) diensten</field>
|
||||
<field name="name">Inkopen import binnen EU laag(1) diensten 6%</field>
|
||||
<field name="description">Inkopen import binnen EU laag(1) diensten</field>
|
||||
<field eval="-6" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -428,10 +533,23 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_30')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6_eu"/>
|
||||
</record>
|
||||
<record id="btw_I_9_d_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="sequence">21</field>
|
||||
<field name="name">Inkopen import binnen EU laag(1) diensten 9%</field>
|
||||
<field name="description">Inkopen import binnen EU laag(1) diensten</field>
|
||||
<field eval="-9" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="vat_payable_l_d_eu"/>
|
||||
<field name="account_id" ref="vat_payable_l_d_eu"/>
|
||||
<field name="type_tax_use">none</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_30')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9_eu"/>
|
||||
</record>
|
||||
<record id="btw_I_6_d_2" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="sequence">22</field>
|
||||
<field name="name">Inkopen import binnen EU laag(2) diensten</field>
|
||||
<field name="name">Inkopen import binnen EU laag(2) diensten 6%</field>
|
||||
<field name="description">Inkopen import binnen EU laag(2) diensten</field>
|
||||
<field eval="6" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -441,10 +559,23 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6_eu"/>
|
||||
</record>
|
||||
<record id="btw_I_9_d_2" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="sequence">22</field>
|
||||
<field name="name">Inkopen import binnen EU laag(2) diensten 9%</field>
|
||||
<field name="description">Inkopen import binnen EU laag(2) diensten</field>
|
||||
<field eval="9" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="vat_refund_l_d_eu"/>
|
||||
<field name="account_id" ref="vat_refund_l_d_eu"/>
|
||||
<field name="type_tax_use">none</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9_eu"/>
|
||||
</record>
|
||||
<record id="btw_I_6_d" model="account.tax.template">
|
||||
<field name="sequence">20</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import binnen EU laag diensten</field>
|
||||
<field name="name">Inkopen import binnen EU laag diensten 6%</field>
|
||||
<field name="description">6% BTW import binnen EU diensten</field>
|
||||
<field eval="6" name="amount"/>
|
||||
<field name="amount_type">group</field>
|
||||
@@ -453,6 +584,18 @@
|
||||
<field name="children_tax_ids" eval="[(6, 0, [ref('btw_I_6_d_1'), ref('btw_I_6_d_2')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6_eu"/>
|
||||
</record>
|
||||
<record id="btw_I_9_d" model="account.tax.template">
|
||||
<field name="sequence">20</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import binnen EU laag diensten 9%</field>
|
||||
<field name="description">9% BTW import binnen EU diensten</field>
|
||||
<field eval="9" name="amount"/>
|
||||
<field name="amount_type">group</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_17')])]"/>
|
||||
<field name="children_tax_ids" eval="[(6, 0, [ref('btw_I_9_d_1'), ref('btw_I_9_d_2')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9_eu"/>
|
||||
</record>
|
||||
<record id="btw_I_21_d_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="sequence">21</field>
|
||||
@@ -534,7 +677,7 @@
|
||||
<!-- BTW inkoop -->
|
||||
<record id="btw_E1_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU laag(1)</field>
|
||||
<field name="name">Inkopen import buiten EU laag(1) 6%</field>
|
||||
<field name="description">Inkopen import buiten EU laag(1)</field>
|
||||
<field eval="-6" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -545,9 +688,22 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_29')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6_niet_eu"/>
|
||||
</record>
|
||||
<record id="btw_E1_1_9" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU laag(1) 9%</field>
|
||||
<field name="description">Inkopen import buiten EU laag(1)</field>
|
||||
<field eval="-9" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="vat_payable_l_non_eu"/>
|
||||
<field name="account_id" ref="vat_payable_l_non_eu"/>
|
||||
<field name="sequence">21</field>
|
||||
<field name="type_tax_use">none</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_29')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9_niet_eu"/>
|
||||
</record>
|
||||
<record id="btw_E1_2" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU laag(2)</field>
|
||||
<field name="name">Inkopen import buiten EU laag(2) 6%</field>
|
||||
<field name="description">Inkopen import buiten EU laag(2)</field>
|
||||
<field eval="6" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -558,10 +714,23 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6_niet_eu"/>
|
||||
</record>
|
||||
<record id="btw_E1_2_9" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU laag(2) 9%</field>
|
||||
<field name="description">Inkopen import buiten EU laag(2)</field>
|
||||
<field eval="9" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="vat_refund_l_non_eu"/>
|
||||
<field name="account_id" ref="vat_refund_l_non_eu"/>
|
||||
<field name="sequence">22</field>
|
||||
<field name="type_tax_use">none</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9_niet_eu"/>
|
||||
</record>
|
||||
<record id="btw_E1" model="account.tax.template">
|
||||
<field name="sequence">20</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU laag</field>
|
||||
<field name="name">Inkopen import buiten EU laag 6%</field>
|
||||
<field name="description">BTW import buiten EU laag inkopen</field>
|
||||
<field eval="6" name="amount"/>
|
||||
<field name="amount_type">group</field>
|
||||
@@ -570,6 +739,18 @@
|
||||
<field name="children_tax_ids" eval="[(6, 0, [ref('btw_E1_1'), ref('btw_E1_2')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6_niet_eu"/>
|
||||
</record>
|
||||
<record id="btw_E1_9" model="account.tax.template">
|
||||
<field name="sequence">20</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU laag 9%</field>
|
||||
<field name="description">BTW import buiten EU laag inkopen</field>
|
||||
<field eval="9" name="amount"/>
|
||||
<field name="amount_type">group</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_16')])]"/>
|
||||
<field name="children_tax_ids" eval="[(6, 0, [ref('btw_E1_1_9'), ref('btw_E1_2_9')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9_niet_eu"/>
|
||||
</record>
|
||||
<record id="btw_E2_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU hoog(1)</field>
|
||||
@@ -676,7 +857,7 @@
|
||||
<!-- BTW inkoop diensten -->
|
||||
<record id="btw_E1_d_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU laag(1) diensten</field>
|
||||
<field name="name">Inkopen import buiten EU laag(1) diensten 6%</field>
|
||||
<field name="description">Inkopen import buiten EU laag(1) diensten</field>
|
||||
<field eval="-6" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -687,9 +868,22 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_29')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6_niet_eu"/>
|
||||
</record>
|
||||
<record id="btw_E1_d_1_9" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU laag(1) diensten 9%</field>
|
||||
<field name="description">Inkopen import buiten EU laag(1) diensten</field>
|
||||
<field eval="-9" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="vat_payable_l_d_non_eu"/>
|
||||
<field name="account_id" ref="vat_payable_l_d_non_eu"/>
|
||||
<field name="sequence">21</field>
|
||||
<field name="type_tax_use">none</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_29')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9_niet_eu"/>
|
||||
</record>
|
||||
<record id="btw_E1_d_2" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU laag(2) diensten</field>
|
||||
<field name="name">Inkopen import buiten EU laag(2) diensten 6%</field>
|
||||
<field name="description">Inkopen import buiten EU laag(2) diensten</field>
|
||||
<field eval="6" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
@@ -700,10 +894,23 @@
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6_niet_eu"/>
|
||||
</record>
|
||||
<record id="btw_E1_d_2_9" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU laag(2) diensten 9%</field>
|
||||
<field name="description">Inkopen import buiten EU laag(2) diensten</field>
|
||||
<field eval="9" name="amount"/>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="refund_account_id" ref="vat_refund_l_d_non_eu"/>
|
||||
<field name="account_id" ref="vat_refund_l_d_non_eu"/>
|
||||
<field name="sequence">22</field>
|
||||
<field name="type_tax_use">none</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_33')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9_niet_eu"/>
|
||||
</record>
|
||||
<record id="btw_E1_d" model="account.tax.template">
|
||||
<field name="sequence">20</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU laag diensten</field>
|
||||
<field name="name">Inkopen import buiten EU laag diensten 6%</field>
|
||||
<field name="description">BTW import buiten EU laag inkopen diensten</field>
|
||||
<field eval="6" name="amount"/>
|
||||
<field name="amount_type">group</field>
|
||||
@@ -712,6 +919,18 @@
|
||||
<field name="children_tax_ids" eval="[(6, 0, [ref('btw_E1_d_1'), ref('btw_E1_d_2')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_6_niet_eu"/>
|
||||
</record>
|
||||
<record id="btw_E1_d_9" model="account.tax.template">
|
||||
<field name="sequence">20</field>
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU laag diensten 9%</field>
|
||||
<field name="description">BTW import buiten EU laag inkopen diensten</field>
|
||||
<field eval="9" name="amount"/>
|
||||
<field name="amount_type">group</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_nl_16')])]"/>
|
||||
<field name="children_tax_ids" eval="[(6, 0, [ref('btw_E1_d_1_9'), ref('btw_E1_d_2_9')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_9_niet_eu"/>
|
||||
</record>
|
||||
<record id="btw_E2_d_1" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10nnl_chart_template"/>
|
||||
<field name="name">Inkopen import buiten EU hoog(1) diensten</field>
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
<record id="tax_group_10" model="account.tax.group">
|
||||
<field name="name">MVA 10%</field>
|
||||
</record>
|
||||
<record id="tax_group_12" model="account.tax.group">
|
||||
<field name="name">MVA 12%</field>
|
||||
</record>
|
||||
<record id="tax_group_15" model="account.tax.group">
|
||||
<field name="name">MVA 15%</field>
|
||||
</record>
|
||||
|
||||
@@ -103,7 +103,19 @@
|
||||
<field name="account_id" ref="chart2704"/>
|
||||
<field name="refund_account_id" ref="chart2704"/>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_no_06'),ref('tag_no_15')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_10"/>
|
||||
<field name="tax_group_id" ref="tax_group_10"/>
|
||||
</record>
|
||||
<record id="tax3b" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="no_chart_template"/>
|
||||
<field name="name">Utgående 12% mva</field>
|
||||
<field name="description">Utgående 12% mva</field>
|
||||
<field name="amount">12</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="account_id" ref="chart2704"/>
|
||||
<field name="refund_account_id" ref="chart2704"/>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_no_06'),ref('tag_no_15')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_12"/>
|
||||
</record>
|
||||
<record id="tax4" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="no_chart_template"/>
|
||||
@@ -139,9 +151,20 @@
|
||||
<field name="account_id" ref="chart2714"/>
|
||||
<field name="refund_account_id" ref="chart2714"/>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_no_09'),ref('tag_no_12')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_10"/>
|
||||
<field name="tax_group_id" ref="tax_group_10"/>
|
||||
</record>
|
||||
<record id="tax6b" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="no_chart_template"/>
|
||||
<field name="name">Inngående 12% mva</field>
|
||||
<field name="description">Inngående 12% mva</field>
|
||||
<field name="amount">12</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="account_id" ref="chart2714"/>
|
||||
<field name="refund_account_id" ref="chart2714"/>
|
||||
<field name="tag_ids" eval="[(6,0,[ref('tag_no_09'),ref('tag_no_12')])]"/>
|
||||
<field name="tax_group_id" ref="tax_group_12"/>
|
||||
</record>
|
||||
|
||||
<record id="tax7" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="no_chart_template"/>
|
||||
<field name="name">Inngående 0% mva</field>
|
||||
|
||||
@@ -382,17 +382,36 @@ class ProductProduct(models.Model):
|
||||
self.check_access_rule("read")
|
||||
|
||||
result = []
|
||||
|
||||
# Prefetch the fields used by the `name_get`, so `browse` doesn't fetch other fields
|
||||
# Use `load=False` to not call `name_get` for the `product_tmpl_id`
|
||||
self.sudo().read(['name', 'default_code', 'product_tmpl_id', 'attribute_value_ids'], load=False)
|
||||
|
||||
product_template_ids = self.sudo().mapped('product_tmpl_id').ids
|
||||
|
||||
if partner_ids:
|
||||
supplier_info = self.env['product.supplierinfo'].sudo().search([
|
||||
('product_tmpl_id', 'in', product_template_ids),
|
||||
('name', 'in', partner_ids),
|
||||
])
|
||||
# Prefetch the fields used by the `name_get`, so `browse` doesn't fetch other fields
|
||||
# Use `load=False` to not call `name_get` for the `product_tmpl_id` and `product_id`
|
||||
supplier_info.sudo().read(['product_tmpl_id', 'product_id', 'product_name', 'product_code'], load=False)
|
||||
supplier_info_by_template = {}
|
||||
for r in supplier_info:
|
||||
supplier_info_by_template.setdefault(r.product_tmpl_id, []).append(r)
|
||||
for product in self.sudo():
|
||||
# display only the attributes with multiple possible values on the template
|
||||
variable_attributes = product.attribute_line_ids.filtered(lambda l: len(l.value_ids) > 1).mapped('attribute_id')
|
||||
variable_attributes = product.attribute_value_ids.filtered(lambda v: len(v.attribute_id.value_ids) > 1).mapped('attribute_id')
|
||||
variant = product.attribute_value_ids._variant_name(variable_attributes)
|
||||
|
||||
name = variant and "%s (%s)" % (product.name, variant) or product.name
|
||||
sellers = []
|
||||
if partner_ids:
|
||||
sellers = [x for x in product.seller_ids if (x.name.id in partner_ids) and (x.product_id == product)]
|
||||
product_supplier_info = supplier_info_by_template.get(product.product_tmpl_id, [])
|
||||
sellers = [x for x in product_supplier_info if x.product_id and x.product_id == product]
|
||||
if not sellers:
|
||||
sellers = [x for x in product.seller_ids if (x.name.id in partner_ids) and not x.product_id]
|
||||
sellers = [x for x in product_supplier_info if not x.product_id]
|
||||
if sellers:
|
||||
for s in sellers:
|
||||
seller_variant = s.product_name and (
|
||||
|
||||
@@ -354,6 +354,8 @@ class ProductTemplate(models.Model):
|
||||
|
||||
@api.multi
|
||||
def name_get(self):
|
||||
# Prefetch the fields used by the `name_get`, so `browse` doesn't fetch other fields
|
||||
self.read(['name', 'default_code'])
|
||||
return [(template.id, '%s%s' % (template.default_code and '[%s] ' % template.default_code or '', template.name))
|
||||
for template in self]
|
||||
|
||||
|
||||
@@ -74,10 +74,10 @@ class PurchaseReport(models.Model):
|
||||
extract(epoch from age(s.date_approve,s.date_order))/(24*60*60)::decimal(16,2) as delay,
|
||||
extract(epoch from age(l.date_planned,s.date_order))/(24*60*60)::decimal(16,2) as delay_pass,
|
||||
count(*) as nbr_lines,
|
||||
sum(l.price_unit / COALESCE(cr.rate, 1.0) * l.product_qty)::decimal(16,2) as price_total,
|
||||
avg(100.0 * (l.price_unit / COALESCE(cr.rate,1.0) * l.product_qty) / NULLIF(ip.value_float*l.product_qty/u.factor*u2.factor, 0.0))::decimal(16,2) as negociation,
|
||||
sum(l.price_unit / COALESCE(NULLIF(cr.rate, 0), 1.0) * l.product_qty)::decimal(16,2) as price_total,
|
||||
avg(100.0 * (l.price_unit / COALESCE(NULLIF(cr.rate, 0),1.0) * l.product_qty) / NULLIF(ip.value_float*l.product_qty/u.factor*u2.factor, 0.0))::decimal(16,2) as negociation,
|
||||
sum(ip.value_float*l.product_qty/u.factor*u2.factor)::decimal(16,2) as price_standard,
|
||||
(sum(l.product_qty * l.price_unit / COALESCE(cr.rate, 1.0))/NULLIF(sum(l.product_qty/u.factor*u2.factor),0.0))::decimal(16,2) as price_average,
|
||||
(sum(l.product_qty * l.price_unit / COALESCE(NULLIF(cr.rate, 0), 1.0))/NULLIF(sum(l.product_qty/u.factor*u2.factor),0.0))::decimal(16,2) as price_average,
|
||||
partner.country_id as country_id,
|
||||
partner.commercial_partner_id as commercial_partner_id,
|
||||
analytic_account.id as account_analytic_id,
|
||||
|
||||
@@ -263,7 +263,14 @@ class SaleOrderLine(models.Model):
|
||||
|
||||
@api.onchange('product_uom_qty')
|
||||
def _onchange_product_uom_qty(self):
|
||||
if self.state == 'sale' and self.product_id.type in ['product', 'consu'] and self.product_uom_qty < self._origin.product_uom_qty:
|
||||
# When modifying a one2many, _origin doesn't guarantee that its values will be the ones
|
||||
# in database. Hence, we need to explicitly read them from there.
|
||||
if self._origin:
|
||||
product_uom_qty_origin = self._origin.read(["product_uom_qty"])[0]["product_uom_qty"]
|
||||
else:
|
||||
product_uom_qty_origin = 0
|
||||
|
||||
if self.state == 'sale' and self.product_id.type in ['product', 'consu'] and self.product_uom_qty < product_uom_qty_origin:
|
||||
# Do not display this warning if the new quantity is below the delivered
|
||||
# one; the `write` will raise an `UserError` anyway.
|
||||
if self.product_uom_qty < self.qty_delivered:
|
||||
|
||||
@@ -387,7 +387,7 @@ class InventoryLine(models.Model):
|
||||
"""
|
||||
for line in self:
|
||||
if line.product_id.type != 'product':
|
||||
raise UserError(_("You can only adjust stockable products."))
|
||||
raise UserError(_("You can only adjust stockable products.") + '\n\n%s -> %s' % (line.product_id.display_name, line.product_id.type))
|
||||
|
||||
def _get_quants(self):
|
||||
return self.env['stock.quant'].search([
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<template id="report_location_barcode">
|
||||
<t t-call="web.html_container">
|
||||
<div t-foreach="[docs[x:x+4] for x in xrange(0, len(docs), 4)]" t-as="page_docs" class="page article page_stock_location_barcodes">
|
||||
<div t-foreach="[docs[x:x+4] for x in range(0, len(docs), 4)]" t-as="page_docs" class="page article page_stock_location_barcodes">
|
||||
<t t-foreach="page_docs" t-as="o">
|
||||
<t t-if="o.barcode"><t t-set="content" t-value="o.barcode"/></t>
|
||||
<t t-if="not o.barcode"><t t-set="content" t-value="o.name"/></t>
|
||||
|
||||
@@ -8,7 +8,7 @@ class StockPickingToBatch(models.TransientModel):
|
||||
_name = 'stock.picking.to.batch'
|
||||
_description = 'Add pickings to a batch picking'
|
||||
|
||||
batch_id = fields.Many2one('stock.picking.batch', string='Batch Picking', required=True, oldname="wave_id")
|
||||
batch_id = fields.Many2one('stock.picking.batch', string='Batch Picking', oldname="wave_id")
|
||||
|
||||
@api.multi
|
||||
def attach_pickings(self):
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Add pickings to batch">
|
||||
<separator string="Select a batch"/>
|
||||
<field name="batch_id" class="oe_inline" options="{'no_create_edit': True, 'no_open': True}"/>
|
||||
<field name="batch_id" class="oe_inline" required="1" options="{'no_create_edit': True, 'no_open': True}"/>
|
||||
<footer>
|
||||
<button name="attach_pickings" type="object" string="Add to Batch" class="btn-primary"/>
|
||||
<button string="Cancel" class="btn-default" special="cancel"/>
|
||||
|
||||
@@ -3995,11 +3995,24 @@ var BasicModel = AbstractModel.extend({
|
||||
}
|
||||
return def.then(function () {
|
||||
var resIDs = [];
|
||||
// generate the current count and res_ids list by applying the changes
|
||||
var currentCount = list.count;
|
||||
var currentResIDs = list.res_ids;
|
||||
var effectiveLimit = (list.limit || 0) - (list.tempLimitIncrement || 0);
|
||||
var upperBound = effectiveLimit ? Math.min(list.offset + effectiveLimit, currentCount) : currentCount;
|
||||
// if new records have been added to the list, their virtual ids have
|
||||
// been pushed at the end of res_ids (or at the beginning, depending
|
||||
// on the editable property), ignoring completely the current page
|
||||
// where the records have actually been created ; for that reason,
|
||||
// we use orderedResIDs which is a freezed order with the virtual ids
|
||||
// at the correct position where they were actually inserted ; however,
|
||||
// when we use orderedResIDs, we must filter out ids that are not in
|
||||
// res_ids, which correspond to records that have been removed from
|
||||
// the relation (this information being taken into account in res_ids
|
||||
// but not in orderedResIDs)
|
||||
if (list.orderedResIDs) {
|
||||
currentResIDs = list.orderedResIDs.filter(function (resID) {
|
||||
return list.res_ids.indexOf(resID) >= 0;
|
||||
});
|
||||
}
|
||||
var currentCount = currentResIDs.length;
|
||||
var upperBound = list.limit ? Math.min(list.offset + list.limit, currentCount) : currentCount;
|
||||
var fieldNames = list.getFieldNames();
|
||||
for (var i = list.offset; i < upperBound; i++) {
|
||||
var resId = currentResIDs[i];
|
||||
|
||||
@@ -148,6 +148,21 @@ var BasicView = AbstractView.extend({
|
||||
if (_.difference(fieldViewTypes, recordViewTypes).length) {
|
||||
fieldNames.push(name);
|
||||
}
|
||||
|
||||
if (record.data[name].viewType === 'default') {
|
||||
// Use case: x2many (tags) in x2many list views
|
||||
// When opening the x2many record form view, the
|
||||
// x2many will be reloaded but it may not have
|
||||
// the same fields (ex: tags in list and list in
|
||||
// form) so we need to merge the fieldsInfo to
|
||||
// avoid losing the initial fields (display_name)
|
||||
var defaultFieldInfo = record.data[name].fieldsInfo.default;
|
||||
_.each(fieldViews, function (fieldView) {
|
||||
_.each(fieldView.fieldsInfo, function (x2mFieldInfo) {
|
||||
_.defaults(x2mFieldInfo, defaultFieldInfo);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
// Many2one: context is not the same between the different views
|
||||
|
||||
@@ -244,18 +244,18 @@ return AbstractModel.extend({
|
||||
this.setDate(this.data.target_date.clone().add(-1, this.data.scale));
|
||||
},
|
||||
/**
|
||||
* @todo: this should not work. it ignores the domain/context
|
||||
*
|
||||
* @override
|
||||
* @param {any} _handle ignored
|
||||
* @param {Object} params
|
||||
* @param {Object} [params.context]
|
||||
* @param {Array} [params.domain]
|
||||
* @returns {Deferred}
|
||||
*/
|
||||
reload: function (_handle, params) {
|
||||
reload: function (handle, params) {
|
||||
if (params.domain) {
|
||||
this.data.domain = params.domain;
|
||||
}
|
||||
if (params.context) {
|
||||
this.data.context = params.context;
|
||||
}
|
||||
return this._loadCalendar();
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -2853,7 +2853,7 @@ QUnit.module('relational_fields', {
|
||||
$modal.find('thead input[type=checkbox]').click();
|
||||
|
||||
$modal.find('.btn.btn-sm.btn-primary.o_select_button').click();
|
||||
|
||||
|
||||
pager_limit = form.$('.o_field_many2many.o_field_widget.o_field_x2many.o_field_x2many_list .o_pager_limit');
|
||||
assert.equal(pager_limit.text(), '51',
|
||||
'We should have 51 records in the m2m field');
|
||||
@@ -4000,6 +4000,50 @@ QUnit.module('relational_fields', {
|
||||
form.destroy();
|
||||
});
|
||||
|
||||
QUnit.test('delete a record while adding another one in a multipage', function (assert) {
|
||||
// in a many2one with at least 2 pages, add a new line. Delete the line above it.
|
||||
// (the onchange makes it so that the virtualID is inserted in the middle of the currentResIDs.)
|
||||
// it should load the next line to display it on the page.
|
||||
assert.expect(2);
|
||||
|
||||
this.data.partner.records[0].turtles = [2, 3];
|
||||
this.data.partner.onchanges.turtles = function (obj) {
|
||||
obj.turtles = [[5]].concat(obj.turtles);
|
||||
};
|
||||
|
||||
var form = createView({
|
||||
View: FormView,
|
||||
model: 'partner',
|
||||
data: this.data,
|
||||
arch:'<form string="Partners">' +
|
||||
'<sheet>' +
|
||||
'<group>' +
|
||||
'<field name="turtles">' +
|
||||
'<tree editable="bottom" limit="1" decoration-muted="turtle_bar == False">' +
|
||||
'<field name="turtle_foo"/>' +
|
||||
'<field name="turtle_bar"/>' +
|
||||
'</tree>' +
|
||||
'</field>' +
|
||||
'</group>' +
|
||||
'</sheet>' +
|
||||
'</form>',
|
||||
res_id: 1,
|
||||
});
|
||||
|
||||
form.$buttons.find('.o_form_button_edit').click();
|
||||
// add a line (virtual record)
|
||||
form.$('.o_field_x2many_list_row_add a').click();
|
||||
form.$('.o_input').val('pi').trigger('input');
|
||||
// delete the line above it
|
||||
form.$('.o_list_record_delete').first().click();
|
||||
// the next line should be displayed below the newly added one
|
||||
assert.strictEqual(form.$('.o_data_row').length, 2, "should have 2 records");
|
||||
assert.strictEqual(form.$('.o_data_row').text(), 'pikawa',
|
||||
"should display the correct records on page 1");
|
||||
|
||||
form.destroy();
|
||||
});
|
||||
|
||||
QUnit.test('onchange returning a command 6 for an x2many', function (assert) {
|
||||
assert.expect(2);
|
||||
|
||||
@@ -6270,7 +6314,7 @@ QUnit.module('relational_fields', {
|
||||
'</form>',
|
||||
res_id: 1,
|
||||
mockRPC: function (route, args) {
|
||||
assert.step(args.method + ' ' + args.model)
|
||||
assert.step(args.method + ' ' + args.model);
|
||||
return this._super(route, args);
|
||||
},
|
||||
viewOptions: {
|
||||
@@ -11992,6 +12036,53 @@ QUnit.module('relational_fields', {
|
||||
form.destroy();
|
||||
});
|
||||
|
||||
QUnit.test('widget many2many_tags in one2many with display_name', function (assert) {
|
||||
assert.expect(4);
|
||||
this.data.turtle.records[0].partner_ids = [2];
|
||||
|
||||
var form = createView({
|
||||
View: FormView,
|
||||
model: 'partner',
|
||||
data: this.data,
|
||||
arch: '<form string="Partners">' +
|
||||
'<sheet>' +
|
||||
'<field name="turtles">' +
|
||||
'<tree>' +
|
||||
'<field name="partner_ids" widget="many2many_tags"/>' + // will use display_name
|
||||
'</tree>' +
|
||||
'<form>' +
|
||||
'<sheet>' +
|
||||
'<field name="partner_ids"/>' +
|
||||
'</sheet>' +
|
||||
'</form>' +
|
||||
'</field>' +
|
||||
'</sheet>' +
|
||||
'</form>',
|
||||
archs: {
|
||||
'partner,false,list': '<tree><field name="foo"/></tree>',
|
||||
},
|
||||
res_id: 1,
|
||||
});
|
||||
|
||||
assert.strictEqual(form.$('.o_field_one2many[name="turtles"] .o_list_view .o_field_many2manytags[name="partner_ids"]').text().replace(/\s/g, ''),
|
||||
"secondrecordaaa", "the tags should be correctly rendered");
|
||||
|
||||
// open the x2m form view
|
||||
form.$('.o_field_one2many[name="turtles"] .o_list_view td.o_data_cell:first').click();
|
||||
assert.strictEqual($('.modal .o_form_view .o_field_many2many[name="partner_ids"] .o_list_view .o_data_cell').text(),
|
||||
"blipMy little Foo Value", "the list view should be correctly rendered with foo");
|
||||
|
||||
$('.modal button.o_form_button_cancel').click();
|
||||
assert.strictEqual(form.$('.o_field_one2many[name="turtles"] .o_list_view .o_field_many2manytags[name="partner_ids"]').text().replace(/\s/g, ''),
|
||||
"secondrecordaaa", "the tags should still be correctly rendered");
|
||||
|
||||
form.$buttons.find('.o_form_button_edit').click();
|
||||
assert.strictEqual(form.$('.o_field_one2many[name="turtles"] .o_list_view .o_field_many2manytags[name="partner_ids"]').text().replace(/\s/g, ''),
|
||||
"secondrecordaaa", "the tags should still be correctly rendered");
|
||||
|
||||
form.destroy();
|
||||
});
|
||||
|
||||
QUnit.module('FieldRadio');
|
||||
|
||||
QUnit.test('fieldradio widget on a many2one in a new record', function (assert) {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
Switzerland, 20.12.2018
|
||||
|
||||
Martronic SA 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,
|
||||
|
||||
Fabien Moret info@martronic.ch https://github.com/Martronic-SA
|
||||
|
||||
List of contributors:
|
||||
|
||||
Fabien Moret info@martronic.ch https://github.com/Martronic-SA
|
||||
@@ -0,0 +1,25 @@
|
||||
The United States of America, 2018-12-04
|
||||
|
||||
Open Source Integrators 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,
|
||||
|
||||
Greg Mader gmader@opensourceintegrators.com https://github.com/gmader
|
||||
|
||||
List of contributors:
|
||||
|
||||
Greg Mader gmader@opensourceintegrators.com https://github.com/gmader
|
||||
Antonio Yamuta ayamuta@opensourceintegrators.com https://github.com/agyamuta
|
||||
Balaji Kannan bkannan@opensourceintegrators.com https://github.com/b-kannan
|
||||
Bhavesh Odedra bodedra@opensourceintegrators.com https://github.com/bodedra
|
||||
Mayank Gosai mgosai@opensourceintegrators.com https://github.com/mgosai
|
||||
Maxime Chambreuil mchambreuil@opensourceintegrators.com https://github.com/max3903
|
||||
Michael Allen mallen@opensourceintegrators.com https://github.com/osimallen
|
||||
Sandeep Magukiya smangukiya@opensourceintegrators.com https://github.com/smangukiya
|
||||
Steven Campbell scampbell@opensourceintegrators.com https://github.com/osi-scampbell
|
||||
Sudarshan Kadalazhi skadalazhi@opensourceintegrators.com https://github.com/sudarshan1607
|
||||
Wolfgang Hall shall@opensourceintegrators.com https://github.com/wolfhall
|
||||
@@ -0,0 +1,11 @@
|
||||
India, 2018-11-28
|
||||
|
||||
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,
|
||||
|
||||
Anand Kansagra kansagraanand@hotmail.com https://github.com/anandkansagra
|
||||
@@ -0,0 +1,9 @@
|
||||
India, 2018-12-20
|
||||
|
||||
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,
|
||||
|
||||
Darshan Patel darshan.barcelona@gmail.com https://github.com/darshan-odoo
|
||||
@@ -0,0 +1,11 @@
|
||||
China, 2018-11-20
|
||||
|
||||
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,
|
||||
|
||||
doun doun@163.com https://github.com/doun
|
||||
@@ -0,0 +1,11 @@
|
||||
Spain, 2018-09-19
|
||||
|
||||
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,
|
||||
|
||||
Enric Tobella etobella@creublanca.es https://github.com/etobella
|
||||
@@ -12,8 +12,8 @@ Graph a method
|
||||
|
||||
Odoo embeds a profiler of code. This embeded profiler output can be used to
|
||||
generate a graph of calls triggered by the method, number of queries, percentage
|
||||
of time taken in the method itself as well as time taken in method and it's
|
||||
sub-called methods.
|
||||
of time taken in the method itself as well as the time that the method took and
|
||||
its sub-called methods.
|
||||
|
||||
.. code:: python
|
||||
|
||||
@@ -23,7 +23,7 @@ sub-called methods.
|
||||
@api.multi
|
||||
def mymethod(...)
|
||||
|
||||
This produce a file called /temp/prof.profile
|
||||
This produces a file called /temp/prof.profile
|
||||
|
||||
A tool called *gprof2dot* will produce a graph with this result:
|
||||
|
||||
@@ -37,7 +37,7 @@ A tool called *xdot* will display the resulting graph:
|
||||
|
||||
xdot /temp/prof.xdot
|
||||
|
||||
The profiler can be also used without saving data in a file.
|
||||
The profiler can be also used without saving data in a file:
|
||||
|
||||
.. code:: python
|
||||
|
||||
@@ -78,7 +78,7 @@ completely reviewed.
|
||||
Dump stack
|
||||
==========
|
||||
|
||||
Sending the SIGQUIT signal to an odoo process (only available on POSIX) makes
|
||||
Sending the SIGQUIT signal to an Odoo process (only available on POSIX) makes
|
||||
this process output the current stack trace to log, with info level. When an
|
||||
odoo process seems stucked, sending this signal to the process permit to know
|
||||
what the process is doing, and letting the process continue his job.
|
||||
@@ -86,8 +86,8 @@ what the process is doing, and letting the process continue his job.
|
||||
Tracing code execution
|
||||
======================
|
||||
|
||||
Instead of sending the SIGQUIT signal to an odoo process often enough, to check
|
||||
where processes is performing worse than expected, we can use pyflame tool to
|
||||
Instead of sending the SIGQUIT signal to an Odoo process often enough, to check
|
||||
where the processes are performing worse than expected, we can use the pyflame tool to
|
||||
do it for us.
|
||||
|
||||
Install pyflame and flamegraph
|
||||
@@ -118,7 +118,7 @@ Once done, we'll display them as an execution graph.
|
||||
|
||||
where <PID> is the process ID of the odoo process you want to graph. This will
|
||||
wait until the dead of the process, with a maximum of one hour, and and get 5
|
||||
traces a second. With the output of pyflame, we can produce an svg graph with
|
||||
traces a second. With the output of pyflame, we can produce an SVG graph with
|
||||
the flamegraph tool:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
<record id="VND" model="res.currency">
|
||||
<field name="name">VND</field>
|
||||
<field name="symbol">₫</field>
|
||||
<field name="rounding">0.01</field>
|
||||
<field name="rounding">1.00</field>
|
||||
<field name="active" eval="False"/>
|
||||
<field name="currency_unit_label">Dong</field>
|
||||
<field name="currency_subunit_label">Xu</field>
|
||||
|
||||
@@ -649,6 +649,7 @@ class Partner(models.Model):
|
||||
where_query = self._where_calc(args)
|
||||
self._apply_ir_rules(where_query, 'read')
|
||||
from_clause, where_clause, where_clause_params = where_query.get_sql()
|
||||
from_str = from_clause if from_clause else 'res_partner'
|
||||
where_str = where_clause and (" WHERE %s AND " % where_clause) or ' WHERE '
|
||||
|
||||
# search on the name of the contacts and of its company
|
||||
@@ -660,8 +661,8 @@ class Partner(models.Model):
|
||||
|
||||
unaccent = get_unaccent_wrapper(self.env.cr)
|
||||
|
||||
query = """SELECT id
|
||||
FROM res_partner
|
||||
query = """SELECT res_partner.id
|
||||
FROM {from_str}
|
||||
{where} ({email} {operator} {percent}
|
||||
OR {display_name} {operator} {percent}
|
||||
OR {reference} {operator} {percent}
|
||||
@@ -669,13 +670,14 @@ class Partner(models.Model):
|
||||
-- don't panic, trust postgres bitmap
|
||||
ORDER BY {display_name} {operator} {percent} desc,
|
||||
{display_name}
|
||||
""".format(where=where_str,
|
||||
""".format(from_str=from_str,
|
||||
where=where_str,
|
||||
operator=operator,
|
||||
email=unaccent('email'),
|
||||
display_name=unaccent('display_name'),
|
||||
reference=unaccent('ref'),
|
||||
email=unaccent('res_partner.email'),
|
||||
display_name=unaccent('res_partner.display_name'),
|
||||
reference=unaccent('res_partner.ref'),
|
||||
percent=unaccent('%s'),
|
||||
vat=unaccent('vat'),)
|
||||
vat=unaccent('res_partner.vat'),)
|
||||
|
||||
where_clause_params += [search_name]*5
|
||||
if limit:
|
||||
|
||||
@@ -30,6 +30,7 @@ from . import test_user_has_group
|
||||
from . import test_view_validation
|
||||
from . import test_views
|
||||
from . import test_xmlrpc
|
||||
from . import test_res_partner
|
||||
from . import test_res_partner_bank
|
||||
from . import test_reports
|
||||
from . import test_tests_tags
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
|
||||
class TestPartner(TransactionCase):
|
||||
|
||||
def test_name_search(self):
|
||||
""" Check name_search on partner, especially with domain based on auto_join
|
||||
user_ids field. Check specific SQL of name_search correctly handle joined tables. """
|
||||
test_partner = self.env['res.partner'].create({'name': 'Vlad the Impaler'})
|
||||
test_user = self.env['res.users'].create({'name': 'Vlad the Impaler', 'login': 'vlad', 'email': 'vlad.the.impaler@example.com'})
|
||||
|
||||
ns_res = self.env['res.partner'].name_search('Vlad', operator='ilike')
|
||||
self.assertEqual(set(i[0] for i in ns_res), set((test_partner | test_user.partner_id).ids))
|
||||
|
||||
ns_res = self.env['res.partner'].name_search('Vlad', args=[('user_ids.email', 'ilike', 'vlad')])
|
||||
self.assertEqual(set(i[0] for i in ns_res), set(test_user.partner_id.ids))
|
||||
@@ -138,7 +138,7 @@ def check(f):
|
||||
pass
|
||||
raise ValidationError(msg)
|
||||
else:
|
||||
raise ValidationError(inst[0])
|
||||
raise ValidationError(inst.args[0])
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
Reference in New Issue
Block a user