Merge lp:~camptocamp/openobject-addons/ocb-6.1-fix_1311004_account_move_line_index-afe into lp:openobject-addons/6.1

Proposed by Alexandre Fayolle - camptocamp
Status: Superseded
Proposed branch: lp:~camptocamp/openobject-addons/ocb-6.1-fix_1311004_account_move_line_index-afe
Merge into: lp:openobject-addons/6.1
Diff against target: 3815 lines (+1494/-563)
78 files modified
account/__init__.py (+1/-1)
account/account.py (+59/-16)
account/account_invoice.py (+205/-39)
account/account_invoice_view.xml (+5/-1)
account/account_invoice_workflow.xml (+1/-1)
account/account_move_line.py (+3/-0)
account/account_view.xml (+1/-1)
account/company.py (+7/-1)
account/company_view.xml (+1/-0)
account/data/data_account_type.xml (+1/-0)
account/partner_view.xml (+1/-1)
account/report/account_aged_partner_balance.py (+9/-9)
account/report/account_print_invoice.rml (+14/-14)
account_analytic_analysis/account_analytic_analysis.py (+18/-33)
account_analytic_plans/account_analytic_plans_view.xml (+2/-2)
account_anglo_saxon/__openerp__.py (+1/-1)
account_anglo_saxon/account_anglo_saxon_demo.xml (+34/-0)
account_anglo_saxon/purchase.py (+7/-7)
account_asset/account_asset_invoice.py (+1/-0)
account_budget/account_budget.py (+17/-1)
account_payment/account_move_line.py (+2/-2)
account_payment/account_payment_view.xml (+1/-1)
analytic/analytic.py (+9/-12)
audittrail/audittrail.py (+16/-8)
base_action_rule/base_action_rule.py (+4/-1)
base_calendar/base_calendar.py (+27/-1)
base_contact/base_contact.py (+3/-1)
crm/crm_lead_view.xml (+2/-0)
crm/crm_meeting_view.xml (+3/-1)
crm/crm_phonecall_view.xml (+3/-1)
crm_claim/crm_claim_view.xml (+3/-1)
crm_fundraising/crm_fundraising_view.xml (+2/-0)
crm_helpdesk/crm_helpdesk_view.xml (+2/-1)
delivery/__openerp__.py (+1/-0)
delivery/stock.py (+12/-1)
delivery/test/delivery_chained_pickings.yml (+37/-0)
document/document.py (+18/-8)
fetchmail/fetchmail.py (+1/-1)
hr/hr.py (+2/-1)
hr_payroll/hr_payroll.py (+1/-1)
hr_recruitment/hr_recruitment_view.xml (+1/-1)
hr_timesheet/hr_timesheet.py (+1/-2)
hr_timesheet_invoice/hr_timesheet_invoice.py (+6/-3)
hr_timesheet_sheet/hr_timesheet_sheet.py (+1/-1)
l10n_nl/__openerp__.py (+3/-0)
l10n_nl/account_chart_netherlands.xml (+352/-244)
l10n_nl/account_fiscal_position_account_template.xml (+245/-0)
l10n_nl/account_fiscal_position_tax_template.xml (+97/-0)
l10n_nl/account_fiscal_position_template.xml (+33/-0)
mail/mail_message.py (+17/-4)
mail/mail_thread.py (+1/-1)
mrp/mrp.py (+24/-3)
mrp/security/mrp_security.xml (+1/-1)
mrp_repair/mrp_repair.py (+2/-1)
procurement/procurement.py (+1/-1)
product/pricelist.py (+48/-17)
product/product.py (+2/-2)
product/report/product_label.xsl (+1/-1)
project/project_view.xml (+2/-2)
project_issue/project_issue_view.xml (+1/-1)
project_mrp/project_procurement.py (+7/-3)
project_timesheet/project_timesheet.py (+7/-5)
purchase/purchase.py (+23/-16)
purchase/purchase_view.xml (+1/-1)
purchase/wizard/purchase_line_invoice.py (+13/-36)
purchase_requisition/wizard/purchase_requisition_partner_view.xml (+1/-1)
sale/report/sale_order.rml (+26/-26)
sale/report/sale_report_view.xml (+1/-1)
sale/sale.py (+9/-3)
sale/sale_view.xml (+3/-3)
stock/report/report_stock_move.py (+6/-1)
stock/stock.py (+2/-2)
stock/wizard/stock_return_picking.py (+13/-7)
users_ldap/users_ldap.py (+1/-1)
warning/warning.py (+2/-2)
wiki/wiki.py (+1/-0)
wiki/wizard/wiki_create_menu.py (+1/-0)
wiki/wizard/wiki_wiki_page_open.py (+1/-0)
To merge this branch: bzr merge lp:~camptocamp/openobject-addons/ocb-6.1-fix_1311004_account_move_line_index-afe
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp (community) Needs Resubmitting
Guewen Baconnier @ Camptocamp (community) code review Approve
OpenERP Core Team Pending
Review via email: mp+216688@code.launchpad.net

This proposal has been superseded by a proposal from 2014-04-23.

Description of the change

improve reading account_move_lines by using an index on date, id matching _order

port of https://code.launchpad.net/~camptocamp/openobject-addons/6.1-fix_1311004_account_move_line_index-afe/+merge/216687 to OCB (6.1)

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM

review: Approve (code review)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

It seems other revisions were dragged in.

Is it wanted ?

review: Needs Resubmitting

Unmerged revisions

6841. By Alexandre Fayolle - camptocamp

[IMP] add an index on account_move_line(date, id)

6840. By 开阖软件 Jeff Wang

Pricelist base on supplierinfo based price list returns zero

6839. By Yann Papouin

[IMP] Partner linked to newly created task

6838. By Yann Papouin

[MRG] fix Services with 'Make to stock' procure_method stay in 'Running' state

6837. By Yann Papouin

[FIX] Do not duplicate origin when merging purchase orders

6836. By Yann Papouin

Locations of a production order are set from stock properties by default

6835. By Holger Brunn (Therp)

[FIX] lp:1237832, recurse into analytic account's children when calculating practical amount in budgets

6834. By Rifakat Husen (OpenERP)

[FIX] BoM does not validate field active nor dates

6833. By Yann Papouin

[FIX] invalid product ID when using variants

6832. By Ravish(OpenERP)

[FIX] procurement prioritization

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/__init__.py'
--- account/__init__.py 2011-12-30 11:44:10 +0000
+++ account/__init__.py 2014-04-22 12:10:57 +0000
@@ -23,6 +23,7 @@
23import installer23import installer
24import project24import project
25import partner25import partner
26import company
26import account_invoice27import account_invoice
27import account_bank_statement28import account_bank_statement
28import account_bank29import account_bank
@@ -34,7 +35,6 @@
34import report35import report
35import product36import product
36import ir_sequence37import ir_sequence
37import company
38import res_currency38import res_currency
39import edi39import edi
40# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:40# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4141
=== modified file 'account/account.py'
--- account/account.py 2013-01-23 10:11:30 +0000
+++ account/account.py 2014-04-22 12:10:57 +0000
@@ -29,6 +29,7 @@
29from osv import fields, osv29from osv import fields, osv
30import decimal_precision as dp30import decimal_precision as dp
31from tools.translate import _31from tools.translate import _
32from openerp.tools.float_utils import float_round
3233
33def check_cycle(self, cr, uid, ids, context=None):34def check_cycle(self, cr, uid, ids, context=None):
34 """ climbs the ``self._table.parent_id`` chains for 100 levels or35 """ climbs the ``self._table.parent_id`` chains for 100 levels or
@@ -106,7 +107,7 @@
106 'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \107 'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \
107 "If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."),108 "If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."),
108 'days2': fields.integer('Day of the Month', required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."),109 'days2': fields.integer('Day of the Month', required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."),
109 'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True),110 'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True, ondelete='cascade'),
110 }111 }
111 _defaults = {112 _defaults = {
112 'value': 'balance',113 'value': 'balance',
@@ -1396,7 +1397,7 @@
1396 if not l[0]:1397 if not l[0]:
1397 l[2].update({1398 l[2].update({
1398 'reconcile_id':False,1399 'reconcile_id':False,
1399 'reconcil_partial_id':False,1400 'reconcile_partial_id':False,
1400 'analytic_lines':False,1401 'analytic_lines':False,
1401 'invoice':False,1402 'invoice':False,
1402 'ref':False,1403 'ref':False,
@@ -1523,7 +1524,13 @@
1523 cr.execute('update account_move_line set '+mode2+'=%s where id=%s', (result, line_id))1524 cr.execute('update account_move_line set '+mode2+'=%s where id=%s', (result, line_id))
15241525
1525 #adjust also the amount in currency if needed1526 #adjust also the amount in currency if needed
1526 cr.execute("select currency_id, sum(amount_currency) as amount_currency from account_move_line where move_id = %s and currency_id is not null group by currency_id", (move.id,))1527 cr.execute(
1528 '''select currency_id, sum(amount_currency) as amount_currency
1529 from account_move_line
1530 where move_id = %s
1531 and currency_id is not null
1532 and amount_currency is not null
1533 group by currency_id''', (move.id,))
1527 for row in cr.dictfetchall():1534 for row in cr.dictfetchall():
1528 currency_id = currency_obj.browse(cr, uid, row['currency_id'], context=context)1535 currency_id = currency_obj.browse(cr, uid, row['currency_id'], context=context)
1529 if not currency_obj.is_zero(cr, uid, currency_id, row['amount_currency']):1536 if not currency_obj.is_zero(cr, uid, currency_id, row['amount_currency']):
@@ -1855,6 +1862,14 @@
1855 return result in the context1862 return result in the context
1856 Ex: result=round(price_unit*0.21,4)1863 Ex: result=round(price_unit*0.21,4)
1857 """1864 """
1865
1866 def copy_data(self, cr, uid, id, default=None, context=None):
1867 if default is None:
1868 default = {}
1869 name = self.read(cr, uid, id, ['name'], context=context)['name']
1870 default = default.copy()
1871 default.update({'name': name + _(' (Copy)')})
1872 return super(account_tax, self).copy_data(cr, uid, id, default=default, context=context)
18581873
1859 def get_precision_tax():1874 def get_precision_tax():
1860 def change_digit_tax(cr):1875 def change_digit_tax(cr):
@@ -2070,7 +2085,9 @@
2070 cur_price_unit+=amount22085 cur_price_unit+=amount2
2071 return res2086 return res
20722087
2073 def compute_all(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None, force_excluded=False):2088 def compute_all(self, cr, uid, taxes, price_unit, quantity,
2089 address_id=None, product=None, partner=None, force_excluded=False,
2090 context=None):
2074 """2091 """
2075 :param force_excluded: boolean used to say that we don't want to consider the value of field price_include of2092 :param force_excluded: boolean used to say that we don't want to consider the value of field price_include of
2076 tax. It's used in encoding by line where you don't matter if you encoded a tax with that boolean to True or2093 tax. It's used in encoding by line where you don't matter if you encoded a tax with that boolean to True or
@@ -2081,8 +2098,25 @@
2081 'taxes': [] # List of taxes, see compute for the format2098 'taxes': [] # List of taxes, see compute for the format
2082 }2099 }
2083 """2100 """
2101
2102 # By default, for each tax, tax amount will first be computed
2103 # and rounded at the 'Account' decimal precision for each
2104 # PO/SO/invoice line and then these rounded amounts will be
2105 # summed, leading to the total amount for that tax. But, if the
2106 # company has tax_calculation_rounding_method = round_globally,
2107 # we still follow the same method, but we use a much larger
2108 # precision when we round the tax amount for each line (we use
2109 # the 'Account' decimal precision + 5), and that way it's like
2110 # rounding after the sum of the tax amounts of each line
2084 precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')2111 precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
2085 totalin = totalex = round(price_unit * quantity, precision)2112 tax_compute_precision = precision
2113 rounding_method = (
2114 (context and context.get('tax_calculation_rounding_method'))
2115 or (taxes and taxes[0].company_id.tax_calculation_rounding_method)
2116 or 'round_per_line')
2117 if rounding_method == 'round_globally':
2118 tax_compute_precision += 5
2119 totalin = totalex = float_round(price_unit * quantity, precision)
2086 tin = []2120 tin = []
2087 tex = []2121 tex = []
2088 for tax in taxes:2122 for tax in taxes:
@@ -2090,7 +2124,7 @@
2090 tex.append(tax)2124 tex.append(tax)
2091 else:2125 else:
2092 tin.append(tax)2126 tin.append(tax)
2093 tin = self.compute_inv(cr, uid, tin, price_unit, quantity, address_id=address_id, product=product, partner=partner)2127 tin = self.compute_inv(cr, uid, tin, price_unit, quantity, address_id=address_id, product=product, partner=partner, precision=tax_compute_precision)
2094 for r in tin:2128 for r in tin:
2095 totalex -= r.get('amount', 0.0)2129 totalex -= r.get('amount', 0.0)
2096 totlex_qty = 0.02130 totlex_qty = 0.0
@@ -2098,7 +2132,7 @@
2098 totlex_qty = totalex/quantity2132 totlex_qty = totalex/quantity
2099 except:2133 except:
2100 pass2134 pass
2101 tex = self._compute(cr, uid, tex, totlex_qty, quantity, address_id=address_id, product=product, partner=partner)2135 tex = self._compute(cr, uid, tex, totlex_qty, quantity, address_id=address_id, product=product, partner=partner, precision=tax_compute_precision)
2102 for r in tex:2136 for r in tex:
2103 totalin += r.get('amount', 0.0)2137 totalin += r.get('amount', 0.0)
2104 return {2138 return {
@@ -2113,7 +2147,7 @@
2113 "Deprecated, use compute_all(...)['taxes'] instead of compute(...) to manage prices with tax included")2147 "Deprecated, use compute_all(...)['taxes'] instead of compute(...) to manage prices with tax included")
2114 return self._compute(cr, uid, taxes, price_unit, quantity, address_id, product, partner)2148 return self._compute(cr, uid, taxes, price_unit, quantity, address_id, product, partner)
21152149
2116 def _compute(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None):2150 def _compute(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None, precision=None):
2117 """2151 """
2118 Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID.2152 Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID.
21192153
@@ -2122,14 +2156,15 @@
2122 tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2}2156 tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2}
2123 one tax for each tax id in IDS and their children2157 one tax for each tax id in IDS and their children
2124 """2158 """
2159 if not precision:
2160 precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
2125 res = self._unit_compute(cr, uid, taxes, price_unit, address_id, product, partner, quantity)2161 res = self._unit_compute(cr, uid, taxes, price_unit, address_id, product, partner, quantity)
2126 total = 0.02162 total = 0.0
2127 precision_pool = self.pool.get('decimal.precision')
2128 for r in res:2163 for r in res:
2129 if r.get('balance',False):2164 if r.get('balance',False):
2130 r['amount'] = round(r.get('balance', 0.0) * quantity, precision_pool.precision_get(cr, uid, 'Account')) - total2165 r['amount'] = round(r.get('balance', 0.0) * quantity, precision) - total
2131 else:2166 else:
2132 r['amount'] = round(r.get('amount', 0.0) * quantity, precision_pool.precision_get(cr, uid, 'Account'))2167 r['amount'] = round(r.get('amount', 0.0) * quantity, precision)
2133 total += r['amount']2168 total += r['amount']
2134 return res2169 return res
21352170
@@ -2207,7 +2242,7 @@
2207 r['todo'] = 02242 r['todo'] = 0
2208 return res2243 return res
22092244
2210 def compute_inv(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None):2245 def compute_inv(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None, precision=None):
2211 """2246 """
2212 Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID.2247 Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID.
2213 Price Unit is a VAT included price2248 Price Unit is a VAT included price
@@ -2217,15 +2252,15 @@
2217 tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2}2252 tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2}
2218 one tax for each tax id in IDS and their children2253 one tax for each tax id in IDS and their children
2219 """2254 """
2255 if not precision:
2256 precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
2220 res = self._unit_compute_inv(cr, uid, taxes, price_unit, address_id, product, partner=None)2257 res = self._unit_compute_inv(cr, uid, taxes, price_unit, address_id, product, partner=None)
2221 total = 0.02258 total = 0.0
2222 obj_precision = self.pool.get('decimal.precision')
2223 for r in res:2259 for r in res:
2224 prec = obj_precision.precision_get(cr, uid, 'Account')
2225 if r.get('balance',False):2260 if r.get('balance',False):
2226 r['amount'] = round(r['balance'] * quantity, prec) - total2261 r['amount'] = round(r['balance'] * quantity, precision) - total
2227 else:2262 else:
2228 r['amount'] = round(r['amount'] * quantity, prec)2263 r['amount'] = round(r['amount'] * quantity, precision)
2229 total += r['amount']2264 total += r['amount']
2230 return res2265 return res
22312266
@@ -2323,6 +2358,14 @@
23232358
2324 return move_ids2359 return move_ids
23252360
2361 def onchange_journal_id(self, cr, uid, ids, journal_id, context=None):
2362 company_id = False
2363 if journal_id:
2364 journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context)
2365 if journal.company_id.id:
2366 company_id = journal.company_id.id
2367 return {'value': {'company_id': company_id}}
2368
2326account_model()2369account_model()
23272370
2328class account_model_line(osv.osv):2371class account_model_line(osv.osv):
23292372
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py 2013-01-31 10:22:57 +0000
+++ account/account_invoice.py 2014-04-22 12:10:57 +0000
@@ -91,19 +91,44 @@
91 return [('none', _('Free Reference'))]91 return [('none', _('Free Reference'))]
9292
93 def _amount_residual(self, cr, uid, ids, name, args, context=None):93 def _amount_residual(self, cr, uid, ids, name, args, context=None):
94 if context is None:
95 context = {}
96 ctx = context.copy()
94 result = {}97 result = {}
98 currency_obj = self.pool.get('res.currency')
95 for invoice in self.browse(cr, uid, ids, context=context):99 for invoice in self.browse(cr, uid, ids, context=context):
96 checked_partial_rec_ids = []100 nb_inv_in_partial_rec = max_invoice_id = 0
97 result[invoice.id] = 0.0101 result[invoice.id] = 0.0
98 if invoice.move_id:102 if invoice.move_id:
99 for move_line in invoice.move_id.line_id:103 for aml in invoice.move_id.line_id:
100 if move_line.account_id.type in ('receivable','payable'):104 if aml.account_id.type in ('receivable','payable'):
101 if move_line.reconcile_partial_id:105 if aml.currency_id and aml.currency_id.id == invoice.currency_id.id:
102 partial_reconcile_id = move_line.reconcile_partial_id.id106 result[invoice.id] += aml.amount_residual_currency
103 if partial_reconcile_id in checked_partial_rec_ids:107 else:
104 continue108 ctx['date'] = aml.date
105 checked_partial_rec_ids.append(partial_reconcile_id)109 result[invoice.id] += currency_obj.compute(cr, uid, aml.company_id.currency_id.id, invoice.currency_id.id, aml.amount_residual, context=ctx)
106 result[invoice.id] += move_line.amount_residual_currency110
111 if aml.reconcile_partial_id.line_partial_ids:
112 #we check if the invoice is partially reconciled and if there are other invoices
113 #involved in this partial reconciliation (and we sum these invoices)
114 for line in aml.reconcile_partial_id.line_partial_ids:
115 if line.invoice:
116 nb_inv_in_partial_rec += 1
117 #store the max invoice id as for this invoice we will make a balance instead of a simple division
118 max_invoice_id = max(max_invoice_id, line.invoice.id)
119 if nb_inv_in_partial_rec:
120 #if there are several invoices in a partial reconciliation, we split the residual by the number
121 #of invoice to have a sum of residual amounts that matches the partner balance
122 new_value = currency_obj.round(cr, uid, invoice.currency_id, result[invoice.id] / nb_inv_in_partial_rec)
123 if invoice.id == max_invoice_id:
124 #if it's the last the invoice of the bunch of invoices partially reconciled together, we make a
125 #balance to avoid rounding errors
126 result[invoice.id] = result[invoice.id] - ((nb_inv_in_partial_rec - 1) * new_value)
127 else:
128 result[invoice.id] = new_value
129
130 #prevent the residual amount on the invoice to be less than 0
131 result[invoice.id] = max(result[invoice.id], 0.0)
107 return result132 return result
108133
109 # Give Journal Items related to the payment reconciled to this invoice134 # Give Journal Items related to the payment reconciled to this invoice
@@ -284,8 +309,40 @@
284 'payment_ids': fields.function(_compute_lines, relation='account.move.line', type="many2many", string='Payments'),309 'payment_ids': fields.function(_compute_lines, relation='account.move.line', type="many2many", string='Payments'),
285 'move_name': fields.char('Journal Entry', size=64, readonly=True, states={'draft':[('readonly',False)]}),310 'move_name': fields.char('Journal Entry', size=64, readonly=True, states={'draft':[('readonly',False)]}),
286 'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}),311 'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}),
287 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True, states={'draft':[('readonly',False)]})312 'fiscal_position': fields.many2one('account.fiscal.position',
313 'Fiscal Position', readonly=True,
314 states={'draft':[('readonly',False)]}),
315 'tax_calculation_rounding_method': fields.selection([
316 ('round_per_line', 'Round per line'),
317 ('round_globally', 'Round globally'),
318 ], 'Tax calculation rounding method',
319 help='''If you select 'Round per line' : for each tax, the tax
320amount will first be computed and rounded for each PO/SO/invoice line and then
321these rounded amounts will be summed, leading to the total amount for that tax.
322If you select 'Round globally': for each tax, the tax amount will be computed
323for each PO/SO/invoice line, then these amounts will be summed and eventually
324this total tax amount will be rounded. If you sell with tax included, you
325should choose 'Round per line' because you certainly want the sum of your
326tax-included line subtotals to be equal to the total amount with taxes.'''),
288 }327 }
328
329 def _get_company_rounding(self, cr, uid, company_id, context=None):
330 res = 'round_per_line'
331 if company_id:
332 company_model = self.pool.get('res.company')
333 company_obj = company_model.browse(
334 cr, uid, company_id, context=context)
335 if company_obj and company_obj['tax_calculation_rounding_method']:
336 res = company_obj['tax_calculation_rounding_method']
337 return res
338
339 def _get_default_rounding_method(self, cr, uid, context=None):
340 # default rounding depends on company. We start with default company
341 company_model = self.pool.get('res.company')
342 company_id = company_model._company_default_get(
343 cr, uid, 'account.invoice', context=context)
344 return self._get_company_rounding(cr, uid, company_id, context)
345
289 _defaults = {346 _defaults = {
290 'type': _get_type,347 'type': _get_type,
291 'state': 'draft',348 'state': 'draft',
@@ -296,6 +353,7 @@
296 'check_total': 0.0,353 'check_total': 0.0,
297 'internal_number': False,354 'internal_number': False,
298 'user_id': lambda s, cr, u, c: u,355 'user_id': lambda s, cr, u, c: u,
356 'tax_calculation_rounding_method': _get_default_rounding_method,
299 }357 }
300 _sql_constraints = [358 _sql_constraints = [
301 ('number_uniq', 'unique(number, company_id, journal_id, type)', 'Invoice Number must be unique per Company!'),359 ('number_uniq', 'unique(number, company_id, journal_id, type)', 'Invoice Number must be unique per Company!'),
@@ -516,6 +574,9 @@
516 obj_journal = self.pool.get('account.journal')574 obj_journal = self.pool.get('account.journal')
517 account_obj = self.pool.get('account.account')575 account_obj = self.pool.get('account.account')
518 inv_line_obj = self.pool.get('account.invoice.line')576 inv_line_obj = self.pool.get('account.invoice.line')
577 if company_id:
578 val['tax_calculation_rounding_method'] = (
579 self._get_company_rounding(cr, uid, company_id))
519 if company_id and part_id and type:580 if company_id and part_id and type:
520 acc_id = False581 acc_id = False
521 partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id)582 partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id)
@@ -1026,6 +1087,23 @@
1026 self.log(cr, uid, inv_id, message, context=ctx)1087 self.log(cr, uid, inv_id, message, context=ctx)
1027 return True1088 return True
10281089
1090 def action_proforma(self, cr, uid, ids, context=None):
1091 """
1092 Check if all taxes are present with the correct base amount
1093 on creating a proforma invoice. This leaves room for manual
1094 corrections of the tax amount.
1095 """
1096 if not ids:
1097 return True
1098 if isinstance(ids, (int, long)):
1099 ids = [ids]
1100 ait_obj = self.pool.get('account.invoice.tax')
1101 for inv in self.browse(cr, uid, ids, context=context):
1102 compute_taxes = ait_obj.compute(cr, uid, inv.id, context=context)
1103 self.check_tax_lines(cr, uid, inv, compute_taxes, ait_obj)
1104 return self.write(
1105 cr, uid, ids, {'state': 'proforma2'}, context=context)
1106
1029 def action_cancel(self, cr, uid, ids, *args):1107 def action_cancel(self, cr, uid, ids, *args):
1030 context = {} # TODO: Use context from arguments1108 context = {} # TODO: Use context from arguments
1031 account_move_obj = self.pool.get('account.move')1109 account_move_obj = self.pool.get('account.move')
@@ -1268,9 +1346,17 @@
1268 res = {}1346 res = {}
1269 tax_obj = self.pool.get('account.tax')1347 tax_obj = self.pool.get('account.tax')
1270 cur_obj = self.pool.get('res.currency')1348 cur_obj = self.pool.get('res.currency')
1349 local_context = {}
1271 for line in self.browse(cr, uid, ids):1350 for line in self.browse(cr, uid, ids):
1272 price = line.price_unit * (1-(line.discount or 0.0)/100.0)1351 price = line.price_unit * (1-(line.discount or 0.0)/100.0)
1273 taxes = tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, price, line.quantity, product=line.product_id, address_id=line.invoice_id.address_invoice_id, partner=line.invoice_id.partner_id)1352 local_context['tax_calculation_rounding_method'] = (
1353 line.invoice_id.tax_calculation_rounding_method)
1354 taxes = tax_obj.compute_all(
1355 cr, uid, line.invoice_line_tax_id, price, line.quantity,
1356 product=line.product_id,
1357 address_id=line.invoice_id.address_invoice_id,
1358 partner=line.invoice_id.partner_id,
1359 context=local_context)
1274 res[line.id] = taxes['total']1360 res[line.id] = taxes['total']
1275 if line.invoice_id:1361 if line.invoice_id:
1276 cur = line.invoice_id.currency_id1362 cur = line.invoice_id.currency_id
@@ -1380,11 +1466,19 @@
1380 else:1466 else:
1381 taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)1467 taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
1382 tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)1468 tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
13831469 result['invoice_line_tax_id'] = tax_id
1384 if type in ('in_invoice', 'in_refund'):1470
1385 result.update( {'price_unit': price_unit or res.standard_price,'invoice_line_tax_id': tax_id} )1471 warning = {}
1386 else:1472 # When product changes, price ALWAYS need to be reset. If not price
1387 result.update({'price_unit': res.list_price, 'invoice_line_tax_id': tax_id})1473 # found in product, or pricelist, it should become False. Only if
1474 # product_id has been cleared by user, we will leave price_unit as is.
1475 if product:
1476 price_unit, pu_warning = self._price_unit_get(
1477 cr, uid, product, uom, qty, type, partner_id,
1478 currency_id, context=context)
1479 result['price_unit'] = price_unit # might be False
1480 warning.update(pu_warning)
1481
1388 result['name'] = res.partner_ref1482 result['name'] = res.partner_ref
13891483
1390 domain = {}1484 domain = {}
@@ -1395,27 +1489,88 @@
1395 if res2:1489 if res2:
1396 domain = {'uos_id':[('category_id','=',res2 )]}1490 domain = {'uos_id':[('category_id','=',res2 )]}
13971491
1398 res_final = {'value':result, 'domain':domain}1492 res_final = {'value': result, 'domain': domain, 'warning': warning}
1399
1400 if not company_id or not currency_id:
1401 return res_final
1402
1403 company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
1404 currency = self.pool.get('res.currency').browse(cr, uid, currency_id, context=context)
1405
1406 if company.currency_id.id != currency.id:
1407 if type in ('in_invoice', 'in_refund'):
1408 res_final['value']['price_unit'] = res.standard_price
1409 new_price = res_final['value']['price_unit'] * currency.rate
1410 res_final['value']['price_unit'] = new_price
1411
1412 if uom:
1413 uom = self.pool.get('product.uom').browse(cr, uid, uom, context=context)
1414 if res.uom_id.category_id.id == uom.category_id.id:
1415 new_price = res_final['value']['price_unit'] * uom.factor_inv
1416 res_final['value']['price_unit'] = new_price
1417 return res_final1493 return res_final
14181494
1495 def _price_unit_get(
1496 self, cr, uid, product_id, uom_id, qty, invoice_type, partner_id,
1497 currency_id, context=None):
1498 price_unit = False
1499 warning = {}
1500 standard_currency_id = currency_id
1501 partner_model = self.pool.get('res.partner')
1502 partner_obj = partner_model.browse(
1503 cr, uid, partner_id, context=context)
1504 assert partner_obj, _('No partner found for id %d') % partner_id
1505 if invoice_type in ('in_invoice', 'in_refund'):
1506 field = 'list_price'
1507 pricelist_property = 'property_product_pricelist_purchase'
1508 else:
1509 field = 'standard_price'
1510 pricelist_property = 'property_product_pricelist'
1511 if pricelist_property in partner_obj:
1512 pricelist_id = partner_obj[pricelist_property].id
1513 else:
1514 pricelist_id = False
1515 # Check whether standard price p.u. modified by pricelist
1516 if pricelist_id:
1517 pricelist_model = self.pool.get('product.pricelist')
1518 price_unit = pricelist_model.price_get(
1519 cr, uid, [pricelist_id], product_id, qty or 1.0, partner_id,
1520 {'uom': uom_id})[pricelist_id]
1521 if price_unit is False: # 0.0 is OK, we night have free products
1522 warning = {
1523 'title': _('No valid pricelist line found!'),
1524 'message':
1525 _("Couldn't find a pricelist line matching this product"
1526 " and quantity.\n"
1527 "You have to change either the product, the quantity or"
1528 " the pricelist.")
1529 }
1530 # Pricelist converts price from standard currency to pricelist
1531 # currency. We have to convert this to the invoice currency.
1532 # In practice that will often mean undoing the conversion
1533 # done by the pricelist object
1534 pricelist_obj = pricelist_model.browse(cr, uid, pricelist_id)
1535 if (pricelist_obj and pricelist_obj.currency_id and
1536 pricelist_obj.currency_id.id):
1537 standard_currency_id = pricelist_obj.currency_id.id
1538 else:
1539 # Take standard price per unit directly from product
1540 product_model = self.pool.get('product.product')
1541 product_obj = product_model.browse(
1542 cr, uid, product_id, context=context)
1543 assert product_obj, _('No product found for id %d') % product_id
1544 assert field in product_obj, _(
1545 'Field %s not found in product') % field
1546 price_unit = product_obj[field]
1547 # If price_unit not taken from price-list, we still have to
1548 # take unit of measurement into account
1549 if uom_id:
1550 uom_model = self.pool.get('product.uom')
1551 uom_obj = uom_model.browse(cr, uid, uom_id)
1552 p_uom_category_id = product_obj.uom_id.category_id.id
1553 if p_uom_category_id == uom_obj.category_id.id:
1554 price_unit = price_unit * uom_obj.factor_inv
1555 # When price not taken from pricelist, the currency is
1556 # determined by the price_type:
1557 price_type_model = self.pool.get('product.price.type')
1558 price_type_ids = price_type_model.search(
1559 cr, uid, [('field', '=', field)])
1560 if price_type_ids:
1561 price_type_obj = price_type_model.browse(
1562 cr, uid, price_type_ids[0])
1563 if (price_type_obj and price_type_obj.currency_id and
1564 price_type_obj.currency_id.id):
1565 standard_currency_id = price_type_obj.currency_id.id
1566 # convert price_unit to currency of invoice
1567 if standard_currency_id != currency_id:
1568 currency_model = self.pool.get('res.currency')
1569 price_unit = currency_model.compute(
1570 cr, uid, standard_currency_id, currency_id,
1571 price_unit, round=True, context=context)
1572 return price_unit, warning
1573
1419 def uos_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None, company_id=None):1574 def uos_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None, company_id=None):
1420 if context is None:1575 if context is None:
1421 context = {}1576 context = {}
@@ -1448,6 +1603,10 @@
1448 inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context)1603 inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context)
1449 company_currency = inv.company_id.currency_id.id1604 company_currency = inv.company_id.currency_id.id
14501605
1606 local_context = {
1607 'tax_calculation_rounding_method':
1608 inv.tax_calculation_rounding_method
1609 }
1451 for line in inv.invoice_line:1610 for line in inv.invoice_line:
1452 mres = self.move_line_get_item(cr, uid, line, context)1611 mres = self.move_line_get_item(cr, uid, line, context)
1453 if not mres:1612 if not mres:
@@ -1457,7 +1616,7 @@
1457 for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id,1616 for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id,
1458 (line.price_unit * (1.0 - (line['discount'] or 0.0) / 100.0)),1617 (line.price_unit * (1.0 - (line['discount'] or 0.0) / 100.0)),
1459 line.quantity, inv.address_invoice_id.id, line.product_id,1618 line.quantity, inv.address_invoice_id.id, line.product_id,
1460 inv.partner_id)['taxes']:1619 inv.partner_id, context=local_context)['taxes']:
14611620
1462 if inv.type in ('out_invoice', 'in_invoice'):1621 if inv.type in ('out_invoice', 'in_invoice'):
1463 tax_code_id = tax['base_code_id']1622 tax_code_id = tax['base_code_id']
@@ -1596,16 +1755,23 @@
1596 cur = inv.currency_id1755 cur = inv.currency_id
1597 company_currency = inv.company_id.currency_id.id1756 company_currency = inv.company_id.currency_id.id
15981757
1758 local_context = {
1759 'tax_calculation_rounding_method':
1760 inv.tax_calculation_rounding_method
1761 }
1599 for line in inv.invoice_line:1762 for line in inv.invoice_line:
1600 for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, (line.price_unit* (1-(line.discount or 0.0)/100.0)), line.quantity, inv.address_invoice_id.id, line.product_id, inv.partner_id)['taxes']:1763 for tax in tax_obj.compute_all(
1601 tax['price_unit'] = cur_obj.round(cr, uid, cur, tax['price_unit'])1764 cr, uid, line.invoice_line_tax_id,
1765 (line.price_unit * (1 - (line.discount or 0.0) / 100.0)),
1766 line.quantity, inv.address_invoice_id.id, line.product_id,
1767 inv.partner_id, context=local_context)['taxes']:
1602 val={}1768 val={}
1603 val['invoice_id'] = inv.id1769 val['invoice_id'] = inv.id
1604 val['name'] = tax['name']1770 val['name'] = tax['name']
1605 val['amount'] = tax['amount']1771 val['amount'] = tax['amount']
1606 val['manual'] = False1772 val['manual'] = False
1607 val['sequence'] = tax['sequence']1773 val['sequence'] = tax['sequence']
1608 val['base'] = tax['price_unit'] * line['quantity']1774 val['base'] = cur_obj.round(cr, uid, cur, tax['price_unit'] * line['quantity'])
16091775
1610 if inv.type in ('out_invoice','in_invoice'):1776 if inv.type in ('out_invoice','in_invoice'):
1611 val['base_code_id'] = tax['base_code_id']1777 val['base_code_id'] = tax['base_code_id']
16121778
=== modified file 'account/account_invoice_view.xml'
--- account/account_invoice_view.xml 2012-02-16 18:50:48 +0000
+++ account/account_invoice_view.xml 2014-04-22 12:10:57 +0000
@@ -168,6 +168,7 @@
168 <field name="reference_type" nolabel="1" size="0"/>168 <field name="reference_type" nolabel="1" size="0"/>
169 <field name="reference" nolabel="1"/>169 <field name="reference" nolabel="1"/>
170 <field name="date_due"/>170 <field name="date_due"/>
171 <field name="tax_calculation_rounding_method"/>
171 <field colspan="4" context="{'address_invoice_id': address_invoice_id, 'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False, 'type': type}" name="invoice_line" nolabel="1">172 <field colspan="4" context="{'address_invoice_id': address_invoice_id, 'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False, 'type': type}" name="invoice_line" nolabel="1">
172 <tree string="Invoice lines">173 <tree string="Invoice lines">
173 <field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, context, parent.company_id)"/>174 <field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, context, parent.company_id)"/>
@@ -259,6 +260,9 @@
259 <field name="journal_id" groups="base.group_user" on_change="onchange_journal_id(journal_id, context)" widget="selection"/>260 <field name="journal_id" groups="base.group_user" on_change="onchange_journal_id(journal_id, context)" widget="selection"/>
260 <field name="number"/>261 <field name="number"/>
261 <field name="type" invisible="1"/>262 <field name="type" invisible="1"/>
263 <field
264 name="tax_calculation_rounding_method"
265 invisible="1" />
262 <field name="currency_id" width="50"/>266 <field name="currency_id" width="50"/>
263 <button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" groups="account.group_account_user"/>267 <button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" groups="account.group_account_user"/>
264 <newline/>268 <newline/>
@@ -292,7 +296,7 @@
292 </group>296 </group>
293 <group col="4" colspan="2">297 <group col="4" colspan="2">
294 <group colspan="2" col="1">298 <group colspan="2" col="1">
295 <button name="button_reset_taxes" states="draft,proforma2" string="Compute Taxes" type="object" groups="base.group_user" icon="terp-stock_format-scientific" help="This action will erase taxes"/>299 <button name="button_reset_taxes" states="draft" string="Compute Taxes" type="object" groups="base.group_user" icon="terp-stock_format-scientific" help="This action will erase taxes"/>
296 </group>300 </group>
297 <field name="amount_untaxed"/>301 <field name="amount_untaxed"/>
298 <label string="" colspan="2"/>302 <label string="" colspan="2"/>
299303
=== modified file 'account/account_invoice_workflow.xml'
--- account/account_invoice_workflow.xml 2011-01-14 00:11:01 +0000
+++ account/account_invoice_workflow.xml 2014-04-22 12:10:57 +0000
@@ -17,7 +17,7 @@
17 <record id="act_proforma2" model="workflow.activity">17 <record id="act_proforma2" model="workflow.activity">
18 <field name="wkf_id" ref="wkf"/>18 <field name="wkf_id" ref="wkf"/>
19 <field name="name">proforma2</field>19 <field name="name">proforma2</field>
20 <field name="action">write({'state':'proforma2'})</field>20 <field name="action">action_proforma()</field>
21 <field name="kind">function</field>21 <field name="kind">function</field>
22 </record>22 </record>
2323
2424
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py 2014-01-10 15:40:23 +0000
+++ account/account_move_line.py 2014-04-22 12:10:57 +0000
@@ -567,6 +567,9 @@
567 cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'')567 cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'')
568 if not cr.fetchone():568 if not cr.fetchone():
569 cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)')569 cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)')
570 cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('account_move_line_date_id_index',))
571 if not cr.fetchone():
572 cr.execute('CREATE INDEX account_move_line_date_id_index ON account_move_line (date DESC, id desc)')
570573
571 def _check_no_view(self, cr, uid, ids, context=None):574 def _check_no_view(self, cr, uid, ids, context=None):
572 lines = self.browse(cr, uid, ids, context=context)575 lines = self.browse(cr, uid, ids, context=context)
573576
=== modified file 'account/account_view.xml'
--- account/account_view.xml 2013-03-13 09:17:04 +0000
+++ account/account_view.xml 2014-04-22 12:10:57 +0000
@@ -1703,7 +1703,7 @@
1703 <filter string="Purchase" icon="terp-purchase" domain="[('journal_id.type', '=', 'purchase')]"/>1703 <filter string="Purchase" icon="terp-purchase" domain="[('journal_id.type', '=', 'purchase')]"/>
1704 <separator orientation="vertical"/>1704 <separator orientation="vertical"/>
1705 <field name="name"/>1705 <field name="name"/>
1706 <field name="journal_id" widget="selection"/>1706 <field name="journal_id" on_change="onchange_journal_id(journal_id)"/>
1707 <field name="company_id" widget="selection" groups="base.group_multi_company"/>1707 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
1708 </group>1708 </group>
1709 <newline/>1709 <newline/>
17101710
=== modified file 'account/company.py'
--- account/company.py 2011-11-16 13:43:36 +0000
+++ account/company.py 2014-04-22 12:10:57 +0000
@@ -24,6 +24,11 @@
24class res_company(osv.osv):24class res_company(osv.osv):
25 _inherit = "res.company"25 _inherit = "res.company"
26 _columns = {26 _columns = {
27 'tax_calculation_rounding_method': fields.selection([
28 ('round_per_line', 'Round per line'),
29 ('round_globally', 'Round globally'),
30 ], 'Tax calculation rounding method',
31 help="If you select 'Round per line' : for each tax, the tax amount will first be computed and rounded for each PO/SO/invoice line and then these rounded amounts will be summed, leading to the total amount for that tax. If you select 'Round globally': for each tax, the tax amount will be computed for each PO/SO/invoice line, then these amounts will be summed and eventually this total tax amount will be rounded. If you sell with tax included, you should choose 'Round per line' because you certainly want the sum of your tax-included line subtotals to be equal to the total amount with taxes."),
27 'paypal_account': fields.char("Paypal Account", size=128, help="Paypal username (usually email) for receiving online payments."),32 'paypal_account': fields.char("Paypal Account", size=128, help="Paypal username (usually email) for receiving online payments."),
28 'overdue_msg': fields.text('Overdue Payments Message', translate=True),33 'overdue_msg': fields.text('Overdue Payments Message', translate=True),
29 'property_reserve_and_surplus_account': fields.property(34 'property_reserve_and_surplus_account': fields.property(
@@ -41,7 +46,8 @@
41has already been paid, please disregard this notice. However, if you have any46has already been paid, please disregard this notice. However, if you have any
42queries regarding your account, please contact us.47queries regarding your account, please contact us.
43Thank you in advance.48Thank you in advance.
44'''49''',
50 'tax_calculation_rounding_method': 'round_per_line',
45 }51 }
4652
47res_company()53res_company()
4854
=== modified file 'account/company_view.xml'
--- account/company_view.xml 2011-09-29 11:08:56 +0000
+++ account/company_view.xml 2014-04-22 12:10:57 +0000
@@ -25,6 +25,7 @@
25 <field name="currency_id" position="after">25 <field name="currency_id" position="after">
26 <field name="property_reserve_and_surplus_account" colspan="2"/>26 <field name="property_reserve_and_surplus_account" colspan="2"/>
27 <field name="paypal_account" />27 <field name="paypal_account" />
28 <field name="tax_calculation_rounding_method" />
28 </field>29 </field>
29 </field>30 </field>
30 </record>31 </record>
3132
=== modified file 'account/data/data_account_type.xml'
--- account/data/data_account_type.xml 2012-01-31 13:36:57 +0000
+++ account/data/data_account_type.xml 2014-04-22 12:10:57 +0000
@@ -22,6 +22,7 @@
22 <field name="name">Bank</field>22 <field name="name">Bank</field>
23 <field name="code">bank</field>23 <field name="code">bank</field>
24 <field name="close_method">balance</field>24 <field name="close_method">balance</field>
25 <field name="report_type">asset</field>
25 </record>26 </record>
26 <record model="account.account.type" id="data_account_type_cash">27 <record model="account.account.type" id="data_account_type_cash">
27 <field name="name">Cash</field>28 <field name="name">Cash</field>
2829
=== modified file 'account/partner_view.xml'
--- account/partner_view.xml 2011-09-21 07:13:12 +0000
+++ account/partner_view.xml 2014-04-22 12:10:57 +0000
@@ -96,7 +96,7 @@
96 <separator string="Supplier Debit" colspan="2"/>96 <separator string="Supplier Debit" colspan="2"/>
97 <field name="debit"/>97 <field name="debit"/>
98 </group>98 </group>
99 <field colspan="4" context="{'address': address}" name="bank_ids" nolabel="1">99 <field colspan="4" context="{'address': address, 'default_partner_id': active_id}" name="bank_ids" nolabel="1">
100 <form string="Bank account">100 <form string="Bank account">
101 <field name="state"/>101 <field name="state"/>
102 <newline/>102 <newline/>
103103
=== modified file 'account/report/account_aged_partner_balance.py'
--- account/report/account_aged_partner_balance.py 2012-09-24 12:41:57 +0000
+++ account/report/account_aged_partner_balance.py 2014-04-22 12:10:57 +0000
@@ -75,7 +75,7 @@
75 AND (account_account.type IN %s)\75 AND (account_account.type IN %s)\
76 AND account_account.active\76 AND account_account.active\
77 AND ((reconcile_id IS NULL)\77 AND ((reconcile_id IS NULL)\
78 OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\78 OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\
79 AND (l.partner_id=res_partner.id)\79 AND (l.partner_id=res_partner.id)\
80 AND (l.date <= %s)\80 AND (l.date <= %s)\
81 AND ' + self.query + ' \81 AND ' + self.query + ' \
@@ -99,7 +99,7 @@
99 AND (account_account.type IN %s)\99 AND (account_account.type IN %s)\
100 AND (l.partner_id IN %s)\100 AND (l.partner_id IN %s)\
101 AND ((l.reconcile_id IS NULL)\101 AND ((l.reconcile_id IS NULL)\
102 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\102 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\
103 AND ' + self.query + '\103 AND ' + self.query + '\
104 AND account_account.active\104 AND account_account.active\
105 AND (l.date <= %s)\105 AND (l.date <= %s)\
@@ -119,7 +119,7 @@
119 AND (COALESCE(l.date_maturity, l.date) < %s)\119 AND (COALESCE(l.date_maturity, l.date) < %s)\
120 AND (l.partner_id IN %s)\120 AND (l.partner_id IN %s)\
121 AND ((l.reconcile_id IS NULL)\121 AND ((l.reconcile_id IS NULL)\
122 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\122 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\
123 AND '+ self.query + '\123 AND '+ self.query + '\
124 AND account_account.active\124 AND account_account.active\
125 AND (l.date <= %s)\125 AND (l.date <= %s)\
@@ -136,7 +136,7 @@
136 AND (COALESCE(l.date_maturity,l.date) > %s)\136 AND (COALESCE(l.date_maturity,l.date) > %s)\
137 AND (l.partner_id IN %s)\137 AND (l.partner_id IN %s)\
138 AND ((l.reconcile_id IS NULL)\138 AND ((l.reconcile_id IS NULL)\
139 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\139 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\
140 AND '+ self.query + '\140 AND '+ self.query + '\
141 AND account_account.active\141 AND account_account.active\
142 AND (l.date <= %s)\142 AND (l.date <= %s)\
@@ -168,7 +168,7 @@
168 AND (account_account.type IN %s)168 AND (account_account.type IN %s)
169 AND (l.partner_id IN %s)169 AND (l.partner_id IN %s)
170 AND ((l.reconcile_id IS NULL)170 AND ((l.reconcile_id IS NULL)
171 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))171 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))
172 AND ''' + self.query + '''172 AND ''' + self.query + '''
173 AND account_account.active173 AND account_account.active
174 AND ''' + dates_query + '''174 AND ''' + dates_query + '''
@@ -242,7 +242,7 @@
242 AND (l.partner_id IS NULL)\242 AND (l.partner_id IS NULL)\
243 AND (account_account.type IN %s)\243 AND (account_account.type IN %s)\
244 AND ((l.reconcile_id IS NULL) \244 AND ((l.reconcile_id IS NULL) \
245 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\245 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\
246 AND ' + self.query + '\246 AND ' + self.query + '\
247 AND (l.date <= %s)\247 AND (l.date <= %s)\
248 AND account_account.active ',(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,))248 AND account_account.active ',(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,))
@@ -259,7 +259,7 @@
259 AND (account_account.type IN %s)\259 AND (account_account.type IN %s)\
260 AND (COALESCE(l.date_maturity, l.date) < %s)\260 AND (COALESCE(l.date_maturity, l.date) < %s)\
261 AND ((l.reconcile_id IS NULL)\261 AND ((l.reconcile_id IS NULL)\
262 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\262 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\
263 AND '+ self.query + '\263 AND '+ self.query + '\
264 AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from))264 AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from))
265 t = self.cr.fetchall()265 t = self.cr.fetchall()
@@ -274,7 +274,7 @@
274 AND (account_account.type IN %s)\274 AND (account_account.type IN %s)\
275 AND (COALESCE(l.date_maturity,l.date) > %s)\275 AND (COALESCE(l.date_maturity,l.date) > %s)\
276 AND ((l.reconcile_id IS NULL)\276 AND ((l.reconcile_id IS NULL)\
277 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\277 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\
278 AND '+ self.query + '\278 AND '+ self.query + '\
279 AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from))279 AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from))
280 t = self.cr.fetchall()280 t = self.cr.fetchall()
@@ -302,7 +302,7 @@
302 AND (account_account.type IN %s)\302 AND (account_account.type IN %s)\
303 AND (l.partner_id IS NULL)\303 AND (l.partner_id IS NULL)\
304 AND ((l.reconcile_id IS NULL)\304 AND ((l.reconcile_id IS NULL)\
305 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\305 OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\
306 AND '+ self.query + '\306 AND '+ self.query + '\
307 AND account_account.active\307 AND account_account.active\
308 AND ' + dates_query + '\308 AND ' + dates_query + '\
309309
=== modified file 'account/report/account_print_invoice.rml'
--- account/report/account_print_invoice.rml 2011-12-22 15:17:58 +0000
+++ account/report/account_print_invoice.rml 2014-04-22 12:10:57 +0000
@@ -138,21 +138,8 @@
138 <images/>138 <images/>
139 </stylesheet>139 </stylesheet>
140 <story>140 <story>
141 <pto>
142 <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>141 <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
143 <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>142 <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
144 <pto_header><!-- Must be after setLang() -->
145 <blockTable colWidths="202.0,87.0,71.0,57.0,42.0,71.0" style="Table7">
146 <tr>
147 <td> <para style="terp_tblheader_Details">Description</para> </td>
148 <td> <para style="terp_tblheader_Details_Centre">Taxes</para> </td>
149 <td> <para style="terp_tblheader_Details_Centre">Quantity</para> </td>
150 <td> <para style="terp_tblheader_Details_Right">Unit Price </para> </td>
151 <td> <para style="terp_tblheader_Details_Right">Disc.(%)</para> </td>
152 <td> <para style="terp_tblheader_Details_Right">Price</para> </td>
153 </tr>
154 </blockTable>
155 </pto_header>
156 <blockTable colWidths="297.0,233.0" style="Table_Partner_Address">143 <blockTable colWidths="297.0,233.0" style="Table_Partner_Address">
157 <tr>144 <tr>
158 <td>145 <td>
@@ -217,6 +204,19 @@
217 <para style="terp_default_8">204 <para style="terp_default_8">
218 <font color="white"> </font>205 <font color="white"> </font>
219 </para>206 </para>
207 <pto>
208 <pto_header>
209 <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7">
210 <tr>
211 <td> <para style="terp_tblheader_Details">Description</para> </td>
212 <td> <para style="terp_tblheader_Details_Centre">Taxes</para> </td>
213 <td> <para style="terp_tblheader_Details_Centre">Quantity</para> </td>
214 <td> <para style="terp_tblheader_Details_Right">Unit Price </para> </td>
215 <td> <para style="terp_tblheader_Details_Right">Disc.(%)</para> </td>
216 <td> <para style="terp_tblheader_Details_Right">Price</para> </td>
217 </tr>
218 </blockTable>
219 </pto_header>
220 <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7">220 <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7">
221 <tr>221 <tr>
222 <td>222 <td>
@@ -294,6 +294,7 @@
294 </tr>294 </tr>
295 </blockTable>295 </blockTable>
296 </section>296 </section>
297 </pto>
297 <blockTable colWidths="385.0,60.0,85.0" style="Table10">298 <blockTable colWidths="385.0,60.0,85.0" style="Table10">
298 <tr>299 <tr>
299 <td>300 <td>
@@ -401,6 +402,5 @@
401 <para style="terp_default_2">402 <para style="terp_default_2">
402 <font color="white"> </font>403 <font color="white"> </font>
403 </para>404 </para>
404 </pto>
405 </story>405 </story>
406</document>406</document>
407407
=== modified file 'account_analytic_analysis/account_analytic_analysis.py'
--- account_analytic_analysis/account_analytic_analysis.py 2012-01-31 13:36:57 +0000
+++ account_analytic_analysis/account_analytic_analysis.py 2014-04-22 12:10:57 +0000
@@ -419,39 +419,24 @@
419419
420 def init(self, cr):420 def init(self, cr):
421 tools.sql.drop_view_if_exists(cr, 'account_analytic_analysis_summary_user')421 tools.sql.drop_view_if_exists(cr, 'account_analytic_analysis_summary_user')
422 cr.execute('CREATE OR REPLACE VIEW account_analytic_analysis_summary_user AS (' \422 cr.execute('''CREATE OR REPLACE VIEW account_analytic_analysis_summary_user AS (
423 'SELECT ' \423 with mu as
424 '(u.account_id * u.max_user) + u."user" AS id, ' \424 (select max(id) as max_user from res_users)
425 'u.account_id AS account_id, ' \425 , lu AS
426 'u."user" AS "user", ' \426 (SELECT
427 'COALESCE(SUM(l.unit_amount), 0.0) AS unit_amount ' \427 l.account_id AS account_id,
428 'FROM ' \428 coalesce(l.user_id, 0) AS user_id,
429 '(SELECT ' \429 SUM(l.unit_amount) AS unit_amount
430 'a.id AS account_id, ' \430 FROM account_analytic_line AS l,
431 'u1.id AS "user", ' \431 account_analytic_journal AS j
432 'MAX(u2.id) AS max_user ' \432 WHERE (j.type = 'general' ) and (j.id=l.journal_id)
433 'FROM ' \433 GROUP BY l.account_id, l.user_id
434 'res_users AS u1, ' \434 )
435 'res_users AS u2, ' \435 select (lu.account_id * mu.max_user) + lu.user_id as id,
436 'account_analytic_account AS a ' \436 lu.account_id as account_id,
437 'GROUP BY u1.id, a.id ' \437 lu.user_id as "user",
438 ') AS u ' \438 unit_amount
439 'LEFT JOIN ' \439 from lu, mu)''')
440 '(SELECT ' \
441 'l.account_id AS account_id, ' \
442 'l.user_id AS "user", ' \
443 'SUM(l.unit_amount) AS unit_amount ' \
444 'FROM account_analytic_line AS l, ' \
445 'account_analytic_journal AS j ' \
446 'WHERE (j.type = \'general\') and (j.id=l.journal_id) ' \
447 'GROUP BY l.account_id, l.user_id ' \
448 ') AS l '
449 'ON (' \
450 'u.account_id = l.account_id ' \
451 'AND u."user" = l."user"' \
452 ') ' \
453 'GROUP BY u."user", u.account_id, u.max_user' \
454 ')')
455440
456account_analytic_account_summary_user()441account_analytic_account_summary_user()
457442
458443
=== modified file 'account_analytic_plans/account_analytic_plans_view.xml'
--- account_analytic_plans/account_analytic_plans_view.xml 2011-05-31 21:55:34 +0000
+++ account_analytic_plans/account_analytic_plans_view.xml 2014-04-22 12:10:57 +0000
@@ -23,10 +23,10 @@
23 <field name="inherit_id" ref="account.view_move_form"/>23 <field name="inherit_id" ref="account.view_move_form"/>
24 <field name="arch" type="xml">24 <field name="arch" type="xml">
25 <xpath expr="/form/notebook/page/field[@name='line_id']/tree/field[@name='analytic_account_id']" position="replace">25 <xpath expr="/form/notebook/page/field[@name='line_id']/tree/field[@name='analytic_account_id']" position="replace">
26 <field name="analytics_id" context="{'journal_id':journal_id}" groups="analytic.group_analytic_accounting"/>26 <field name="analytics_id" context="{'journal_id':parent.journal_id}" groups="analytic.group_analytic_accounting"/>
27 </xpath>27 </xpath>
28 <xpath expr="/form/notebook/page/field[@name='line_id']/form/notebook/page/group/field[@name='analytic_account_id']" position="replace">28 <xpath expr="/form/notebook/page/field[@name='line_id']/form/notebook/page/group/field[@name='analytic_account_id']" position="replace">
29 <field name="analytics_id" context="{'journal_id':journal_id}" groups="analytic.group_analytic_accounting"/>29 <field name="analytics_id" context="{'journal_id':parent.journal_id}" groups="analytic.group_analytic_accounting"/>
30 </xpath>30 </xpath>
31 </field>31 </field>
32 </record>32 </record>
3333
=== modified file 'account_anglo_saxon/__openerp__.py'
--- account_anglo_saxon/__openerp__.py 2012-01-31 13:36:57 +0000
+++ account_anglo_saxon/__openerp__.py 2014-04-22 12:10:57 +0000
@@ -38,7 +38,7 @@
38 "depends": ["product", "purchase"],38 "depends": ["product", "purchase"],
39 "category": "Hidden/Dependency",39 "category": "Hidden/Dependency",
40 "init_xml": [],40 "init_xml": [],
41 "demo_xml": [],41 "demo_xml": ['account_anglo_saxon_demo.xml'],
42 "update_xml": ["product_view.xml",],42 "update_xml": ["product_view.xml",],
43 "auto_install": False,43 "auto_install": False,
44 "installable": True,44 "installable": True,
4545
=== added file 'account_anglo_saxon/account_anglo_saxon_demo.xml'
--- account_anglo_saxon/account_anglo_saxon_demo.xml 1970-01-01 00:00:00 +0000
+++ account_anglo_saxon/account_anglo_saxon_demo.xml 2014-04-22 12:10:57 +0000
@@ -0,0 +1,34 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <!--
6 Create a stock input account in the minimal
7 chart of accounts
8 -->
9
10 <record id="stk_in" model="account.account">
11 <field name="code">X12000</field>
12 <field name="name">Incoming Stocks - (test)</field>
13 <field ref="account.cas" name="parent_id"/>
14 <field name="type">other</field>
15 <field name="user_type" ref="account.data_account_type_asset"/>
16 </record>
17
18 <!--
19 Set the input account to these products, purchased in
20 the tests in purchase_double_validation
21 -->
22
23 <record id="product.product_product_pc4" model="product.product">
24 <field name="property_stock_account_input"
25 ref="stk_in" />
26 </record>
27
28 <record id="product.product_product_hdd2" model="product.product">
29 <field name="property_stock_account_input"
30 ref="stk_in" />
31 </record>
32
33 </data>
34</openerp>
035
=== modified file 'account_anglo_saxon/purchase.py'
--- account_anglo_saxon/purchase.py 2011-12-19 16:54:40 +0000
+++ account_anglo_saxon/purchase.py 2014-04-22 12:10:57 +0000
@@ -26,17 +26,17 @@
26 _inherit = "purchase.order"26 _inherit = "purchase.order"
27 _description = "Purchase Order"27 _description = "Purchase Order"
2828
29 def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):29 def _choose_account_from_po_line(self, cr, uid, order_line, context=None):
30 line = super(purchase_order, self)._prepare_inv_line(cr, uid, account_id, order_line, context=context)30 account_id = super(purchase_order, self)._choose_account_from_po_line(cr, uid, order_line, context=context)
31 if order_line.product_id and not order_line.product_id.type == 'service':31 if order_line.product_id and not order_line.product_id.type == 'service':
32 acc_id = order_line.product_id.property_stock_account_input and order_line.product_id.property_stock_account_input.id32 acc_id = order_line.product_id.property_stock_account_input and order_line.product_id.property_stock_account_input.id
33 if not acc_id:33 if not acc_id:
34 acc_id = order_line.product_id.categ_id.property_stock_account_input_categ and order_line.product_id.categ_id.property_stock_account_input_categ.id34 acc_id = order_line.product_id.categ_id.property_stock_account_input_categ and order_line.product_id.categ_id.property_stock_account_input_categ.id
35 if acc_id:35 if not acc_id:
36 raise osv.except_osv(_('Error !'), _('There is no stock input account defined for this product or category: "%s" (id:%d)') % (order_line.product_id.name, order_line.product_id.id,))
37 else:
36 fpos = order_line.order_id.fiscal_position or False38 fpos = order_line.order_id.fiscal_position or False
37 new_account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, acc_id)39 account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, acc_id)
38 line.update({'account_id': new_account_id})40 return account_id
39 return line
40purchase_order()
4141
42# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:42# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4343
=== modified file 'account_asset/account_asset_invoice.py'
--- account_asset/account_asset_invoice.py 2011-11-11 19:29:54 +0000
+++ account_asset/account_asset_invoice.py 2014-04-22 12:10:57 +0000
@@ -57,6 +57,7 @@
57 'partner_id': line.invoice_id.partner_id.id,57 'partner_id': line.invoice_id.partner_id.id,
58 'company_id': line.invoice_id.company_id.id,58 'company_id': line.invoice_id.company_id.id,
59 'currency_id': line.invoice_id.currency_id.id,59 'currency_id': line.invoice_id.currency_id.id,
60 'purchase_date' : line.invoice_id.date_invoice,
60 }61 }
61 changed_vals = asset_obj.onchange_category_id(cr, uid, [], vals['category_id'], context=context)62 changed_vals = asset_obj.onchange_category_id(cr, uid, [], vals['category_id'], context=context)
62 vals.update(changed_vals['value'])63 vals.update(changed_vals['value'])
6364
=== modified file 'account_budget/account_budget.py'
--- account_budget/account_budget.py 2011-12-31 07:57:20 +0000
+++ account_budget/account_budget.py 2014-04-22 12:10:57 +0000
@@ -113,8 +113,10 @@
113 result = 0.0113 result = 0.0
114 if context is None: 114 if context is None:
115 context = {}115 context = {}
116 account_obj = self.pool.get('account.account')
116 for line in self.browse(cr, uid, ids, context=context):117 for line in self.browse(cr, uid, ids, context=context):
117 acc_ids = [x.id for x in line.general_budget_id.account_ids]118 acc_ids = [x.id for x in line.general_budget_id.account_ids]
119 acc_ids = account_obj._get_children_and_consol(cr, uid, acc_ids, context=context)
118 if not acc_ids:120 if not acc_ids:
119 raise osv.except_osv(_('Error!'),_("The Budget '%s' has no accounts!") % str(line.general_budget_id.name))121 raise osv.except_osv(_('Error!'),_("The Budget '%s' has no accounts!") % str(line.general_budget_id.name))
120 date_to = line.date_to122 date_to = line.date_to
@@ -124,7 +126,21 @@
124 if context.has_key('wizard_date_to'):126 if context.has_key('wizard_date_to'):
125 date_to = context['wizard_date_to']127 date_to = context['wizard_date_to']
126 if line.analytic_account_id.id:128 if line.analytic_account_id.id:
127 cr.execute("SELECT SUM(amount) FROM account_analytic_line WHERE account_id=%s AND (date "129 cr.execute("SELECT SUM(amount) FROM account_analytic_line WHERE account_id in "
130 """(with recursive account_analytic_account_hierarchy(id)
131 as
132 (
133 select id from account_analytic_account
134 where id=%s
135 union all
136 select account_analytic_account.id from
137 account_analytic_account
138 join account_analytic_account_hierarchy
139 on account_analytic_account.parent_id=
140 account_analytic_account_hierarchy.id
141 )"""
142 "select id from account_analytic_account_hierarchy) "
143 "AND (date "
128 "between to_date(%s,'yyyy-mm-dd') AND to_date(%s,'yyyy-mm-dd')) AND "144 "between to_date(%s,'yyyy-mm-dd') AND to_date(%s,'yyyy-mm-dd')) AND "
129 "general_account_id=ANY(%s)", (line.analytic_account_id.id, date_from, date_to,acc_ids,))145 "general_account_id=ANY(%s)", (line.analytic_account_id.id, date_from, date_to,acc_ids,))
130 result = cr.fetchone()[0]146 result = cr.fetchone()[0]
131147
=== modified file 'account_payment/account_move_line.py'
--- account_payment/account_move_line.py 2011-07-01 23:41:24 +0000
+++ account_payment/account_move_line.py 2014-04-22 12:10:57 +0000
@@ -51,7 +51,7 @@
51 if not args:51 if not args:
52 return []52 return []
53 line_obj = self.pool.get('account.move.line')53 line_obj = self.pool.get('account.move.line')
54 query = line_obj._query_get(cr, uid, context={})54 query = line_obj._query_get(cr, uid, context=context)
55 where = ' and '.join(map(lambda x: '''(SELECT55 where = ' and '.join(map(lambda x: '''(SELECT
56 CASE WHEN l.amount_currency < 056 CASE WHEN l.amount_currency < 0
57 THEN - l.amount_currency57 THEN - l.amount_currency
@@ -117,4 +117,4 @@
117117
118account_move_line()118account_move_line()
119119
120# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
121\ No newline at end of file120\ No newline at end of file
121# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
122122
=== modified file 'account_payment/account_payment_view.xml'
--- account_payment/account_payment_view.xml 2012-01-31 13:36:57 +0000
+++ account_payment/account_payment_view.xml 2014-04-22 12:10:57 +0000
@@ -107,7 +107,7 @@
107 <field name="user_id"/>107 <field name="user_id"/>
108 <field name="date_prefered"/>108 <field name="date_prefered"/>
109 <field name="date_scheduled" select="1" attrs="{'readonly':[('date_prefered','!=','fixed')]}" />109 <field name="date_scheduled" select="1" attrs="{'readonly':[('date_prefered','!=','fixed')]}" />
110 <button colspan="2" name="%(action_create_payment_order)d" string="Select Invoices to Pay" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/>110 <button colspan="2" name="%(action_create_payment_order)d" string="Select Invoices to Pay" type="action" attrs="{'invisible':[('state','=','done')]}" context="{'all_fiscalyear': True}" icon="gtk-find"/>
111 <field name="company_id" widget='selection' groups="base.group_multi_company"/>111 <field name="company_id" widget='selection' groups="base.group_multi_company"/>
112 </group>112 </group>
113 <field name="line_ids" colspan="4" widget="one2many_list" nolabel="1" context="{'order_id': active_id or False}" >113 <field name="line_ids" colspan="4" widget="one2many_list" nolabel="1" context="{'order_id': active_id or False}" >
114114
=== modified file 'analytic/analytic.py'
--- analytic/analytic.py 2012-02-16 18:01:11 +0000
+++ analytic/analytic.py 2014-04-22 12:10:57 +0000
@@ -263,18 +263,15 @@
263 if name:263 if name:
264 account = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context)264 account = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context)
265 if not account:265 if not account:
266 names=map(lambda i : i.strip(),name.split('/'))266 dom = []
267 for i in range(len(names)):267 for name2 in map(lambda i : i.strip(),name.split('/')):
268 dom=[('name', operator, names[i])]268 account = self.search(
269 if i>0:269 cr, uid,
270 dom+=[('id','child_of',account)]270 dom + [('name', 'ilike', name2)] + args,
271 account = self.search(cr, uid, dom, limit=limit, context=context)271 limit=limit, context=context)
272 newacc = account272 if not account:
273 while newacc:273 break
274 newacc = self.search(cr, uid, [('parent_id', 'in', newacc)], limit=limit, context=context)274 dom = [('parent_id','in',account)]
275 account += newacc
276 if args:
277 account = self.search(cr, uid, [('id', 'in', account)] + args, limit=limit, context=context)
278 else:275 else:
279 account = self.search(cr, uid, args, limit=limit, context=context)276 account = self.search(cr, uid, args, limit=limit, context=context)
280 return self.name_get(cr, uid, account, context=context)277 return self.name_get(cr, uid, account, context=context)
281278
=== modified file 'audittrail/audittrail.py'
--- audittrail/audittrail.py 2012-03-23 14:25:41 +0000
+++ audittrail/audittrail.py 2014-04-22 12:10:57 +0000
@@ -173,6 +173,10 @@
173class audittrail_objects_proxy(object_proxy):173class audittrail_objects_proxy(object_proxy):
174 """ Uses Object proxy for auditing changes on object of subscribed Rules"""174 """ Uses Object proxy for auditing changes on object of subscribed Rules"""
175175
176 _default_recursive_level = 1
177 "Columns to be filtered from audited fields"
178 __filtered_columns = ('__last_update', 'id')
179
176 def get_value_text(self, cr, uid, pool, resource_pool, method, field, value):180 def get_value_text(self, cr, uid, pool, resource_pool, method, field, value):
177 """181 """
178 Gets textual values for the fields.182 Gets textual values for the fields.
@@ -300,7 +304,7 @@
300 self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)304 self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)
301 return res305 return res
302306
303 def get_data(self, cr, uid, pool, res_ids, model, method):307 def get_data(self, cr, uid, pool, res_ids, model, method, recursive_level=None):
304 """308 """
305 This function simply read all the fields of the given res_ids, and also recurisvely on309 This function simply read all the fields of the given res_ids, and also recurisvely on
306 all records of a x2m fields read that need to be logged. Then it returns the result in310 all records of a x2m fields read that need to be logged. Then it returns the result in
@@ -319,6 +323,8 @@
319 },323 },
320 }324 }
321 """325 """
326 if recursive_level is None:
327 recursive_level = self._default_recursive_level
322 data = {}328 data = {}
323 resource_pool = pool.get(model.model)329 resource_pool = pool.get(model.model)
324 # read all the fields of the given resources in super admin mode330 # read all the fields of the given resources in super admin mode
@@ -328,14 +334,14 @@
328 resource_id = resource['id']334 resource_id = resource['id']
329 # loop on each field on the res_ids we just have read335 # loop on each field on the res_ids we just have read
330 for field in resource:336 for field in resource:
331 if field in ('__last_update', 'id'):337 if field in self.__filtered_columns:
332 continue338 continue
333 values[field] = resource[field]339 values[field] = resource[field]
334 # get the textual value of that field for this record340 # get the textual value of that field for this record
335 values_text[field] = self.get_value_text(cr, 1, pool, resource_pool, method, field, resource[field])341 values_text[field] = self.get_value_text(cr, 1, pool, resource_pool, method, field, resource[field])
336342
337 field_obj = resource_pool._all_columns.get(field).column343 field_obj = resource_pool._all_columns.get(field).column
338 if field_obj._type in ('one2many','many2many'):344 if field_obj._type in ('one2many','many2many') and recursive_level:
339 # check if an audittrail rule apply in super admin mode345 # check if an audittrail rule apply in super admin mode
340 if self.check_rules(cr, 1, field_obj._obj, method):346 if self.check_rules(cr, 1, field_obj._obj, method):
341 # check if the model associated to a *2m field exists, in super admin mode347 # check if the model associated to a *2m field exists, in super admin mode
@@ -344,11 +350,11 @@
344 assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))350 assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
345 x2m_model = pool.get('ir.model').browse(cr, 1, x2m_model_id)351 x2m_model = pool.get('ir.model').browse(cr, 1, x2m_model_id)
346 #recursive call on x2m fields that need to be checked too352 #recursive call on x2m fields that need to be checked too
347 data.update(self.get_data(cr, 1, pool, resource[field], x2m_model, method))353 data.update(self.get_data(cr, 1, pool, resource[field], x2m_model, method, recursive_level - 1))
348 data[(model.id, resource_id)] = {'text':values_text, 'value': values}354 data[(model.id, resource_id)] = {'text':values_text, 'value': values}
349 return data355 return data
350356
351 def prepare_audittrail_log_line(self, cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=[]):357 def prepare_audittrail_log_line(self, cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=[], recursive_level=None):
352 """358 """
353 This function compares the old data (i.e before the method was executed) and the new data 359 This function compares the old data (i.e before the method was executed) and the new data
354 (after the method was executed) and returns a structure with all the needed information to360 (after the method was executed) and returns a structure with all the needed information to
@@ -378,6 +384,8 @@
378 record (res.partner, for example), we may have to log a change done in a x2many field (on 384 record (res.partner, for example), we may have to log a change done in a x2many field (on
379 res.partner.address, for example)385 res.partner.address, for example)
380 """386 """
387 if recursive_level is None:
388 recursive_level = self._default_recursive_level
381 key = (model.id, resource_id)389 key = (model.id, resource_id)
382 lines = {390 lines = {
383 key: []391 key: []
@@ -385,10 +393,10 @@
385 # loop on all the fields393 # loop on all the fields
386 for field_name, field_definition in pool.get(model.model)._all_columns.items():394 for field_name, field_definition in pool.get(model.model)._all_columns.items():
387 #if the field_list param is given, skip all the fields not in that list395 #if the field_list param is given, skip all the fields not in that list
388 if field_list and field_name not in field_list:396 if field_list and field_name not in field_list or field_name in self.__filtered_columns:
389 continue397 continue
390 field_obj = field_definition.column398 field_obj = field_definition.column
391 if field_obj._type in ('one2many','many2many'):399 if field_obj._type in ('one2many','many2many') and recursive_level:
392 # checking if an audittrail rule apply in super admin mode400 # checking if an audittrail rule apply in super admin mode
393 if self.check_rules(cr, 1, field_obj._obj, method):401 if self.check_rules(cr, 1, field_obj._obj, method):
394 # checking if the model associated to a *2m field exists, in super admin mode402 # checking if the model associated to a *2m field exists, in super admin mode
@@ -403,7 +411,7 @@
403 # We use list(set(...)) to remove duplicates.411 # We use list(set(...)) to remove duplicates.
404 res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids))412 res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids))
405 for res_id in res_ids:413 for res_id in res_ids:
406 lines.update(self.prepare_audittrail_log_line(cr, 1, pool, x2m_model, res_id, method, old_values, new_values, field_list))414 lines.update(self.prepare_audittrail_log_line(cr, 1, pool, x2m_model, res_id, method, old_values, new_values, field_list, recursive_level=recursive_level - 1))
407 # if the value value is different than the old value: record the change415 # if the value value is different than the old value: record the change
408 if key not in old_values or key not in new_values or old_values[key]['value'][field_name] != new_values[key]['value'][field_name]:416 if key not in old_values or key not in new_values or old_values[key]['value'][field_name] != new_values[key]['value'][field_name]:
409 data = {417 data = {
410418
=== modified file 'base_action_rule/base_action_rule.py'
--- base_action_rule/base_action_rule.py 2012-04-26 08:03:00 +0000
+++ base_action_rule/base_action_rule.py 2014-04-22 12:10:57 +0000
@@ -20,6 +20,7 @@
20##############################################################################20##############################################################################
2121
22from osv import fields, osv, orm22from osv import fields, osv, orm
23from openerp import SUPERUSER_ID
23from tools.translate import _24from tools.translate import _
24from datetime import datetime25from datetime import datetime
25from datetime import timedelta26from datetime import timedelta
@@ -202,11 +203,13 @@
202 return True203 return True
203 return wrapper204 return wrapper
204205
205 def _register_hook(self, cr, uid, ids, context=None):206 def _register_hook(self, cr, uid=SUPERUSER_ID, ids=None, context=None):
206 """207 """
207 Wrap every `create` and `write` methods of the models specified by208 Wrap every `create` and `write` methods of the models specified by
208 the rules (given by `ids`).209 the rules (given by `ids`).
209 """210 """
211 if ids == [] or ids is None:
212 ids = self.search(cr, uid, [])
210 for action_rule in self.browse(cr, uid, ids, context=context):213 for action_rule in self.browse(cr, uid, ids, context=context):
211 model = action_rule.model_id.model214 model = action_rule.model_id.model
212 obj_pool = self.pool.get(model)215 obj_pool = self.pool.get(model)
213216
=== modified file 'base_calendar/base_calendar.py'
--- base_calendar/base_calendar.py 2012-03-05 14:35:54 +0000
+++ base_calendar/base_calendar.py 2014-04-22 12:10:57 +0000
@@ -30,6 +30,7 @@
30import re30import re
31import time31import time
32import tools32import tools
33from operator import itemgetter
3334
34months = {35months = {
35 1: "January", 2: "February", 3: "March", 4: "April", \36 1: "January", 2: "February", 3: "March", 4: "April", \
@@ -85,7 +86,10 @@
85 return (int(real_id), real_date, end.strftime("%Y-%m-%d %H:%M:%S"))86 return (int(real_id), real_date, end.strftime("%Y-%m-%d %H:%M:%S"))
86 return int(real_id)87 return int(real_id)
8788
88 return base_calendar_id and int(base_calendar_id) or base_calendar_id89 return int(base_calendar_id)
90
91 return base_calendar_id
92
8993
90def real_id2base_calendar_id(real_id, recurrent_date):94def real_id2base_calendar_id(real_id, recurrent_date):
91 """95 """
@@ -1303,6 +1307,18 @@
1303 res.append(base_calendar_id2real_id(id))1307 res.append(base_calendar_id2real_id(id))
1304 return res1308 return res
13051309
1310 def _multikeysort(self, items, columns):
1311
1312 comparers = [ ((itemgetter(col[1:].strip()), -1) if col.startswith('-') else (itemgetter(col.strip()), 1)) for col in columns]
1313 def comparer(left, right):
1314 for fn, mult in comparers:
1315 result = cmp(fn(left), fn(right))
1316 if result:
1317 return mult * result
1318 else:
1319 return 0
1320 return sorted(items, cmp=comparer)
1321
1306 def search(self, cr, uid, args, offset=0, limit=0, order=None, context=None, count=False):1322 def search(self, cr, uid, args, offset=0, limit=0, order=None, context=None, count=False):
1307 context = context or {}1323 context = context or {}
1308 args_without_date = []1324 args_without_date = []
@@ -1327,6 +1343,16 @@
1327 0, 0, order, context, count=False)1343 0, 0, order, context, count=False)
1328 if context.get('virtual_id', True):1344 if context.get('virtual_id', True):
1329 res = self.get_recurrent_ids(cr, uid, res, args, limit, context=context)1345 res = self.get_recurrent_ids(cr, uid, res, args, limit, context=context)
1346 if order:
1347 order = order.split(',')
1348 sortby = {}
1349 for o in order:
1350 spl = o.split()
1351 sortby[spl[0]] = spl[1]
1352 fields = sortby.keys()
1353 ordered = self.read(cr, uid, res, fields=fields, context=context)
1354 res = self._multikeysort(ordered, [key.split()[0] if sortby[key.split()[0]] == 'ASC' else '-%s' % key.split()[0] for key in order])
1355 res = [x['id'] for x in res]
13301356
1331 if count:1357 if count:
1332 return len(res)1358 return len(res)
13331359
=== modified file 'base_contact/base_contact.py'
--- base_contact/base_contact.py 2012-02-15 13:22:13 +0000
+++ base_contact/base_contact.py 2014-04-22 12:10:57 +0000
@@ -93,7 +93,7 @@
93 return bool(value == 1)93 return bool(value == 1)
9494
95 exists = table_exists(self._table)95 exists = table_exists(self._table)
96 super(res_partner_contact, self)._auto_init(cr, context)96 result = super(res_partner_contact, self)._auto_init(cr, context)
9797
98 if not exists:98 if not exists:
99 cr.execute("""99 cr.execute("""
@@ -108,6 +108,8 @@
108 cr.execute("update res_partner_address set contact_id=id")108 cr.execute("update res_partner_address set contact_id=id")
109 cr.execute("select setval('res_partner_contact_id_seq', (select max(id)+1 from res_partner_contact))")109 cr.execute("select setval('res_partner_contact_id_seq', (select max(id)+1 from res_partner_contact))")
110110
111 return result
112
111res_partner_contact()113res_partner_contact()
112114
113class res_partner_location(osv.osv):115class res_partner_location(osv.osv):
114116
=== modified file 'crm/crm_lead_view.xml'
--- crm/crm_lead_view.xml 2012-11-20 11:39:58 +0000
+++ crm/crm_lead_view.xml 2014-04-22 12:10:57 +0000
@@ -483,6 +483,8 @@
483 <field name="partner_address_id"483 <field name="partner_address_id"
484 string="Contact"484 string="Contact"
485 on_change="onchange_partner_address_id(partner_address_id, email_from)"485 on_change="onchange_partner_address_id(partner_address_id, email_from)"
486 options='{"quick_create": false}'
487 context="{'default_partner_id':partner_id}"
486 colspan="1" />488 colspan="1" />
487 <group col="3" colspan="2">489 <group col="3" colspan="2">
488 <field name="email_from" string="Email" />490 <field name="email_from" string="Email" />
489491
=== modified file 'crm/crm_meeting_view.xml'
--- crm/crm_meeting_view.xml 2012-01-31 13:36:57 +0000
+++ crm/crm_meeting_view.xml 2014-04-22 12:10:57 +0000
@@ -62,7 +62,9 @@
62 on_change="onchange_partner_id(partner_id)" />62 on_change="onchange_partner_id(partner_id)" />
63 <field name="partner_address_id"63 <field name="partner_address_id"
64 string="Contact"64 string="Contact"
65 on_change="onchange_partner_address_id(partner_address_id, email_from)" />65 on_change="onchange_partner_address_id(partner_address_id, email_from)"
66 options='{"quick_create": false}'
67 context="{'default_partner_id':partner_id}" />
66 <field name="email_from"/>68 <field name="email_from"/>
67 </group><group col="2" colspan="2">69 </group><group col="2" colspan="2">
68 <separator colspan="2" string="Visibility"/>70 <separator colspan="2" string="Visibility"/>
6971
=== modified file 'crm/crm_phonecall_view.xml'
--- crm/crm_phonecall_view.xml 2011-12-21 13:10:28 +0000
+++ crm/crm_phonecall_view.xml 2014-04-22 12:10:57 +0000
@@ -92,7 +92,9 @@
92 groups="base.group_partner_manager"/>92 groups="base.group_partner_manager"/>
93 <newline/>93 <newline/>
94 <field name="partner_address_id"94 <field name="partner_address_id"
95 on_change="onchange_partner_address_id(partner_address_id)" />95 on_change="onchange_partner_address_id(partner_address_id)"
96 options='{"quick_create": false}'
97 context="{'default_partner_id':partner_id}" />
96 <newline/>98 <newline/>
97 <field name="partner_mobile" />99 <field name="partner_mobile" />
98 </group>100 </group>
99101
=== modified file 'crm_claim/crm_claim_view.xml'
--- crm_claim/crm_claim_view.xml 2012-01-31 13:36:57 +0000
+++ crm_claim/crm_claim_view.xml 2014-04-22 12:10:57 +0000
@@ -91,7 +91,9 @@
91 <field name="partner_id" string="Partner"91 <field name="partner_id" string="Partner"
92 on_change="onchange_partner_id(partner_id)" />92 on_change="onchange_partner_id(partner_id)" />
93 <field name="partner_address_id" string="Contact"93 <field name="partner_address_id" string="Contact"
94 on_change="onchange_partner_address_id(partner_address_id, email_from)" />94 on_change="onchange_partner_address_id(partner_address_id, email_from)"
95 options='{"quick_create": false}'
96 context="{'default_partner_id':partner_id}" />
95 <field name="partner_phone"/>97 <field name="partner_phone"/>
96 <field name="email_from" widget="email"/>98 <field name="email_from" widget="email"/>
97 </group>99 </group>
98100
=== modified file 'crm_fundraising/crm_fundraising_view.xml'
--- crm_fundraising/crm_fundraising_view.xml 2011-12-19 16:54:40 +0000
+++ crm_fundraising/crm_fundraising_view.xml 2014-04-22 12:10:57 +0000
@@ -97,6 +97,8 @@
97 <field name="partner_address_id"97 <field name="partner_address_id"
98 string="Contact"98 string="Contact"
99 on_change="onchange_partner_address_id(partner_address_id, email_from)"99 on_change="onchange_partner_address_id(partner_address_id, email_from)"
100 options='{"quick_create": false}'
101 context="{'default_partner_id':partner_id}"
100 colspan="1" />102 colspan="1" />
101 <field name="email_from" colspan="2"/>103 <field name="email_from" colspan="2"/>
102 </group>104 </group>
103105
=== modified file 'crm_helpdesk/crm_helpdesk_view.xml'
--- crm_helpdesk/crm_helpdesk_view.xml 2011-12-19 16:54:40 +0000
+++ crm_helpdesk/crm_helpdesk_view.xml 2014-04-22 12:10:57 +0000
@@ -49,7 +49,8 @@
49 select="1" />49 select="1" />
50 <field name="partner_address_id" colspan="2"50 <field name="partner_address_id" colspan="2"
51 on_change="onchange_partner_address_id(partner_address_id, email_from)"51 on_change="onchange_partner_address_id(partner_address_id, email_from)"
52 />52 options='{"quick_create": false}'
53 context="{'default_partner_id':partner_id}" />
53 <newline/>54 <newline/>
54 <field name="email_from" colspan="2"/>55 <field name="email_from" colspan="2"/>
55 <button name="remind_partner"56 <button name="remind_partner"
5657
=== modified file 'delivery/__openerp__.py'
--- delivery/__openerp__.py 2012-01-31 13:36:57 +0000
+++ delivery/__openerp__.py 2014-04-22 12:10:57 +0000
@@ -46,6 +46,7 @@
46 'demo_xml': ['delivery_demo.xml'],46 'demo_xml': ['delivery_demo.xml'],
47 'test': [47 'test': [
48 'test/delivery_cost.yml',48 'test/delivery_cost.yml',
49 'test/delivery_chained_pickings.yml',
49 ],50 ],
50 'installable': True,51 'installable': True,
51 'auto_install': False,52 'auto_install': False,
5253
=== modified file 'delivery/stock.py'
--- delivery/stock.py 2011-12-21 18:11:49 +0000
+++ delivery/stock.py 2014-04-22 12:10:57 +0000
@@ -75,7 +75,7 @@
75 :param browse_record picking: the stock picking being invoiced75 :param browse_record picking: the stock picking being invoiced
76 :param browse_record invoice: the stock picking's invoice76 :param browse_record invoice: the stock picking's invoice
77 :return: dict containing the values to create the invoice line,77 :return: dict containing the values to create the invoice line,
78 or None to create nothing78 or None to create nothing
79 """79 """
80 carrier_obj = self.pool.get('delivery.carrier')80 carrier_obj = self.pool.get('delivery.carrier')
81 grid_obj = self.pool.get('delivery.grid')81 grid_obj = self.pool.get('delivery.grid')
@@ -160,6 +160,17 @@
160 }160 }
161 return res161 return res
162162
163 def _prepare_chained_picking(self, cr, uid, picking_name, picking, picking_type, moves_todo, context=None):
164 values = super(stock_move, self)._prepare_chained_picking(cr, uid, picking_name, picking, picking_type, moves_todo, context=context)
165 if picking.carrier_id:
166 values['carrier_id'] = picking.carrier_id.id
167 values['volume'] = picking.volume
168 values['weight'] = picking.weight
169 values['weight_net'] = picking.weight_net
170 values['carrier_tracking_ref'] = picking.carrier_tracking_ref
171 values['number_of_packages'] = picking.number_of_packages
172 return values
173
163 _columns = {174 _columns = {
164 'weight': fields.function(_cal_move_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight',175 'weight': fields.function(_cal_move_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight',
165 store={176 store={
166177
=== added file 'delivery/test/delivery_chained_pickings.yml'
--- delivery/test/delivery_chained_pickings.yml 1970-01-01 00:00:00 +0000
+++ delivery/test/delivery_chained_pickings.yml 2014-04-22 12:10:57 +0000
@@ -0,0 +1,37 @@
1-
2 I create a picking to stock.location_convenience_shop, which is chained with stock.location_refrigerator
3-
4 !record {model: stock.picking, id: shipment_with_delivery}:
5 type: internal
6 carrier_id: delivery.delivery_carrier
7 volume: 42
8 carrier_tracking_ref: FDX123
9 number_of_packages: 7
10-
11 I add a move in the picking
12-
13 !record {model: stock.move, id: icecream_move}:
14 picking_id: shipment_with_delivery
15 product_id: stock.product_icecream
16 product_uom: product.product_uom_kgm
17 product_qty: 130.0
18 location_id: stock.stock_location_suppliers
19 location_dest_id: stock.location_convenience_shop
20-
21 I confirm the picking
22-
23 !workflow {model: stock.picking, action: button_confirm, ref: shipment_with_delivery}
24-
25 I check that the delivery fields have been propagated to the chained picking
26-
27 !python {model: stock.move}: |
28 original_move = self.browse(cr, uid, ref('icecream_move'), context=context)
29 original_picking = original_move.picking_id
30 chained_move = original_move.move_dest_id
31 chained_picking = chained_move.picking_id
32 assert chained_picking.carrier_tracking_ref == original_picking.carrier_tracking_ref, 'no propagation of carrier_tracking_ref'
33 assert chained_picking.carrier_id == original_picking.carrier_id, 'no propagation of carrier_id'
34 assert chained_picking.volume == original_picking.volume, 'no propagation of volume'
35 assert chained_picking.weight == original_picking.weight, 'no propagation of weight'
36 assert chained_picking.weight_net == original_picking.weight_net, 'no propagation of weight'
37
038
=== modified file 'document/document.py'
--- document/document.py 2012-08-22 09:10:40 +0000
+++ document/document.py 2014-04-22 12:10:57 +0000
@@ -147,6 +147,9 @@
147 # filename_uniq is not possible in pure SQL147 # filename_uniq is not possible in pure SQL
148 ]148 ]
149 def _check_duplication(self, cr, uid, vals, ids=[], op='create'):149 def _check_duplication(self, cr, uid, vals, ids=[], op='create'):
150 """
151 Returns True if not same filename is attached already to an object (res_model, res_id)
152 """
150 name = vals.get('name', False)153 name = vals.get('name', False)
151 parent_id = vals.get('parent_id', False)154 parent_id = vals.get('parent_id', False)
152 res_model = vals.get('res_model', False)155 res_model = vals.get('res_model', False)
@@ -340,14 +343,21 @@
340 storage_id = par.storage_id343 storage_id = par.storage_id
341 break344 break
342 par = par.parent_id345 par = par.parent_id
343 #assert storage_id, "Strange, found file #%s w/o storage!" % f.id #TOCHECK: after run yml, it's fail346 #We get the ids of attachement that correspond to the document
344 if storage_id:347 attachment_ids = self.search(cr, uid, [('store_fname', '=', f.store_fname), ('parent_id.name', '=', f.parent_id.name)], context=context)
345 r = stor.prepare_unlink(cr, uid, storage_id, f)348 #If we have more than 1 attachment for a same file, we will not unlink it.
346 if r:349 canUnlink = len(attachment_ids)
347 unres.append(r)350 #If canUnlink is bigger than 1 it means that the document has more than 1 attachement.
348 else:351 #We therefore cannot unlink that document.
349 logging.getLogger('document').warning("Unlinking attachment #%s %s that has no storage",352 if canUnlink == 1:
350 f.id, f.name)353 #assert storage_id, "Strange, found file #%s w/o storage!" % f.id #TOCHECK: after run yml, it's fail
354 if storage_id:
355 r = stor.prepare_unlink(cr, uid, storage_id, f)
356 if r:
357 unres.append(r)
358 else:
359 logging.getLogger('document').warning("Unlinking attachment #%s %s that has no storage",
360 f.id, f.name)
351 res = super(document_file, self).unlink(cr, uid, ids, context)361 res = super(document_file, self).unlink(cr, uid, ids, context)
352 stor.do_unlink(cr, uid, unres)362 stor.do_unlink(cr, uid, unres)
353 return res363 return res
354364
=== modified file 'fetchmail/fetchmail.py'
--- fetchmail/fetchmail.py 2012-07-27 13:50:07 +0000
+++ fetchmail/fetchmail.py 2014-04-22 12:10:57 +0000
@@ -255,7 +255,7 @@
255 context={}255 context={}
256 fetchmail_server_id = context.get('fetchmail_server_id')256 fetchmail_server_id = context.get('fetchmail_server_id')
257 if fetchmail_server_id:257 if fetchmail_server_id:
258 values['fetchmail_server_id'] = server_id258 values['fetchmail_server_id'] = fetchmail_server_id
259 res = super(mail_message,self).write(cr, uid, ids, values, context=context)259 res = super(mail_message,self).write(cr, uid, ids, values, context=context)
260 return res260 return res
261261
262262
=== modified file 'hr/hr.py'
--- hr/hr.py 2012-01-31 13:36:57 +0000
+++ hr/hr.py 2014-04-22 12:10:57 +0000
@@ -184,9 +184,10 @@
184 resource = employee.resource_id184 resource = employee.resource_id
185 if resource:185 if resource:
186 resource_ids.append(resource.id)186 resource_ids.append(resource.id)
187 res = super(hr_employee, self).unlink(cr, uid, ids, context=context)
187 if resource_ids:188 if resource_ids:
188 resource_obj.unlink(cr, uid, resource_ids, context=context)189 resource_obj.unlink(cr, uid, resource_ids, context=context)
189 return super(hr_employee, self).unlink(cr, uid, ids, context=context)190 return res
190191
191 def onchange_address_id(self, cr, uid, ids, address, context=None):192 def onchange_address_id(self, cr, uid, ids, address, context=None):
192 if address:193 if address:
193194
=== modified file 'hr_payroll/hr_payroll.py'
--- hr_payroll/hr_payroll.py 2012-01-31 13:36:57 +0000
+++ hr_payroll/hr_payroll.py 2014-04-22 12:10:57 +0000
@@ -375,7 +375,7 @@
375 #OR if it starts between the given dates375 #OR if it starts between the given dates
376 clause_2 = ['&',('date_start', '<=', date_to),('date_start','>=', date_from)]376 clause_2 = ['&',('date_start', '<=', date_to),('date_start','>=', date_from)]
377 #OR if it starts before the date_from and finish after the date_end (or never finish)377 #OR if it starts before the date_from and finish after the date_end (or never finish)
378 clause_3 = [('date_start','<=', date_from),'|',('date_end', '=', False),('date_end','>=', date_to)]378 clause_3 = ['&',('date_start','<=', date_from),'|',('date_end', '=', False),('date_end','>=', date_to)]
379 clause_final = [('employee_id', '=', employee.id),'|','|'] + clause_1 + clause_2 + clause_3379 clause_final = [('employee_id', '=', employee.id),'|','|'] + clause_1 + clause_2 + clause_3
380 contract_ids = contract_obj.search(cr, uid, clause_final, context=context)380 contract_ids = contract_obj.search(cr, uid, clause_final, context=context)
381 return contract_ids381 return contract_ids
382382
=== modified file 'hr_recruitment/hr_recruitment_view.xml'
--- hr_recruitment/hr_recruitment_view.xml 2011-12-21 13:10:28 +0000
+++ hr_recruitment/hr_recruitment_view.xml 2014-04-22 12:10:57 +0000
@@ -104,7 +104,7 @@
104 name="%(action_hr_recruitment_partner_create)d"104 name="%(action_hr_recruitment_partner_create)d"
105 icon="gtk-index" type="action" attrs="{'readonly':[('partner_id','!=',False)]}" groups="base.group_partner_manager"/>105 icon="gtk-index" type="action" attrs="{'readonly':[('partner_id','!=',False)]}" groups="base.group_partner_manager"/>
106 <newline/>106 <newline/>
107 <field name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)" colspan="3"/>107 <field name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)" options='{"quick_create": false}' context="{'default_partner_id':partner_id}" colspan="3"/>
108 <field name="email_from" colspan="3"/>108 <field name="email_from" colspan="3"/>
109 <field name="partner_phone" colspan="3"/>109 <field name="partner_phone" colspan="3"/>
110 <field name="partner_mobile" colspan="3"/>110 <field name="partner_mobile" colspan="3"/>
111111
=== modified file 'hr_timesheet/hr_timesheet.py'
--- hr_timesheet/hr_timesheet.py 2012-02-14 12:25:20 +0000
+++ hr_timesheet/hr_timesheet.py 2014-04-22 12:10:57 +0000
@@ -74,8 +74,7 @@
74 toremove = {}74 toremove = {}
75 for obj in self.browse(cr, uid, ids, context=context):75 for obj in self.browse(cr, uid, ids, context=context):
76 toremove[obj.line_id.id] = True76 toremove[obj.line_id.id] = True
77 self.pool.get('account.analytic.line').unlink(cr, uid, toremove.keys(), context=context)77 return self.pool.get('account.analytic.line').unlink(cr, uid, toremove.keys(), context=context)
78 return super(hr_analytic_timesheet, self).unlink(cr, uid, ids, context=context)
7978
8079
81 def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, company_id, unit=False, journal_id=False, context=None):80 def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, company_id, unit=False, journal_id=False, context=None):
8281
=== modified file 'hr_timesheet_invoice/hr_timesheet_invoice.py'
--- hr_timesheet_invoice/hr_timesheet_invoice.py 2012-01-03 12:33:39 +0000
+++ hr_timesheet_invoice/hr_timesheet_invoice.py 2014-04-22 12:10:57 +0000
@@ -193,10 +193,13 @@
193 res = super(account_move_line, self).create_analytic_lines(cr, uid, ids,context=context)193 res = super(account_move_line, self).create_analytic_lines(cr, uid, ids,context=context)
194 analytic_line_obj = self.pool.get('account.analytic.line')194 analytic_line_obj = self.pool.get('account.analytic.line')
195 for move_line in self.browse(cr, uid, ids, context=context):195 for move_line in self.browse(cr, uid, ids, context=context):
196 #For customer invoice, link analytic line to the invoice so it is not proposed for invoicing in Bill Tasks Work
197 invoice_id = move_line.invoice and move_line.invoice.type in ('out_invoice','out_refund') and move_line.invoice.id or False
196 for line in move_line.analytic_lines:198 for line in move_line.analytic_lines:
197 toinv = line.account_id.to_invoice.id199 analytic_line_obj.write(cr, uid, line.id, {
198 if toinv:200 'invoice_id': invoice_id,
199 analytic_line_obj.write(cr, uid, line.id, {'to_invoice': toinv})201 'to_invoice': line.account_id.to_invoice and line.account_id.to_invoice.id or False
202 }, context=context)
200 return res203 return res
201204
202account_move_line()205account_move_line()
203206
=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet.py'
--- hr_timesheet_sheet/hr_timesheet_sheet.py 2012-08-31 10:45:03 +0000
+++ hr_timesheet_sheet/hr_timesheet_sheet.py 2014-04-22 12:10:57 +0000
@@ -519,7 +519,7 @@
519 store={519 store={
520 'hr_timesheet_sheet.sheet': (_get_hr_timesheet_sheet, ['employee_id', 'date_from', 'date_to'], 10),520 'hr_timesheet_sheet.sheet': (_get_hr_timesheet_sheet, ['employee_id', 'date_from', 'date_to'], 10),
521 'account.analytic.line': (_get_account_analytic_line, ['user_id', 'date'], 10),521 'account.analytic.line': (_get_account_analytic_line, ['user_id', 'date'], 10),
522 'hr.analytic.timesheet': (lambda self,cr,uid,ids,context=None: ids, ['line_id'], 10),522 'hr.analytic.timesheet': (lambda self,cr,uid,ids,context=None: ids, None, 10),
523 },523 },
524 ),524 ),
525 }525 }
526526
=== modified file 'l10n_nl/__openerp__.py'
--- l10n_nl/__openerp__.py 2011-12-19 16:54:40 +0000
+++ l10n_nl/__openerp__.py 2014-04-22 12:10:57 +0000
@@ -118,6 +118,9 @@
118 ],118 ],
119 "init_xml" : [],119 "init_xml" : [],
120 "update_xml" : ["account_chart_netherlands.xml",120 "update_xml" : ["account_chart_netherlands.xml",
121 "account_fiscal_position_template.xml",
122 "account_fiscal_position_tax_template.xml",
123 "account_fiscal_position_account_template.xml",
121 "l10n_nl_wizard.xml"124 "l10n_nl_wizard.xml"
122 ],125 ],
123 "demo_xml" : [126 "demo_xml" : [
124127
=== modified file 'l10n_nl/account_chart_netherlands.xml'
--- l10n_nl/account_chart_netherlands.xml 2012-03-14 12:53:24 +0000
+++ l10n_nl/account_chart_netherlands.xml 2014-04-22 12:10:57 +0000
@@ -1424,7 +1424,7 @@
1424 <field name="reconcile" eval="True"/>1424 <field name="reconcile" eval="True"/>
1425 <field ref="a_15" name="parent_id"/>1425 <field ref="a_15" name="parent_id"/>
1426 </record>1426 </record>
1427 <record id="vat_payable6" model="account.account.template">1427 <record id="vat_payable_low" model="account.account.template">
1428 <field name="name">Btw af te dragen laag</field>1428 <field name="name">Btw af te dragen laag</field>
1429 <field name="code">1601</field>1429 <field name="code">1601</field>
1430 <field name="type">other</field>1430 <field name="type">other</field>
@@ -1432,7 +1432,7 @@
1432 <field name="reconcile" eval="False"/>1432 <field name="reconcile" eval="False"/>
1433 <field ref="a_15" name="parent_id"/>1433 <field ref="a_15" name="parent_id"/>
1434 </record>1434 </record>
1435 <record id="vat_payable19" model="account.account.template">1435 <record id="vat_payable_high" model="account.account.template">
1436 <field name="name">Btw af te dragen hoog</field>1436 <field name="name">Btw af te dragen hoog</field>
1437 <field name="code">1602</field>1437 <field name="code">1602</field>
1438 <field name="type">other</field>1438 <field name="type">other</field>
@@ -1448,7 +1448,7 @@
1448 <field name="reconcile" eval="False"/>1448 <field name="reconcile" eval="False"/>
1449 <field ref="a_15" name="parent_id"/>1449 <field ref="a_15" name="parent_id"/>
1450 </record>1450 </record>
1451 <record id="vat_refund6" model="account.account.template">1451 <record id="vat_refund_low" model="account.account.template">
1452 <field name="name">Btw te vorderen laag</field>1452 <field name="name">Btw te vorderen laag</field>
1453 <field name="code">1611</field>1453 <field name="code">1611</field>
1454 <field name="type">other</field>1454 <field name="type">other</field>
@@ -1456,7 +1456,7 @@
1456 <field name="reconcile" eval="False"/>1456 <field name="reconcile" eval="False"/>
1457 <field ref="a_15" name="parent_id"/>1457 <field ref="a_15" name="parent_id"/>
1458 </record>1458 </record>
1459 <record id="vat_refund19" model="account.account.template">1459 <record id="vat_refund_high" model="account.account.template">
1460 <field name="name">Btw te vorderen hoog</field>1460 <field name="name">Btw te vorderen hoog</field>
1461 <field name="code">1612</field>1461 <field name="code">1612</field>
1462 <field name="type">other</field>1462 <field name="type">other</field>
@@ -3909,7 +3909,7 @@
3909 <record id="btw_code_1a" model="account.tax.code.template">3909 <record id="btw_code_1a" model="account.tax.code.template">
3910 <field name="code">1a</field>3910 <field name="code">1a</field>
3911 <field name="parent_id" ref="btw_code_binnenland"/>3911 <field name="parent_id" ref="btw_code_binnenland"/>
3912 <field name="name">Leveringen/diensten belast met 19% (BTW)</field>3912 <field name="name">Leveringen/diensten belast met 21% (BTW)</field>
3913 </record>3913 </record>
3914 <record id="btw_code_1b" model="account.tax.code.template">3914 <record id="btw_code_1b" model="account.tax.code.template">
3915 <field name="code">1b</field>3915 <field name="code">1b</field>
@@ -3955,11 +3955,13 @@
3955 <field name="code">4a</field>3955 <field name="code">4a</field>
3956 <field name="parent_id" ref="btw_code_vanuit_buitenland"/>3956 <field name="parent_id" ref="btw_code_vanuit_buitenland"/>
3957 <field name="name">Leveringen uit landen buiten de EU (invoer) (BTW)</field>3957 <field name="name">Leveringen uit landen buiten de EU (invoer) (BTW)</field>
3958 <field name="sign" eval="-1" />
3958 </record>3959 </record>
3959 <record id="btw_code_4b" model="account.tax.code.template">3960 <record id="btw_code_4b" model="account.tax.code.template">
3960 <field name="code">4b</field>3961 <field name="code">4b</field>
3961 <field name="parent_id" ref="btw_code_vanuit_buitenland"/>3962 <field name="parent_id" ref="btw_code_vanuit_buitenland"/>
3962 <field name="name">Verwerving van goederen uit landen binnen de EU (BTW)</field>3963 <field name="name">Verwerving van goederen uit landen binnen de EU (BTW)</field>
3964 <field name="sign" eval="-1" />
3963 </record>3965 </record>
3964<!-- 5. Voorbelasting, kleineondernemersregeling, schatting en eindtotaal -->3966<!-- 5. Voorbelasting, kleineondernemersregeling, schatting en eindtotaal -->
3965 <record id="btw_code_voorbelasting" model="account.tax.code.template">3967 <record id="btw_code_voorbelasting" model="account.tax.code.template">
@@ -4019,7 +4021,7 @@
4019 <record id="omz_code_1a" model="account.tax.code.template">4021 <record id="omz_code_1a" model="account.tax.code.template">
4020 <field name="code">1a</field>4022 <field name="code">1a</field>
4021 <field name="parent_id" ref="omz_code_binnenland"/>4023 <field name="parent_id" ref="omz_code_binnenland"/>
4022 <field name="name">Leveringen/diensten belast met 19% (omzet)</field>4024 <field name="name">Leveringen/diensten belast met 21% (omzet)</field>
4023 </record>4025 </record>
4024 <record id="omz_code_1b" model="account.tax.code.template">4026 <record id="omz_code_1b" model="account.tax.code.template">
4025 <field name="code">1b</field>4027 <field name="code">1b</field>
@@ -4100,6 +4102,7 @@
4100 <field name="property_account_payable" ref="a_pay"/> <!-- crediteuren -->4102 <field name="property_account_payable" ref="a_pay"/> <!-- crediteuren -->
4101 <field name="property_account_expense_categ" ref="a_expense"/><!-- aankoop grondstoffen -->4103 <field name="property_account_expense_categ" ref="a_expense"/><!-- aankoop grondstoffen -->
4102 <field name="property_account_income_categ" ref="a_sale"/> <!-- verkoop rekening -->4104 <field name="property_account_income_categ" ref="a_sale"/> <!-- verkoop rekening -->
4105 <field name="property_reserve_and_surplus_account" ref="a_9999"/>
4103 </record>4106 </record>
41044107
4105<!-- BTW Template4108<!-- BTW Template
@@ -4130,436 +4133,541 @@
4130<!-- Binnen Nederland -->4133<!-- Binnen Nederland -->
4131<!-- Verkoop BTW -->4134<!-- Verkoop BTW -->
4132 <record id="btw_0" model="account.tax.template">4135 <record id="btw_0" model="account.tax.template">
4136 <field name="sequence">10</field>
4133 <field name="chart_template_id" ref="l10nnl_chart_template"/>4137 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4134 <field name="name">Verkopen/omzet onbelast (nul-tarief)</field>4138 <field name="name">Verkopen/omzet onbelast (nul-tarief)</field>
4135 <field name="description">0% BTW</field>4139 <field name="description">0% BTW</field>
4136 <field eval="0.00" name="amount"/>4140 <field eval="0.00" name="amount"/>
4137 <field name="type">percent</field>4141 <field name="type">percent</field>
4138 <field name="account_collected_id" ref="vat_payable0"/>4142 <field name="account_collected_id" ref="vat_payable0"/>
4139 <field name="account_paid_id" ref="vat_refund0"/>4143 <field name="account_paid_id" ref="vat_payable0"/>
4140 <field name="base_code_id" ref="omz_code_1e"/>4144 <field name="base_code_id" ref="omz_code_1e"/>
4141 <field name="ref_base_code_id" ref="omz_code_1e"/>4145 <field name="ref_base_code_id" ref="omz_code_1e"/>
4146 <field name="ref_base_sign" eval="-1"/>
4147 <field name="ref_tax_sign" eval="-1"/>
4142 <field name="type_tax_use">sale</field>4148 <field name="type_tax_use">sale</field>
4143 </record>4149 </record>
4144 <record id="btw_6" model="account.tax.template">4150 <record id="btw_6" model="account.tax.template">
4151 <field name="sequence">10</field>
4145 <field name="chart_template_id" ref="l10nnl_chart_template"/>4152 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4146 <field name="name">Verkopen/omzet laag</field>4153 <field name="name">Verkopen/omzet laag</field>
4147 <field name="description">6% BTW</field>4154 <field name="description">6% BTW</field>
4148 <field eval="0.06" name="amount"/>4155 <field eval="0.06" name="amount"/>
4149 <field name="type">percent</field>4156 <field name="type">percent</field>
4150 <field name="account_collected_id" ref="vat_payable6"/>4157 <field name="account_collected_id" ref="vat_payable_low"/>
4151 <field name="account_paid_id" ref="vat_refund6"/>4158 <field name="account_paid_id" ref="vat_payable_low"/>
4152 <field name="base_code_id" ref="omz_code_1b"/>4159 <field name="base_code_id" ref="omz_code_1b"/>
4153 <field name="tax_code_id" ref="btw_code_1b"/>4160 <field name="tax_code_id" ref="btw_code_1b"/>
4154 <field name="ref_base_code_id" ref="omz_code_1b"/>4161 <field name="ref_base_code_id" ref="omz_code_1b"/>
4155 <field name="ref_tax_code_id" ref="btw_code_1b"/>4162 <field name="ref_tax_code_id" ref="btw_code_1b"/>
4163 <field name="ref_base_sign" eval="-1"/>
4164 <field name="ref_tax_sign" eval="-1"/>
4156 <field name="type_tax_use">sale</field>4165 <field name="type_tax_use">sale</field>
4157 </record>4166 </record>
4158 <record id="btw_19" model="account.tax.template">4167 <record id="btw_21" model="account.tax.template">
4168 <field name="sequence">5</field>
4159 <field name="chart_template_id" ref="l10nnl_chart_template"/>4169 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4160 <field name="name">Verkopen/omzet hoog</field>4170 <field name="name">Verkopen/omzet hoog</field>
4161 <field name="description">19% BTW</field>4171 <field name="description">21% BTW</field>
4162 <field eval="0.19" name="amount"/>4172 <field eval="0.21" name="amount"/>
4163 <field name="type">percent</field>4173 <field name="type">percent</field>
4164 <field name="account_collected_id" ref="vat_payable19"/>4174 <field name="account_collected_id" ref="vat_payable_high"/>
4165 <field name="account_paid_id" ref="vat_refund19"/>4175 <field name="account_paid_id" ref="vat_payable_high"/>
4166 <field name="base_code_id" ref="omz_code_1a"/>4176 <field name="base_code_id" ref="omz_code_1a"/>
4167 <field name="tax_code_id" ref="btw_code_1a"/>4177 <field name="tax_code_id" ref="btw_code_1a"/>
4168 <field name="ref_base_code_id" ref="omz_code_1a"/>4178 <field name="ref_base_code_id" ref="omz_code_1a"/>
4169 <field name="ref_tax_code_id" ref="btw_code_1a"/>4179 <field name="ref_tax_code_id" ref="btw_code_1a"/>
4180 <field name="ref_base_sign" eval="-1"/>
4181 <field name="ref_tax_sign" eval="-1"/>
4170 <field name="type_tax_use">sale</field>4182 <field name="type_tax_use">sale</field>
4171 </record>4183 </record>
4172<!-- TODO - nakijken btw overig op percentage-->4184<!-- TODO - nakijken btw overig op percentage-->
4173 <record id="btw_overig" model="account.tax.template">4185 <record id="btw_overig" model="account.tax.template">
4186 <field name="sequence">15</field>
4174 <field name="chart_template_id" ref="l10nnl_chart_template"/>4187 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4175 <field name="name">Verkopen/omzet overig</field>4188 <field name="name">Verkopen/omzet overig</field>
4176 <field name="description">variabel BTW</field>4189 <field name="description">variabel BTW</field>
4177 <field eval="0.19" name="amount"/>4190 <field eval="0.21" name="amount"/>
4178 <field name="type">percent</field>4191 <field name="type">percent</field>
4179 <field name="account_collected_id" ref="vat_payable19"/>4192 <field name="account_collected_id" ref="vat_payable_high"/>
4180 <field name="account_paid_id" ref="vat_refund19"/>4193 <field name="account_paid_id" ref="vat_payable_high"/>
4181 <field name="base_code_id" ref="omz_code_1a"/>4194 <field name="base_code_id" ref="omz_code_1a"/>
4182 <field name="tax_code_id" ref="btw_code_1a"/>4195 <field name="tax_code_id" ref="btw_code_1a"/>
4183 <field name="ref_base_code_id" ref="omz_code_1c"/>4196 <field name="ref_base_code_id" ref="omz_code_1c"/>
4184 <field name="ref_tax_code_id" ref="btw_code_1c"/>4197 <field name="ref_tax_code_id" ref="btw_code_1c"/>
4198 <field name="ref_base_sign" eval="-1"/>
4199 <field name="ref_tax_sign" eval="-1"/>
4185 <field name="type_tax_use">sale</field>4200 <field name="type_tax_use">sale</field>
4186 </record>4201 </record>
41874202
4188<!--Inkoop BTW -->4203<!--Inkoop BTW -->
4189 <record id="btw_6_buy" model="account.tax.template">4204 <record id="btw_6_buy" model="account.tax.template">
4205 <field name="sequence">10</field>
4190 <field name="chart_template_id" ref="l10nnl_chart_template"/>4206 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4191 <field name="name">BTW te vorderen laag (inkopen)</field>4207 <field name="name">BTW te vorderen laag (inkopen)</field>
4192 <field name="description">6% BTW</field>4208 <field name="description">6% BTW</field>
4193 <field eval="0.06" name="amount"/>4209 <field eval="0.06" name="amount"/>
4194 <field name="type">percent</field>4210 <field name="type">percent</field>
4195 <field name="account_collected_id" ref="vat_refund6"/>4211 <field name="account_collected_id" ref="vat_refund_low"/>
4196 <field name="account_paid_id" ref="vat_payable6"/>4212 <field name="account_paid_id" ref="vat_refund_low"/>
4197 <field name="tax_code_id" ref="btw_code_5b"/>4213 <field name="tax_code_id" ref="btw_code_5b"/>
4198 <field name="ref_tax_code_id" ref="btw_code_5b"/>4214 <field name="ref_tax_code_id" ref="btw_code_5b"/>
4215 <field name="ref_base_sign" eval="-1"/>
4216 <field name="ref_tax_sign" eval="-1"/>
4199 <field name="type_tax_use">purchase</field>4217 <field name="type_tax_use">purchase</field>
4200 </record>4218 </record>
4201 <record id="btw_19_buy" model="account.tax.template">4219 <record id="btw_21_buy" model="account.tax.template">
4220 <field name="sequence">5</field>
4202 <field name="chart_template_id" ref="l10nnl_chart_template"/>4221 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4203 <field name="name">BTW te vorderen hoog (inkopen)</field>4222 <field name="name">BTW te vorderen hoog (inkopen)</field>
4204 <field name="description">19% BTW</field>4223 <field name="description">21% BTW</field>
4205 <field eval="0.19" name="amount"/>4224 <field eval="0.21" name="amount"/>
4206 <field name="type">percent</field>4225 <field name="type">percent</field>
4207 <field name="account_collected_id" ref="vat_refund19"/>4226 <field name="account_collected_id" ref="vat_refund_high"/>
4208 <field name="account_paid_id" ref="vat_payable19"/>4227 <field name="account_paid_id" ref="vat_refund_high"/>
4209 <field name="tax_code_id" ref="btw_code_5b"/>4228 <field name="tax_code_id" ref="btw_code_5b"/>
4210 <field name="ref_tax_code_id" ref="btw_code_5b"/>4229 <field name="ref_tax_code_id" ref="btw_code_5b"/>
4230 <field name="ref_base_sign" eval="-1"/>
4231 <field name="ref_tax_sign" eval="-1"/>
4211 <field name="type_tax_use">purchase</field>4232 <field name="type_tax_use">purchase</field>
4212 </record>4233 </record>
4213 <record id="btw_overig_buy" model="account.tax.template">4234 <record id="btw_overig_buy" model="account.tax.template">
4235 <field name="sequence">15</field>
4214 <field name="chart_template_id" ref="l10nnl_chart_template"/>4236 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4215 <field name="name">BTW te vorderen overig (inkopen)</field>4237 <field name="name">BTW te vorderen overig (inkopen)</field>
4216 <field name="description">variabel BTW</field>4238 <field name="description">variabel BTW</field>
4217 <field eval="0.19" name="amount"/>4239 <field eval="0.21" name="amount"/>
4218 <field name="type">percent</field>4240 <field name="type">percent</field>
4219 <field name="account_collected_id" ref="vat_refund19"/>4241 <field name="account_collected_id" ref="vat_refund_high"/>
4220 <field name="account_paid_id" ref="vat_payable19"/>4242 <field name="account_paid_id" ref="vat_refund_high"/>
4221 <field name="tax_code_id" ref="btw_code_5b"/>4243 <field name="tax_code_id" ref="btw_code_5b"/>
4222 <field name="ref_tax_code_id" ref="btw_code_5b"/>4244 <field name="ref_tax_code_id" ref="btw_code_5b"/>
4245 <field name="ref_base_sign" eval="-1"/>
4246 <field name="ref_tax_sign" eval="-1"/>
4223 <field name="type_tax_use">purchase</field>4247 <field name="type_tax_use">purchase</field>
4224 </record>4248 </record>
4225<!--BTW verlegd-->4249<!--BTW verlegd-->
4226 <record id="btw_verk_0" model="account.tax.template">4250 <record id="btw_verk_0" model="account.tax.template">
4251 <field name="sequence">15</field>
4227 <field name="chart_template_id" ref="l10nnl_chart_template"/>4252 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4228 <field name="name">BTW af te dragen verlegd (verkopen)</field>4253 <field name="name">BTW af te dragen verlegd (verkopen)</field>
4229 <field name="description">0% BTW verlegd</field>4254 <field name="description">0% BTW verlegd</field>
4230 <field eval="0.00" name="amount"/>4255 <field eval="0.00" name="amount"/>
4231 <field name="type">percent</field>4256 <field name="type">percent</field>
4232 <field name="account_collected_id" ref="vat_payable_verlegd"/>4257 <field name="account_collected_id" ref="vat_payable_verlegd"/>
4233 <field name="account_paid_id" ref="vat_refund_verlegd"/>4258 <field name="account_paid_id" ref="vat_payable_verlegd"/>
4234 <field eval="omz_code_1e" name="base_code_id"/>4259 <field eval="omz_code_1e" name="base_code_id"/>
4235 <field eval="omz_code_1e" name="ref_base_code_id"/>4260 <field eval="omz_code_1e" name="ref_base_code_id"/>
4261 <field name="ref_base_sign" eval="-1"/>
4262 <field name="ref_tax_sign" eval="-1"/>
4236 <field name="type_tax_use">purchase</field>4263 <field name="type_tax_use">purchase</field>
4237 </record>4264 </record>
4238 <record id="btw_ink_0" model="account.tax.template">4265 <record id="btw_ink_0" model="account.tax.template">
4266 <field name="sequence">15</field>
4239 <field name="chart_template_id" ref="l10nnl_chart_template"/>4267 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4240 <field name="name">BTW af te dragen verlegd (inkopen)</field>4268 <field name="name">BTW af te dragen verlegd (inkopen)</field>
4241 <field name="description">19% BTW verlegd</field>4269 <field name="description">21% BTW verlegd</field>
4242 <field eval="0.19" name="amount"/>4270 <field eval="0.21" name="amount"/>
4243 <field name="type">percent</field>4271 <field name="type">percent</field>
4244 <field name="account_collected_id" ref="vat_payable_verlegd"/>4272 <field name="account_collected_id" ref="vat_payable_verlegd"/>
4245 <field name="account_paid_id" ref="vat_refund_verlegd"/>4273 <field name="account_paid_id" ref="vat_payable_verlegd"/>
4246 <field eval="omz_code_2a" name="base_code_id"/>4274 <field eval="omz_code_2a" name="base_code_id"/>
4247 <field eval="omz_code_2a" name="ref_base_code_id"/>4275 <field eval="omz_code_2a" name="ref_base_code_id"/>
4276 <field name="ref_base_sign" eval="-1"/>
4277 <field name="ref_tax_sign" eval="-1"/>
4248 <field name="type_tax_use">purchase</field>4278 <field name="type_tax_use">purchase</field>
4249 <field eval="True" name="child_depend"/>4279 <field eval="True" name="child_depend"/>
4250 </record>4280 </record>
4251 <record id="btw_ink_0_1" model="account.tax.template">4281 <record id="btw_ink_0_1" model="account.tax.template">
4252 <field name="chart_template_id" ref="l10nnl_chart_template"/>4282 <field name="sequence">99</field>
4253 <field name="name">BTW af te dragen verlegd (inkopen1)</field>4283 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4254 <field eval="1.00" name="amount"/>4284 <field name="name">BTW af te dragen verlegd (inkopen1)</field>
4255 <field name="type">percent</field>4285 <field eval="1.00" name="amount"/>
4256 <field eval="btw_ink_0" name="parent_id"/>4286 <field name="type">percent</field>
4257 <field name="account_collected_id" ref="vat_payable_verlegd"/>4287 <field eval="btw_ink_0" name="parent_id"/>
4258 <field name="account_paid_id" ref="vat_refund_verlegd"/>4288 <field name="account_collected_id" ref="vat_payable_verlegd"/>
4259 <field eval="btw_code_2a" name="tax_code_id"/>4289 <field name="account_paid_id" ref="vat_payable_verlegd"/>
4260 <field eval="btw_code_2a" name="ref_tax_code_id"/>4290 <field eval="btw_code_2a" name="tax_code_id"/>
4261 <field name="type_tax_use">purchase</field>4291 <field eval="btw_code_2a" name="ref_tax_code_id"/>
4262 </record>4292 <field name="ref_base_sign" eval="-1"/>
4263 <record id="btw_ink_0_2" model="account.tax.template">4293 <field name="ref_tax_sign" eval="-1"/>
4264 <field name="chart_template_id" ref="l10nnl_chart_template"/>4294 <field name="type_tax_use">purchase</field>
4265 <field name="name">BTW af te dragen verlegd (inkopen2)</field>4295 </record>
4266 <field eval="-1.00" name="amount"/>4296 <record id="btw_ink_0_2" model="account.tax.template">
4267 <field name="type">percent</field>4297 <field name="sequence">99</field>
4268 <field eval="btw_ink_0" name="parent_id"/>4298 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4269 <field name="account_collected_id" ref="vat_payable_verlegd"/>4299 <field name="name">BTW af te dragen verlegd (inkopen2)</field>
4270 <field name="account_paid_id" ref="vat_refund_verlegd"/>4300 <field eval="-1.00" name="amount"/>
4271 <field eval="btw_code_5b" name="tax_code_id"/>4301 <field name="type">percent</field>
4272 <field eval="btw_code_5b" name="ref_tax_code_id"/>4302 <field eval="btw_ink_0" name="parent_id"/>
4273 <field name="type_tax_use">purchase</field>4303 <field name="account_collected_id" ref="vat_payable_verlegd"/>
4274 </record>4304 <field name="account_paid_id" ref="vat_payable_verlegd"/>
4305 <field eval="btw_code_5b" name="tax_code_id"/>
4306 <field eval="btw_code_5b" name="ref_tax_code_id"/>
4307 <field name="ref_base_sign" eval="-1"/>
4308 <field name="ref_tax_sign" eval="-1"/>
4309 <field name="type_tax_use">purchase</field>
4310 </record>
4275 <record id="btw_ink2_0" model="account.tax.template">4311 <record id="btw_ink2_0" model="account.tax.template">
4312 <field name="sequence">15</field>
4276 <field name="chart_template_id" ref="l10nnl_chart_template"/>4313 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4277 <field name="name">BTW te vorderen verlegd (inkopen)</field>4314 <field name="name">BTW te vorderen verlegd (inkopen)</field>
4278 <field name="description">19% BTW verlegd</field>4315 <field name="description">21% BTW verlegd</field>
4279 <field eval="0.19" name="amount"/>4316 <field eval="0.21" name="amount"/>
4280 <field name="type">percent</field>4317 <field name="type">percent</field>
4281 <field name="account_collected_id" ref="vat_refund_verlegd"/>4318 <field name="account_collected_id" ref="vat_refund_verlegd"/>
4282 <field name="account_paid_id" ref="vat_payable_verlegd"/>4319 <field name="account_paid_id" ref="vat_refund_verlegd"/>
4283 <field eval="omz_code_2a" name="base_code_id"/>4320 <field eval="omz_code_2a" name="base_code_id"/>
4284 <field eval="omz_code_2a" name="ref_base_code_id"/>4321 <field eval="omz_code_2a" name="ref_base_code_id"/>
4322 <field name="ref_base_sign" eval="-1"/>
4323 <field name="ref_tax_sign" eval="-1"/>
4285 <field name="type_tax_use">purchase</field>4324 <field name="type_tax_use">purchase</field>
4286 <field eval="True" name="child_depend"/>4325 <field eval="True" name="child_depend"/>
4287 </record>4326 </record>
4288 <record id="btw_ink2_0_1" model="account.tax.template">4327 <record id="btw_ink2_0_1" model="account.tax.template">
4289 <field name="chart_template_id" ref="l10nnl_chart_template"/>4328 <field name="sequence">99</field>
4290 <field name="name">BTW te vorderen verlegd (inkopen1)</field>4329 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4291 <field eval="1.00" name="amount"/>4330 <field name="name">BTW te vorderen verlegd (inkopen1)</field>
4292 <field name="type">percent</field>4331 <field eval="1.00" name="amount"/>
4293 <field eval="btw_ink2_0" name="parent_id"/>4332 <field name="type">percent</field>
4294 <field name="account_collected_id" ref="vat_refund_verlegd"/>4333 <field eval="btw_ink2_0" name="parent_id"/>
4295 <field name="account_paid_id" ref="vat_payable_verlegd"/>4334 <field name="account_collected_id" ref="vat_refund_verlegd"/>
4296 <field eval="btw_code_2a" name="tax_code_id"/>4335 <field name="account_paid_id" ref="vat_refund_verlegd"/>
4297 <field eval="btw_code_2a" name="ref_tax_code_id"/>4336 <field eval="btw_code_2a" name="tax_code_id"/>
4298 <field name="type_tax_use">purchase</field>4337 <field eval="btw_code_2a" name="ref_tax_code_id"/>
4299 </record>4338 <field name="ref_base_sign" eval="-1"/>
4300 <record id="btw_ink2_0_2" model="account.tax.template">4339 <field name="ref_tax_sign" eval="-1"/>
4301 <field name="chart_template_id" ref="l10nnl_chart_template"/>4340 <field name="type_tax_use">purchase</field>
4302 <field name="name">BTW te vorderen verlegd (inkopen2)</field>4341 </record>
4303 <field eval="-1.00" name="amount"/>4342 <record id="btw_ink2_0_2" model="account.tax.template">
4304 <field name="type">percent</field>4343 <field name="sequence">99</field>
4305 <field eval="btw_ink2_0" name="parent_id"/>4344 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4306 <field name="account_collected_id" ref="vat_refund_verlegd"/>4345 <field name="name">BTW te vorderen verlegd (inkopen2)</field>
4307 <field name="account_paid_id" ref="vat_payable_verlegd"/>4346 <field eval="-1.00" name="amount"/>
4308 <field eval="btw_code_5b" name="tax_code_id"/>4347 <field name="type">percent</field>
4309 <field eval="btw_code_5b" name="ref_tax_code_id"/>4348 <field eval="btw_ink2_0" name="parent_id"/>
4310 <field name="type_tax_use">purchase</field>4349 <field name="account_collected_id" ref="vat_refund_verlegd"/>
4311 </record>4350 <field name="account_paid_id" ref="vat_refund_verlegd"/>
4351 <field eval="btw_code_5b" name="tax_code_id"/>
4352 <field eval="btw_code_5b" name="ref_tax_code_id"/>
4353 <field name="ref_base_sign" eval="-1"/>
4354 <field name="ref_tax_sign" eval="-1"/>
4355 <field name="type_tax_use">purchase</field>
4356 </record>
4312<!-- Binnen de EU -->4357<!-- Binnen de EU -->
4313<!-- BTW inkoop -->4358<!-- BTW inkoop -->
4314 <record id="btw_I_6" model="account.tax.template">4359 <record id="btw_I_6" model="account.tax.template">
4360 <field name="sequence">20</field>
4315 <field name="chart_template_id" ref="l10nnl_chart_template"/>4361 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4316 <field name="name">Inkopen import binnen EU laag</field>4362 <field name="name">Inkopen import binnen EU laag</field>
4317 <field name="description">6% BTW import binnen EU</field>4363 <field name="description">6% BTW import binnen EU</field>
4318 <field eval="0.06" name="amount"/>4364 <field eval="0.06" name="amount"/>
4319 <field name="type">percent</field>4365 <field name="type">percent</field>
4320 <field eval="True" name="child_depend"/>4366 <field eval="True" name="child_depend"/>
4321 <field eval="omz_code_4b" name="base_code_id"/>4367 <field eval="omz_code_4b" name="base_code_id"/>
4322 <field eval="omz_code_4b" name="ref_base_code_id"/>4368 <field eval="omz_code_4b" name="ref_base_code_id"/>
4369 <field name="ref_base_sign" eval="-1"/>
4370 <field name="ref_tax_sign" eval="-1"/>
4323 <field name="type_tax_use">purchase</field>4371 <field name="type_tax_use">purchase</field>
4324 </record>4372 </record>
4325 <record id="btw_I_6_1" model="account.tax.template">4373 <record id="btw_I_6_1" model="account.tax.template">
4326 <field name="chart_template_id" ref="l10nnl_chart_template"/>4374 <field name="sequence">99</field>
4327 <field name="name">Inkopen import binnen EU laag(1)</field>4375 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4328 <field eval="1.00" name="amount"/>4376 <field name="name">Inkopen import binnen EU laag(1)</field>
4329 <field name="type">percent</field>4377 <field eval="-1.00" name="amount"/>
4330 <field name="parent_id" ref="btw_I_6"/>4378 <field name="type">percent</field>
4331 <field name="account_collected_id" ref="vat_payable6"/>4379 <field name="parent_id" ref="btw_I_6"/>
4332 <field name="account_paid_id" ref="vat_payable6"/>4380 <field name="account_collected_id" ref="vat_payable_low"/>
4333 <field eval="btw_code_4b" name="tax_code_id"/>4381 <field name="account_paid_id" ref="vat_payable_low"/>
4334 <field eval="btw_code_4b" name="ref_tax_code_id"/>4382 <field eval="btw_code_4b" name="tax_code_id"/>
4335 <field name="type_tax_use">purchase</field>4383 <field eval="btw_code_4b" name="ref_tax_code_id"/>
4336 </record>4384 <field name="ref_base_sign" eval="-1"/>
4337 <record id="btw_I_6_2" model="account.tax.template">4385 <field name="ref_tax_sign" eval="-1"/>
4338 <field name="chart_template_id" ref="l10nnl_chart_template"/>4386 <field name="type_tax_use">purchase</field>
4339 <field name="name">Inkopen import binnen EU laag(2)</field>4387 </record>
4340 <field eval="-1.00" name="amount"/>4388 <record id="btw_I_6_2" model="account.tax.template">
4341 <field name="type">percent</field>4389 <field name="sequence">99</field>
4342 <field name="parent_id" ref="btw_I_6"/>4390 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4343 <field name="account_collected_id" ref="vat_refund6"/>4391 <field name="name">Inkopen import binnen EU laag(2)</field>
4344 <field name="account_paid_id" ref="vat_refund6"/>4392 <field eval="1.00" name="amount"/>
4345 <field eval="btw_code_5b" name="tax_code_id"/>4393 <field name="type">percent</field>
4346 <field eval="btw_code_5b" name="ref_tax_code_id"/>4394 <field name="parent_id" ref="btw_I_6"/>
4347 <field name="type_tax_use">purchase</field>4395 <field name="account_collected_id" ref="vat_refund_low"/>
4348 </record>4396 <field name="account_paid_id" ref="vat_refund_low"/>
4349 <record id="btw_I_19" model="account.tax.template">4397 <field eval="btw_code_5b" name="tax_code_id"/>
4398 <field eval="btw_code_5b" name="ref_tax_code_id"/>
4399 <field name="ref_base_sign" eval="-1"/>
4400 <field name="ref_tax_sign" eval="-1"/>
4401 <field name="type_tax_use">purchase</field>
4402 </record>
4403 <record id="btw_I_21" model="account.tax.template">
4404 <field name="sequence">20</field>
4350 <field name="chart_template_id" ref="l10nnl_chart_template"/>4405 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4351 <field name="name">Inkopen import binnen EU hoog</field>4406 <field name="name">Inkopen import binnen EU hoog</field>
4352 <field name="description">19% BTW import binnen EU</field>4407 <field name="description">21% BTW import binnen EU</field>
4353 <field eval="0.19" name="amount"/>4408 <field eval="0.21" name="amount"/>
4354 <field name="type">percent</field>4409 <field name="type">percent</field>
4355 <field eval="True" name="child_depend"/>4410 <field eval="True" name="child_depend"/>
4356 <field eval="omz_code_4b" name="base_code_id"/>4411 <field eval="omz_code_4b" name="base_code_id"/>
4357 <field eval="omz_code_4b" name="ref_base_code_id"/>4412 <field eval="omz_code_4b" name="ref_base_code_id"/>
4413 <field name="ref_base_sign" eval="-1"/>
4414 <field name="ref_tax_sign" eval="-1"/>
4358 <field name="type_tax_use">purchase</field>4415 <field name="type_tax_use">purchase</field>
4359 </record>4416 </record>
4360 <record id="btw_I_19_1" model="account.tax.template">4417 <record id="btw_I_21_1" model="account.tax.template">
4361 <field name="chart_template_id" ref="l10nnl_chart_template"/>4418 <field name="sequence">99</field>
4362 <field name="name">Inkopen import binnen EU hoog(1)</field>4419 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4363 <field eval="1.00" name="amount"/>4420 <field name="name">Inkopen import binnen EU hoog(1)</field>
4364 <field name="type">percent</field>4421 <field eval="-1.00" name="amount"/>
4365 <field name="parent_id" ref="btw_I_19"/>4422 <field name="type">percent</field>
4366 <field name="account_collected_id" ref="vat_payable19"/>4423 <field name="parent_id" ref="btw_I_21"/>
4367 <field name="account_paid_id" ref="vat_payable19"/>4424 <field name="account_collected_id" ref="vat_payable_high"/>
4368 <field eval="btw_code_4b" name="tax_code_id"/>4425 <field name="account_paid_id" ref="vat_payable_high"/>
4369 <field eval="btw_code_4b" name="ref_tax_code_id"/>4426 <field eval="btw_code_4b" name="tax_code_id"/>
4370 <field name="type_tax_use">purchase</field>4427 <field eval="btw_code_4b" name="ref_tax_code_id"/>
4371 </record>4428 <field name="ref_base_sign" eval="-1"/>
4372 <record id="btw_I_19_2" model="account.tax.template">4429 <field name="ref_tax_sign" eval="-1"/>
4373 <field name="chart_template_id" ref="l10nnl_chart_template"/>4430 <field name="type_tax_use">purchase</field>
4374 <field name="name">Inkopen import binnen EU hoog(2)</field>4431 </record>
4375 <field eval="-1.00" name="amount"/>4432 <record id="btw_I_21_2" model="account.tax.template">
4376 <field name="type">percent</field>4433 <field name="sequence">99</field>
4377 <field name="parent_id" ref="btw_I_19"/>4434 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4378 <field name="account_collected_id" ref="vat_refund19"/>4435 <field name="name">Inkopen import binnen EU hoog(2)</field>
4379 <field name="account_paid_id" ref="vat_refund19"/>4436 <field eval="1.00" name="amount"/>
4380 <field eval="btw_code_5b" name="tax_code_id"/>4437 <field name="type">percent</field>
4381 <field eval="btw_code_5b" name="ref_tax_code_id"/>4438 <field name="parent_id" ref="btw_I_21"/>
4382 <field name="type_tax_use">purchase</field>4439 <field name="account_collected_id" ref="vat_refund_high"/>
4383 </record>4440 <field name="account_paid_id" ref="vat_refund_high"/>
4441 <field eval="btw_code_5b" name="tax_code_id"/>
4442 <field eval="btw_code_5b" name="ref_tax_code_id"/>
4443 <field name="ref_base_sign" eval="-1"/>
4444 <field name="ref_tax_sign" eval="-1"/>
4445 <field name="type_tax_use">purchase</field>
4446 </record>
4384 <record id="btw_I_overig" model="account.tax.template">4447 <record id="btw_I_overig" model="account.tax.template">
4448 <field name="sequence">20</field>
4385 <field name="chart_template_id" ref="l10nnl_chart_template"/>4449 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4386 <field name="name">Inkopen import binnen EU overig</field>4450 <field name="name">Inkopen import binnen EU overig</field>
4387 <field name="description">0% BTW import binnen EU</field>4451 <field name="description">0% BTW import binnen EU</field>
4388 <field eval="0.00" name="amount"/>4452 <field eval="0.00" name="amount"/>
4389 <field name="type">percent</field>4453 <field name="type">percent</field>
4390 <field eval="True" name="child_depend"/>4454 <field eval="True" name="child_depend"/>
4391 <field eval="omz_code_4b" name="base_code_id"/>4455 <field eval="omz_code_4b" name="base_code_id"/>
4392 <field eval="omz_code_4b" name="ref_base_code_id"/>4456 <field eval="omz_code_4b" name="ref_base_code_id"/>
4457 <field name="ref_base_sign" eval="-1"/>
4458 <field name="ref_tax_sign" eval="-1"/>
4393 <field name="type_tax_use">purchase</field>4459 <field name="type_tax_use">purchase</field>
4394 </record>4460 </record>
4395 <record id="btw_I_overig_1" model="account.tax.template">4461 <record id="btw_I_overig_1" model="account.tax.template">
4396 <field name="chart_template_id" ref="l10nnl_chart_template"/>4462 <field name="sequence">99</field>
4397 <field name="name">Inkopen import binnen EU overig(1)</field>4463 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4398 <field eval="1.00" name="amount"/>4464 <field name="name">Inkopen import binnen EU overig(1)</field>
4399 <field name="type">percent</field>4465 <field eval="-1.00" name="amount"/>
4400 <field name="parent_id" ref="btw_I_overig"/>4466 <field name="type">percent</field>
4401 <field name="account_collected_id" ref="vat_payable19"/>4467 <field name="parent_id" ref="btw_I_overig"/>
4402 <field name="account_paid_id" ref="vat_payable19"/>4468 <field name="account_collected_id" ref="vat_payable_high"/>
4403 <field eval="btw_code_4b" name="tax_code_id"/>4469 <field name="account_paid_id" ref="vat_payable_high"/>
4404 <field eval="btw_code_4b" name="ref_tax_code_id"/>4470 <field eval="btw_code_4b" name="tax_code_id"/>
4405 <field name="type_tax_use">purchase</field>4471 <field eval="btw_code_4b" name="ref_tax_code_id"/>
4406 </record>4472 <field name="ref_base_sign" eval="-1"/>
4407 <record id="btw_I_overig_2" model="account.tax.template">4473 <field name="ref_tax_sign" eval="-1"/>
4408 <field name="chart_template_id" ref="l10nnl_chart_template"/>4474 <field name="type_tax_use">purchase</field>
4409 <field name="name">Inkopen import binnen EU overig(2)</field>4475 </record>
4410 <field eval="-1.00" name="amount"/>4476 <record id="btw_I_overig_2" model="account.tax.template">
4411 <field name="type">percent</field>4477 <field name="sequence">99</field>
4412 <field name="parent_id" ref="btw_I_overig"/>4478 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4413 <field name="account_collected_id" ref="vat_refund19"/>4479 <field name="name">Inkopen import binnen EU overig(2)</field>
4414 <field name="account_paid_id" ref="vat_refund19"/>4480 <field eval="1.00" name="amount"/>
4415 <field eval="btw_code_5b" name="tax_code_id"/>4481 <field name="type">percent</field>
4416 <field eval="btw_code_5b" name="ref_tax_code_id"/>4482 <field name="parent_id" ref="btw_I_overig"/>
4417 <field name="type_tax_use">purchase</field>4483 <field name="account_collected_id" ref="vat_refund_high"/>
4418 </record>4484 <field name="account_paid_id" ref="vat_refund_high"/>
4419<!-- BTW verkoop --> 4485 <field eval="btw_code_5b" name="tax_code_id"/>
4486 <field eval="btw_code_5b" name="ref_tax_code_id"/>
4487 <field name="ref_base_sign" eval="-1"/>
4488 <field name="ref_tax_sign" eval="-1"/>
4489 <field name="type_tax_use">purchase</field>
4490 </record>
4491<!-- BTW verkoop -->
4420 <record id="btw_X0" model="account.tax.template">4492 <record id="btw_X0" model="account.tax.template">
4493 <field name="sequence">20</field>
4421 <field name="chart_template_id" ref="l10nnl_chart_template"/>4494 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4422 <field name="name">Verkopen export binnen EU</field>4495 <field name="name">Verkopen export binnen EU</field>
4423 <field name="description">BTW export binnen EU</field>4496 <field name="description">BTW export binnen EU</field>
4424 <field eval="0.00" name="amount"/>4497 <field eval="0.00" name="amount"/>
4425 <field name="type">percent</field>4498 <field name="type">percent</field>
4426 <field name="account_collected_id" ref="vat_payable0"/>4499 <field name="account_collected_id" ref="vat_payable0"/>
4427 <field name="account_paid_id" ref="vat_refund0"/>4500 <field name="account_paid_id" ref="vat_payable0"/>
4428 <field name="base_code_id" ref="omz_code_3b"/>4501 <field name="base_code_id" ref="omz_code_3b"/>
4429 <field name="ref_base_code_id" ref="omz_code_3b"/>4502 <field name="ref_base_code_id" ref="omz_code_3b"/>
4503 <field name="ref_base_sign" eval="-1"/>
4504 <field name="ref_tax_sign" eval="-1"/>
4430 <field name="type_tax_use">sale</field>4505 <field name="type_tax_use">sale</field>
4431 </record>4506 </record>
4432 <record id="btw_X2" model="account.tax.template">4507 <record id="btw_X2" model="account.tax.template">
4508 <field name="sequence">20</field>
4433 <field name="chart_template_id" ref="l10nnl_chart_template"/>4509 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4434 <field name="name">Installatie/afstandsverkopen binnen EU</field>4510 <field name="name">Installatie/afstandsverkopen binnen EU</field>
4435 <field name="description">Inst./afst.verkopen binnen EU</field>4511 <field name="description">Inst./afst.verkopen binnen EU</field>
4436 <field eval="0.00" name="amount"/>4512 <field eval="0.00" name="amount"/>
4437 <field name="type">percent</field>4513 <field name="type">percent</field>
4438 <field name="account_collected_id" ref="vat_payable0"/>4514 <field name="account_collected_id" ref="vat_payable0"/>
4439 <field name="account_paid_id" ref="vat_refund0"/>4515 <field name="account_paid_id" ref="vat_payable0"/>
4440 <field name="base_code_id" ref="omz_code_3c"/>4516 <field name="base_code_id" ref="omz_code_3c"/>
4441 <field name="ref_base_code_id" ref="omz_code_3c"/>4517 <field name="ref_base_code_id" ref="omz_code_3c"/>
4518 <field name="ref_base_sign" eval="-1"/>
4519 <field name="ref_tax_sign" eval="-1"/>
4442 <field name="type_tax_use">sale</field>4520 <field name="type_tax_use">sale</field>
4443 </record>4521 </record>
44444522
4445<!-- Buiten de EU -->4523<!-- Buiten de EU -->
4446<!-- BTW inkoop -->4524<!-- BTW inkoop -->
4447 <record id="btw_E1" model="account.tax.template">4525 <record id="btw_E1" model="account.tax.template">
4526 <field name="sequence">20</field>
4448 <field name="chart_template_id" ref="l10nnl_chart_template"/>4527 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4449 <field name="name">Inkopen import buiten EU laag</field>4528 <field name="name">Inkopen import buiten EU laag</field>
4450 <field name="description">BTW import buiten EU</field>4529 <field name="description">BTW import buiten EU</field>
4451 <field eval="0.06" name="amount"/>4530 <field eval="0.06" name="amount"/>
4452 <field name="type">percent</field>4531 <field name="type">percent</field>
4453 <field eval="True" name="child_depend"/>4532 <field eval="True" name="child_depend"/>
4454 <field eval="omz_code_4a" name="base_code_id"/>4533 <field eval="omz_code_4a" name="base_code_id"/>
4455 <field eval="omz_code_4a" name="ref_base_code_id"/>4534 <field eval="omz_code_4a" name="ref_base_code_id"/>
4535 <field name="ref_base_sign" eval="-1"/>
4536 <field name="ref_tax_sign" eval="-1"/>
4456 <field name="type_tax_use">purchase</field>4537 <field name="type_tax_use">purchase</field>
4457 </record>4538 </record>
4458 <record id="btw_E1_1" model="account.tax.template">4539 <record id="btw_E1_1" model="account.tax.template">
4459 <field name="chart_template_id" ref="l10nnl_chart_template"/>4540 <field name="sequence">99</field>
4460 <field name="name">Inkopen import buiten EU laag(1)</field>4541 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4461 <field eval="1.00" name="amount"/>4542 <field name="name">Inkopen import buiten EU laag(1)</field>
4462 <field name="type">percent</field>4543 <field eval="-1.00" name="amount"/>
4463 <field name="parent_id" ref="btw_E1"/>4544 <field name="type">percent</field>
4464 <field name="account_collected_id" ref="vat_payable6"/>4545 <field name="parent_id" ref="btw_E1"/>
4465 <field name="account_paid_id" ref="vat_payable6"/>4546 <field name="account_collected_id" ref="vat_payable_low"/>
4466 <field eval="btw_code_4a" name="tax_code_id"/>4547 <field name="account_paid_id" ref="vat_payable_low"/>
4467 <field eval="btw_code_4a" name="ref_tax_code_id"/>4548 <field eval="btw_code_4a" name="tax_code_id"/>
4468 <field name="type_tax_use">purchase</field>4549 <field eval="btw_code_4a" name="ref_tax_code_id"/>
4469 </record>4550 <field name="ref_base_sign" eval="-1"/>
4470 <record id="btw_E1_2" model="account.tax.template">4551 <field name="ref_tax_sign" eval="-1"/>
4471 <field name="chart_template_id" ref="l10nnl_chart_template"/>4552 <field name="type_tax_use">purchase</field>
4472 <field name="name">Inkopen import buiten EU laag(2)</field>4553 </record>
4473 <field eval="-1.00" name="amount"/>4554 <record id="btw_E1_2" model="account.tax.template">
4474 <field name="type">percent</field>4555 <field name="sequence">99</field>
4475 <field name="parent_id" ref="btw_E1"/>4556 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4476 <field name="account_collected_id" ref="vat_refund6"/>4557 <field name="name">Inkopen import buiten EU laag(2)</field>
4477 <field name="account_paid_id" ref="vat_refund6"/>4558 <field eval="1.00" name="amount"/>
4478 <field eval="btw_code_5b" name="tax_code_id"/>4559 <field name="type">percent</field>
4479 <field eval="btw_code_5b" name="ref_tax_code_id"/>4560 <field name="parent_id" ref="btw_E1"/>
4480 <field name="type_tax_use">purchase</field>4561 <field name="account_collected_id" ref="vat_refund_low"/>
4481 </record>4562 <field name="account_paid_id" ref="vat_refund_low"/>
4563 <field eval="btw_code_5b" name="tax_code_id"/>
4564 <field eval="btw_code_5b" name="ref_tax_code_id"/>
4565 <field name="ref_base_sign" eval="-1"/>
4566 <field name="ref_tax_sign" eval="-1"/>
4567 <field name="type_tax_use">purchase</field>
4568 </record>
4482 <record id="btw_E2" model="account.tax.template">4569 <record id="btw_E2" model="account.tax.template">
4570 <field name="sequence">20</field>
4483 <field name="chart_template_id" ref="l10nnl_chart_template"/>4571 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4484 <field name="name">Inkopen import buiten EU hoog</field>4572 <field name="name">Inkopen import buiten EU hoog</field>
4485 <field name="description">BTW import buiten EU</field>4573 <field name="description">BTW import buiten EU</field>
4486 <field eval="0.19" name="amount"/>4574 <field eval="0.21" name="amount"/>
4487 <field name="type">percent</field>4575 <field name="type">percent</field>
4488 <field eval="True" name="child_depend"/>4576 <field eval="True" name="child_depend"/>
4489 <field eval="omz_code_4a" name="base_code_id"/>4577 <field eval="omz_code_4a" name="base_code_id"/>
4490 <field eval="omz_code_4a" name="ref_base_code_id"/>4578 <field eval="omz_code_4a" name="ref_base_code_id"/>
4579 <field name="ref_base_sign" eval="-1"/>
4580 <field name="ref_tax_sign" eval="-1"/>
4491 <field name="type_tax_use">purchase</field>4581 <field name="type_tax_use">purchase</field>
4492 </record>4582 </record>
4493 <record id="btw_E2_1" model="account.tax.template">4583 <record id="btw_E2_1" model="account.tax.template">
4494 <field name="chart_template_id" ref="l10nnl_chart_template"/>4584 <field name="sequence">99</field>
4495 <field name="name">Inkopen import buiten EU hoog(1)</field>4585 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4496 <field eval="1.00" name="amount"/>4586 <field name="name">Inkopen import buiten EU hoog(1)</field>
4497 <field name="type">percent</field>4587 <field eval="-1.00" name="amount"/>
4498 <field name="parent_id" ref="btw_E2"/>4588 <field name="type">percent</field>
4499 <field name="account_collected_id" ref="vat_payable19"/>4589 <field name="parent_id" ref="btw_E2"/>
4500 <field name="account_paid_id" ref="vat_payable19"/>4590 <field name="account_collected_id" ref="vat_payable_high"/>
4501 <field eval="btw_code_4a" name="tax_code_id"/>4591 <field name="account_paid_id" ref="vat_payable_high"/>
4502 <field eval="btw_code_4a" name="ref_tax_code_id"/>4592 <field eval="btw_code_4a" name="tax_code_id"/>
4503 <field name="type_tax_use">purchase</field>4593 <field eval="btw_code_4a" name="ref_tax_code_id"/>
4504 </record>4594 <field name="ref_base_sign" eval="-1"/>
4505 <record id="btw_E2_2" model="account.tax.template">4595 <field name="ref_tax_sign" eval="-1"/>
4506 <field name="chart_template_id" ref="l10nnl_chart_template"/>4596 <field name="type_tax_use">purchase</field>
4507 <field name="name">Inkopen import buiten EU hoog(2)</field>4597 </record>
4508 <field eval="-1.00" name="amount"/>4598 <record id="btw_E2_2" model="account.tax.template">
4509 <field name="type">percent</field>4599 <field name="sequence">99</field>
4510 <field name="parent_id" ref="btw_E2"/>4600 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4511 <field name="account_collected_id" ref="vat_refund19"/>4601 <field name="name">Inkopen import buiten EU hoog(2)</field>
4512 <field name="account_paid_id" ref="vat_refund19"/>4602 <field eval="1.00" name="amount"/>
4513 <field eval="btw_code_5b" name="tax_code_id"/>4603 <field name="type">percent</field>
4514 <field eval="btw_code_5b" name="ref_tax_code_id"/>4604 <field name="parent_id" ref="btw_E2"/>
4515 <field name="type_tax_use">purchase</field>4605 <field name="account_collected_id" ref="vat_refund_high"/>
4516 </record>4606 <field name="account_paid_id" ref="vat_refund_high"/>
4607 <field eval="btw_code_5b" name="tax_code_id"/>
4608 <field eval="btw_code_5b" name="ref_tax_code_id"/>
4609 <field name="ref_base_sign" eval="-1"/>
4610 <field name="ref_tax_sign" eval="-1"/>
4611 <field name="type_tax_use">purchase</field>
4612 </record>
4517 <record id="btw_E_overig" model="account.tax.template">4613 <record id="btw_E_overig" model="account.tax.template">
4614 <field name="sequence">20</field>
4518 <field name="chart_template_id" ref="l10nnl_chart_template"/>4615 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4519 <field name="name">Inkopen import buiten EU overig</field>4616 <field name="name">Inkopen import buiten EU overig</field>
4520 <field name="description">BTW import buiten EU</field>4617 <field name="description">BTW import buiten EU</field>
4521 <field eval="0.19" name="amount"/>4618 <field eval="0.21" name="amount"/>
4522 <field name="type">percent</field>4619 <field name="type">percent</field>
4523 <field eval="True" name="child_depend"/>4620 <field eval="True" name="child_depend"/>
4524 <field eval="omz_code_4a" name="base_code_id"/>4621 <field eval="omz_code_4a" name="base_code_id"/>
4525 <field eval="omz_code_4a" name="ref_base_code_id"/>4622 <field eval="omz_code_4a" name="ref_base_code_id"/>
4623 <field name="ref_base_sign" eval="-1"/>
4624 <field name="ref_tax_sign" eval="-1"/>
4526 <field name="type_tax_use">purchase</field>4625 <field name="type_tax_use">purchase</field>
4527 </record>4626 </record>
4528 <record id="btw_E_overig_1" model="account.tax.template">4627 <record id="btw_E_overig_1" model="account.tax.template">
4529 <field name="chart_template_id" ref="l10nnl_chart_template"/>4628 <field name="sequence">99</field>
4530 <field name="name">Inkopen import buiten EU overig(1)</field>4629 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4531 <field eval="1.00" name="amount"/>4630 <field name="name">Inkopen import buiten EU overig(1)</field>
4532 <field name="type">percent</field>4631 <field eval="-1.00" name="amount"/>
4533 <field name="parent_id" ref="btw_E_overig"/>4632 <field name="type">percent</field>
4534 <field name="account_collected_id" ref="vat_payable19"/>4633 <field name="parent_id" ref="btw_E_overig"/>
4535 <field name="account_paid_id" ref="vat_payable19"/>4634 <field name="account_collected_id" ref="vat_payable_high"/>
4536 <field eval="btw_code_4a" name="tax_code_id"/>4635 <field name="account_paid_id" ref="vat_payable_high"/>
4537 <field eval="btw_code_4a" name="ref_tax_code_id"/>4636 <field eval="btw_code_4a" name="tax_code_id"/>
4538 <field name="type_tax_use">purchase</field>4637 <field eval="btw_code_4a" name="ref_tax_code_id"/>
4539 </record>4638 <field name="ref_base_sign" eval="-1"/>
4540 <record id="btw_E_overig_2" model="account.tax.template">4639 <field name="ref_tax_sign" eval="-1"/>
4541 <field name="chart_template_id" ref="l10nnl_chart_template"/>4640 <field name="type_tax_use">purchase</field>
4542 <field name="name">Inkopen import buiten EU overig(2)</field>4641 </record>
4543 <field eval="-1.00" name="amount"/>4642 <record id="btw_E_overig_2" model="account.tax.template">
4544 <field name="type">percent</field>4643 <field name="sequence">99</field>
4545 <field name="parent_id" ref="btw_E_overig"/>4644 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4546 <field name="account_collected_id" ref="vat_refund19"/>4645 <field name="name">Inkopen import buiten EU overig(2)</field>
4547 <field name="account_paid_id" ref="vat_refund19"/>4646 <field eval="1.00" name="amount"/>
4548 <field eval="btw_code_5b" name="tax_code_id"/>4647 <field name="type">percent</field>
4549 <field eval="btw_code_5b" name="ref_tax_code_id"/>4648 <field name="parent_id" ref="btw_E_overig"/>
4550 <field name="type_tax_use">purchase</field>4649 <field name="account_collected_id" ref="vat_refund_high"/>
4551 </record>4650 <field name="account_paid_id" ref="vat_refund_high"/>
4651 <field eval="btw_code_5b" name="tax_code_id"/>
4652 <field eval="btw_code_5b" name="ref_tax_code_id"/>
4653 <field name="ref_base_sign" eval="-1"/>
4654 <field name="ref_tax_sign" eval="-1"/>
4655 <field name="type_tax_use">purchase</field>
4656 </record>
4552<!-- BTW Verkoop -->4657<!-- BTW Verkoop -->
4553 <record id="btw_X1" model="account.tax.template">4658 <record id="btw_X1" model="account.tax.template">
4659 <field name="sequence">20</field>
4554 <field name="chart_template_id" ref="l10nnl_chart_template"/>4660 <field name="chart_template_id" ref="l10nnl_chart_template"/>
4555 <field name="name">Verkopen export buiten EU</field>4661 <field name="name">Verkopen export buiten EU</field>
4556 <field name="description">BTW export buiten EU</field>4662 <field name="description">BTW export buiten EU</field>
4557 <field eval="0.00" name="amount"/>4663 <field eval="0.00" name="amount"/>
4558 <field name="type">percent</field>4664 <field name="type">percent</field>
4559 <field name="account_collected_id" ref="vat_payable0"/>4665 <field name="account_collected_id" ref="vat_payable0"/>
4560 <field name="account_paid_id" ref="vat_refund0"/>4666 <field name="account_paid_id" ref="vat_payable0"/>
4561 <field name="base_code_id" ref="omz_code_3a"/>4667 <field name="base_code_id" ref="omz_code_3a"/>
4562 <field name="ref_base_code_id" ref="omz_code_3a"/>4668 <field name="ref_base_code_id" ref="omz_code_3a"/>
4669 <field name="ref_base_sign" eval="-1"/>
4670 <field name="ref_tax_sign" eval="-1"/>
4563 <field name="type_tax_use">sale</field>4671 <field name="type_tax_use">sale</field>
4564 </record>4672 </record>
4565 </data>4673 </data>
45664674
=== added file 'l10n_nl/account_fiscal_position_account_template.xml'
--- l10n_nl/account_fiscal_position_account_template.xml 1970-01-01 00:00:00 +0000
+++ l10n_nl/account_fiscal_position_account_template.xml 2014-04-22 12:10:57 +0000
@@ -0,0 +1,245 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <!-- Fiscal Position Account Templates -->
5
6 <!-- Position 2 - NON-EU Countries -->
7 <!-- inkopen laag -->
8 <record
9 id="position_account_non_eu_purchase_low"
10 model="account.fiscal.position.account.template">
11 <field name="position_id" ref="fiscal_position_template_non_eu" />
12 <field name="account_src_id" ref="l10n_nl.a_7001" />
13 <field name="account_dest_id" ref="l10n_nl.a_7017" />
14 </record>
15 <!-- inkopen hoog. NB: id not according to convention! -->
16 <record
17 id="position_account_non_eu_purchase_high"
18 model="account.fiscal.position.account.template">
19 <field name="position_id" ref="fiscal_position_template_non_eu" />
20 <field name="account_src_id" ref="l10n_nl.a_expense" />
21 <field name="account_dest_id" ref="l10n_nl.a_7018" />
22 </record>
23 <!-- inkopen overig -->
24 <record
25 id="position_account_non_eu_purchase_other"
26 model="account.fiscal.position.account.template">
27 <field name="position_id" ref="fiscal_position_template_non_eu" />
28 <field name="account_src_id" ref="l10n_nl.a_7003" />
29 <field name="account_dest_id" ref="l10n_nl.a_7019" />
30 </record>
31 <!-- verkopen fabricage -->
32 <!-- verkopen laag -->
33 <record
34 id="position_account_non_eu_production_sales_low"
35 model="account.fiscal.position.account.template">
36 <field name="position_id" ref="fiscal_position_template_non_eu" />
37 <field name="account_src_id" ref="l10n_nl.a_8001" />
38 <field name="account_dest_id" ref="l10n_nl.a_8020" />
39 </record>
40 <!-- verkopen hoog -->
41 <record
42 id="position_account_non_eu_production_sales_high"
43 model="account.fiscal.position.account.template">
44 <field name="position_id" ref="fiscal_position_template_non_eu" />
45 <field name="account_src_id" ref="l10n_nl.a_8002" />
46 <field name="account_dest_id" ref="l10n_nl.a_8020" />
47 </record>
48 <!-- verkopen overig -->
49 <record
50 id="position_account_non_eu_sales_production_other"
51 model="account.fiscal.position.account.template">
52 <field name="position_id" ref="fiscal_position_template_non_eu" />
53 <field name="account_src_id" ref="l10n_nl.a_8003" />
54 <field name="account_dest_id" ref="l10n_nl.a_8020" />
55 </record>
56 <!-- verkopen handel -->
57 <!-- verkopen laag -->
58 <record
59 id="position_account_non_eu_sales_trade_low"
60 model="account.fiscal.position.account.template">
61 <field name="position_id" ref="fiscal_position_template_non_eu" />
62 <field name="account_src_id" ref="l10n_nl.a_8011" />
63 <field name="account_dest_id" ref="l10n_nl.a_8021" />
64 </record>
65 <!-- verkopen hoog -->
66 <record
67 id="position_account_non_eu_sales_trade_high"
68 model="account.fiscal.position.account.template">
69 <field name="position_id" ref="fiscal_position_template_non_eu" />
70 <field name="account_src_id" ref="l10n_nl.a_sale" />
71 <field name="account_dest_id" ref="l10n_nl.a_8021" />
72 </record>
73 <!-- verkopen overig -->
74 <record
75 id="position_account_non_eu_sales_trade_other"
76 model="account.fiscal.position.account.template">
77 <field name="position_id" ref="fiscal_position_template_non_eu" />
78 <field name="account_src_id" ref="l10n_nl.a_8013" />
79 <field name="account_dest_id" ref="l10n_nl.a_8021" />
80 </record>
81 <!-- verkopen diensten fabricage -->
82 <!-- verkopen laag -->
83 <record
84 id="position_account_non_eu_sales_service_production_low"
85 model="account.fiscal.position.account.template">
86 <field name="position_id" ref="fiscal_position_template_non_eu" />
87 <field name="account_src_id" ref="l10n_nl.a_8041" />
88 <field name="account_dest_id" ref="l10n_nl.a_8060" />
89 </record>
90 <!-- verkopen hoog -->
91 <record
92 id="position_account_non_eu_sales_service_production_high"
93 model="account.fiscal.position.account.template">
94 <field name="position_id" ref="fiscal_position_template_non_eu" />
95 <field name="account_src_id" ref="l10n_nl.a_8042" />
96 <field name="account_dest_id" ref="l10n_nl.a_8060" />
97 </record>
98 <!-- verkopen overig -->
99 <record
100 id="position_account_non_eu_sales_service_production_other"
101 model="account.fiscal.position.account.template">
102 <field name="position_id" ref="fiscal_position_template_non_eu" />
103 <field name="account_src_id" ref="l10n_nl.a_8043" />
104 <field name="account_dest_id" ref="l10n_nl.a_8060" />
105 </record>
106 <!-- verkopen diensten handel -->
107 <!-- verkopen laag -->
108 <record
109 id="position_account_non_eu_sales_service_trade_low"
110 model="account.fiscal.position.account.template">
111 <field name="position_id" ref="fiscal_position_template_non_eu" />
112 <field name="account_src_id" ref="l10n_nl.a_8051" />
113 <field name="account_dest_id" ref="l10n_nl.a_8061" />
114 </record>
115 <!-- verkopen hoog -->
116 <record
117 id="position_account_non_eu_sales_service_trade_high"
118 model="account.fiscal.position.account.template">
119 <field name="position_id" ref="fiscal_position_template_non_eu" />
120 <field name="account_src_id" ref="l10n_nl.a_8052" />
121 <field name="account_dest_id" ref="l10n_nl.a_8061" />
122 </record>
123 <!-- verkopen overig: is er niet?? -->
124
125 <!-- Position 3 - EU Countries -->
126 <!-- inkopen laag -->
127 <record
128 id="position_account_eu_purchase_low"
129 model="account.fiscal.position.account.template">
130 <field name="position_id" ref="fiscal_position_template_eu" />
131 <field name="account_src_id" ref="l10n_nl.a_7001" />
132 <field name="account_dest_id" ref="l10n_nl.a_7014" />
133 </record>
134 <!-- inkopen hoog -->
135 <record
136 id="position_account_eu_purchase_high"
137 model="account.fiscal.position.account.template">
138 <field name="position_id" ref="fiscal_position_template_eu" />
139 <field name="account_src_id" ref="l10n_nl.a_expense" />
140 <field name="account_dest_id" ref="l10n_nl.a_7015" />
141 </record>
142 <!-- inkopen overig -->
143 <record
144 id="position_account_eu_purchase_other"
145 model="account.fiscal.position.account.template">
146 <field name="position_id" ref="fiscal_position_template_eu" />
147 <field name="account_src_id" ref="l10n_nl.a_7003" />
148 <field name="account_dest_id" ref="l10n_nl.a_7016" />
149 </record>
150 <!-- verkopen fabricage -->
151 <!-- verkopen laag -->
152 <record
153 id="position_account_eu_sales_production_low"
154 model="account.fiscal.position.account.template">
155 <field name="position_id" ref="fiscal_position_template_eu" />
156 <field name="account_src_id" ref="l10n_nl.a_8001" />
157 <field name="account_dest_id" ref="l10n_nl.a_8000" />
158 </record>
159 <!-- verkopen hoog -->
160 <record
161 id="position_account_eu_sales_production_high"
162 model="account.fiscal.position.account.template">
163 <field name="position_id" ref="fiscal_position_template_eu" />
164 <field name="account_src_id" ref="l10n_nl.a_8002" />
165 <field name="account_dest_id" ref="l10n_nl.a_8000" />
166 </record>
167 <!-- verkopen overig -->
168 <record
169 id="position_account_eu_sales_production_other"
170 model="account.fiscal.position.account.template">
171 <field name="position_id" ref="fiscal_position_template_eu" />
172 <field name="account_src_id" ref="l10n_nl.a_8003" />
173 <field name="account_dest_id" ref="l10n_nl.a_8000" />
174 </record>
175 <!-- verkopen handel -->
176 <!-- verkopen laag -->
177 <record
178 id="position_account_eu_sales_trade_low"
179 model="account.fiscal.position.account.template">
180 <field name="position_id" ref="fiscal_position_template_eu" />
181 <field name="account_src_id" ref="l10n_nl.a_8011" />
182 <field name="account_dest_id" ref="l10n_nl.a_8010" />
183 </record>
184 <!-- verkopen hoog -->
185 <record
186 id="position_account_eu_sales_trade_high"
187 model="account.fiscal.position.account.template">
188 <field name="position_id" ref="fiscal_position_template_eu" />
189 <field name="account_src_id" ref="l10n_nl.a_sale" />
190 <field name="account_dest_id" ref="l10n_nl.a_8010" />
191 </record>
192 <!-- verkopen overig -->
193 <record
194 id="position_account_eu_sales_trade_other"
195 model="account.fiscal.position.account.template">
196 <field name="position_id" ref="fiscal_position_template_eu" />
197 <field name="account_src_id" ref="l10n_nl.a_8013" />
198 <field name="account_dest_id" ref="l10n_nl.a_8010" />
199 </record>
200 <!-- verkopen diensten fabricage -->
201 <!-- verkopen laag -->
202 <record
203 id="position_account_eu_sales_service_production_low"
204 model="account.fiscal.position.account.template">
205 <field name="position_id" ref="fiscal_position_template_eu" />
206 <field name="account_src_id" ref="l10n_nl.a_8041" />
207 <field name="account_dest_id" ref="l10n_nl.a_8040" />
208 </record>
209 <!-- verkopen hoog -->
210 <record
211 id="position_account_eu_sales_service_production_high"
212 model="account.fiscal.position.account.template">
213 <field name="position_id" ref="fiscal_position_template_eu" />
214 <field name="account_src_id" ref="l10n_nl.a_8042" />
215 <field name="account_dest_id" ref="l10n_nl.a_8040" />
216 </record>
217 <!-- verkopen overig -->
218 <record
219 id="position_account_eu_sales_service_production_other"
220 model="account.fiscal.position.account.template">
221 <field name="position_id" ref="fiscal_position_template_eu" />
222 <field name="account_src_id" ref="l10n_nl.a_8043" />
223 <field name="account_dest_id" ref="l10n_nl.a_8040" />
224 </record>
225 <!-- verkopen diensten handel -->
226 <!-- verkopen laag -->
227 <record
228 id="position_account_eu_sales_service_trade_low"
229 model="account.fiscal.position.account.template">
230 <field name="position_id" ref="fiscal_position_template_eu" />
231 <field name="account_src_id" ref="l10n_nl.a_8051" />
232 <field name="account_dest_id" ref="l10n_nl.a_8050" />
233 </record>
234 <!-- verkopen hoog -->
235 <record
236 id="position_account_eu_sales_service_trade_high"
237 model="account.fiscal.position.account.template">
238 <field name="position_id" ref="fiscal_position_template_eu" />
239 <field name="account_src_id" ref="l10n_nl.a_8052" />
240 <field name="account_dest_id" ref="l10n_nl.a_8050" />
241 </record>
242 <!-- verkopen overig: is er niet?? -->
243
244 </data>
245</openerp>
0\ No newline at end of file246\ No newline at end of file
1247
=== added file 'l10n_nl/account_fiscal_position_tax_template.xml'
--- l10n_nl/account_fiscal_position_tax_template.xml 1970-01-01 00:00:00 +0000
+++ l10n_nl/account_fiscal_position_tax_template.xml 2014-04-22 12:10:57 +0000
@@ -0,0 +1,97 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4
5 <!-- account.fiscal.position.tax.template -->
6
7 <!-- Position 2 - NON-EU Countries -->
8 <!-- All sales tax will become 0 -->
9 <record id="position_tax_extracom_1" model="account.fiscal.position.tax.template">
10 <field name="position_id" ref="fiscal_position_template_non_eu"/>
11 <field name="tax_src_id" ref="l10n_nl.btw_0"/>
12 <field name="tax_dest_id" ref="l10n_nl.btw_X1"/>
13 </record>
14 <record id="position_tax_extracom_2" model="account.fiscal.position.tax.template">
15 <field name="position_id" ref="fiscal_position_template_non_eu"/>
16 <field name="tax_src_id" ref="l10n_nl.btw_6"/>
17 <field name="tax_dest_id" ref="l10n_nl.btw_X1"/>
18 </record>
19 <record id="position_tax_extracom_3" model="account.fiscal.position.tax.template">
20 <field name="position_id" ref="fiscal_position_template_non_eu"/>
21 <field name="tax_src_id" ref="l10n_nl.btw_21"/>
22 <field name="tax_dest_id" ref="l10n_nl.btw_X1"/>
23 </record>
24 <record id="position_tax_extracom_4" model="account.fiscal.position.tax.template">
25 <field name="position_id" ref="fiscal_position_template_non_eu"/>
26 <field name="tax_src_id" ref="l10n_nl.btw_overig"/>
27 <field name="tax_dest_id" ref="l10n_nl.btw_X1"/>
28 </record>
29
30 <!-- VAT on buying from outside the EU -->
31 <!-- VAT low -->
32 <record id="position_tax_extracom_5" model="account.fiscal.position.tax.template">
33 <field name="position_id" ref="fiscal_position_template_non_eu"/>
34 <field name="tax_src_id" ref="l10n_nl.btw_6_buy"/>
35 <field name="tax_dest_id" ref="l10n_nl.btw_E1"/>
36 </record>
37 <!-- VAT high -->
38 <record id="position_tax_extracom_6" model="account.fiscal.position.tax.template">
39 <field name="position_id" ref="fiscal_position_template_non_eu"/>
40 <field name="tax_src_id" ref="l10n_nl.btw_21_buy"/>
41 <field name="tax_dest_id" ref="l10n_nl.btw_E2"/>
42 </record>
43 <!-- VAT other -->
44 <record id="position_tax_extracom_7" model="account.fiscal.position.tax.template">
45 <field name="position_id" ref="fiscal_position_template_non_eu"/>
46 <field name="tax_src_id" ref="l10n_nl.btw_overig_buy"/>
47 <field name="tax_dest_id" ref="l10n_nl.btw_E_overig"/>
48 </record>
49 <!-- Belgian schema has many more lines here.... -->
50
51 <!-- Position 3 - EU Countries -->
52 <record id="position_tax_intracom_1" model="account.fiscal.position.tax.template">
53 <field name="position_id" ref="fiscal_position_template_eu"/>
54 <field name="tax_src_id" ref="l10n_nl.btw_0"/>
55 <field name="tax_dest_id" ref="l10n_nl.btw_X0"/>
56 </record>
57 <record id="position_tax_intracom_2" model="account.fiscal.position.tax.template">
58 <field name="position_id" ref="fiscal_position_template_eu"/>
59 <field name="tax_src_id" ref="l10n_nl.btw_6"/>
60 <field name="tax_dest_id" ref="l10n_nl.btw_X0"/>
61 </record>
62 <record id="position_tax_intracom_3" model="account.fiscal.position.tax.template">
63 <field name="position_id" ref="fiscal_position_template_eu"/>
64 <field name="tax_src_id" ref="l10n_nl.btw_21"/>
65 <field name="tax_dest_id" ref="l10n_nl.btw_X0"/>
66 </record>
67 <record id="position_tax_intracom_4" model="account.fiscal.position.tax.template">
68 <field name="position_id" ref="fiscal_position_template_eu"/>
69 <field name="tax_src_id" ref="l10n_nl.btw_overig"/>
70 <field name="tax_dest_id" ref="l10n_nl.btw_X0"/>
71 </record>
72
73 <!-- In source-tax we lack the separation of goods and services,
74 therefore no lines now for "Installatie/Afstandsverkopen. -->
75
76 <!-- Buying from other EU countries (only goods = VAT 0 -->
77 <record id="position_tax_intracom_5" model="account.fiscal.position.tax.template">
78 <field name="position_id" ref="fiscal_position_template_eu"/>
79 <field name="tax_src_id" ref="l10n_nl.btw_6_buy"/>
80 <field name="tax_dest_id" ref="l10n_nl.btw_I_6"/>
81 </record>
82 <record id="position_tax_intracom_6" model="account.fiscal.position.tax.template">
83 <field name="position_id" ref="fiscal_position_template_eu"/>
84 <field name="tax_src_id" ref="l10n_nl.btw_21_buy"/>
85 <field name="tax_dest_id" ref="l10n_nl.btw_I_21"/>
86 </record>
87 <record id="position_tax_intracom_7" model="account.fiscal.position.tax.template">
88 <field name="position_id" ref="fiscal_position_template_eu"/>
89 <field name="tax_src_id" ref="l10n_nl.btw_overig_buy"/>
90 <field name="tax_dest_id" ref="l10n_nl.btw_I_overig"/>
91 </record>
92
93 <!-- Again, Belgian schema has 17 (!) more records. Missing VAT 0
94 and separation of goods and services .. -->
95
96 </data>
97</openerp>
098
=== added file 'l10n_nl/account_fiscal_position_template.xml'
--- l10n_nl/account_fiscal_position_template.xml 1970-01-01 00:00:00 +0000
+++ l10n_nl/account_fiscal_position_template.xml 2014-04-22 12:10:57 +0000
@@ -0,0 +1,33 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <!-- Fiscal Position Templates -->
5
6 <!-- for the moment no use for this
7 <record
8 id="fiscal_position_template_domestic"
9 model="account.fiscal.position.template">
10 <field name="name">Binnenland</field>
11 <field
12 name="chart_template_id"
13 ref="l10nnl_chart_template" />
14 </record>
15 -->
16 <record
17 id="fiscal_position_template_eu"
18 model="account.fiscal.position.template">
19 <field name="name">EU landen</field>
20 <field
21 name="chart_template_id"
22 ref="l10nnl_chart_template" />
23 </record>
24 <record
25 id="fiscal_position_template_non_eu"
26 model="account.fiscal.position.template">
27 <field name="name">Niet-EU landen</field>
28 <field
29 name="chart_template_id"
30 ref="l10nnl_chart_template" />
31 </record>
32 </data>
33</openerp>
034
=== modified file 'mail/mail_message.py'
--- mail/mail_message.py 2012-09-24 14:02:33 +0000
+++ mail/mail_message.py 2014-04-22 12:10:57 +0000
@@ -26,10 +26,10 @@
26import email26import email
27import logging27import logging
28import pytz28import pytz
29import re
30import time29import time
31from email.header import decode_header30from email.header import decode_header
32from email.message import Message31from email.message import Message
32from email.utils import getaddresses
3333
34import tools34import tools
35from osv import osv35from osv import osv
@@ -60,9 +60,15 @@
60 return ''.join([tools.ustr(x[0], x[1]) for x in text])60 return ''.join([tools.ustr(x[0], x[1]) for x in text])
6161
62def to_email(text):62def to_email(text):
63 """Return a list of the email addresses found in ``text``"""63 """Returns a list of the email addresses found in ``text``
64 """
64 if not text: return []65 if not text: return []
65 return re.findall(r'([^ ,<@]+@[^> ,]+)', text)66
67 people = getaddresses([text])
68 addresses = [person[1] for person in people]
69
70 return addresses
71
6672
67class mail_message_common(osv.osv_memory):73class mail_message_common(osv.osv_memory):
68 """Common abstract class for holding the main attributes of a 74 """Common abstract class for holding the main attributes of a
@@ -534,7 +540,14 @@
534 mail_server_id=message.mail_server_id.id,540 mail_server_id=message.mail_server_id.id,
535 context=context)541 context=context)
536 if res:542 if res:
537 message.write({'state':'sent', 'message_id': res})543 message.write(
544 {
545 'state':'sent',
546 'message_id': res,
547 'user_id': message.user_id.id or uid,
548 'date': message.date
549 or datetime.datetime.now(),
550 })
538 message_sent = True551 message_sent = True
539 else:552 else:
540 message.write({'state':'exception'})553 message.write({'state':'exception'})
541554
=== modified file 'mail/mail_thread.py'
--- mail/mail_thread.py 2012-08-10 11:48:38 +0000
+++ mail/mail_thread.py 2014-04-22 12:10:57 +0000
@@ -358,7 +358,7 @@
358 match = tools.reference_re.search(references)358 match = tools.reference_re.search(references)
359 if match: res_id = match.group(1)359 if match: res_id = match.group(1)
360 if not res_id:360 if not res_id:
361 match = tools.res_re.search(msg['subject'])361 match = tools.res_re.search(msg.get('subject') or '')
362 if match: res_id = match.group(1)362 if match: res_id = match.group(1)
363 if res_id:363 if res_id:
364 res_id = int(res_id)364 res_id = int(res_id)
365365
=== modified file 'mrp/mrp.py'
--- mrp/mrp.py 2012-10-05 10:44:47 +0000
+++ mrp/mrp.py 2014-04-22 12:10:57 +0000
@@ -20,9 +20,10 @@
20##############################################################################20##############################################################################
2121
22from datetime import datetime22from datetime import datetime
23from osv import osv, fields23from osv import osv, fields, orm
24import decimal_precision as dp24import decimal_precision as dp
25from tools import float_compare25from tools import float_compare
26from tools import DEFAULT_SERVER_DATETIME_FORMAT
26from tools.translate import _27from tools.translate import _
27import netsvc28import netsvc
28import time29import time
@@ -280,8 +281,10 @@
280 @param properties: List of related properties.281 @param properties: List of related properties.
281 @return: False or BoM id.282 @return: False or BoM id.
282 """283 """
283 cr.execute('select id from mrp_bom where product_id=%s and bom_id is null order by sequence', (product_id,))284 domain = [('product_id', '=', product_id), ('bom_id', '=', False),
284 ids = map(lambda x: x[0], cr.fetchall())285 '|', ('date_start', '=', False), ('date_start', '<=', time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)),
286 '|', ('date_stop', '=', False), ('date_stop', '>=', time.strftime(DEFAULT_SERVER_DATETIME_FORMAT))]
287 ids = self.search(cr, uid, domain, order='sequence')
285 max_prop = 0288 max_prop = 0
286 result = False289 result = False
287 for bom in self.pool.get('mrp.bom').browse(cr, uid, ids):290 for bom in self.pool.get('mrp.bom').browse(cr, uid, ids):
@@ -434,6 +437,22 @@
434 for prod in self.browse(cr, uid, ids, context=context):437 for prod in self.browse(cr, uid, ids, context=context):
435 result[prod.id] = prod.date_planned[:10]438 result[prod.id] = prod.date_planned[:10]
436 return result439 return result
440
441 def _src_id_default(self, cr, uid, ids, context=None):
442 try:
443 location_model, location_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_stock')
444 self.pool.get('stock.location').check_access_rule(cr, uid, [location_id], 'read', context=context)
445 except (orm.except_orm, ValueError):
446 location_id = False
447 return location_id
448
449 def _dest_id_default(self, cr, uid, ids, context=None):
450 try:
451 location_model, location_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_stock')
452 self.pool.get('stock.location').check_access_rule(cr, uid, [location_id], 'read', context=context)
453 except (orm.except_orm, ValueError):
454 location_id = False
455 return location_id
437456
438 _columns = {457 _columns = {
439 'name': fields.char('Reference', size=64, required=True),458 'name': fields.char('Reference', size=64, required=True),
@@ -481,6 +500,8 @@
481 'state': lambda *a: 'draft',500 'state': lambda *a: 'draft',
482 'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),501 'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
483 'product_qty': lambda *a: 1.0,502 'product_qty': lambda *a: 1.0,
503 'location_src_id': _src_id_default,
504 'location_dest_id': _dest_id_default,
484 'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'mrp.production') or '/',505 'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'mrp.production') or '/',
485 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c),506 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c),
486 }507 }
487508
=== modified file 'mrp/security/mrp_security.xml'
--- mrp/security/mrp_security.xml 2011-12-19 16:54:40 +0000
+++ mrp/security/mrp_security.xml 2014-04-22 12:10:57 +0000
@@ -36,7 +36,7 @@
36 <field name="name">mrp_bom multi-company</field>36 <field name="name">mrp_bom multi-company</field>
37 <field name="model_id" search="[('model','=','mrp.bom')]" model="ir.model"/>37 <field name="model_id" search="[('model','=','mrp.bom')]" model="ir.model"/>
38 <field name="global" eval="True"/>38 <field name="global" eval="True"/>
39 <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>39 <field name="domain_force">['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
40 </record>40 </record>
4141
42 <record model="ir.rule" id="mrp_routing_rule">42 <record model="ir.rule" id="mrp_routing_rule">
4343
=== modified file 'mrp_repair/mrp_repair.py'
--- mrp_repair/mrp_repair.py 2012-01-31 13:36:57 +0000
+++ mrp_repair/mrp_repair.py 2014-04-22 12:10:57 +0000
@@ -349,7 +349,8 @@
349 return True349 return True
350350
351 def wkf_invoice_create(self, cr, uid, ids, *args):351 def wkf_invoice_create(self, cr, uid, ids, *args):
352 return self.action_invoice_create(cr, uid, ids)352 self.action_invoice_create(cr, uid, ids)
353 return True
353354
354 def action_invoice_create(self, cr, uid, ids, group=False, context=None):355 def action_invoice_create(self, cr, uid, ids, group=False, context=None):
355 """ Creates invoice(s) for repair order.356 """ Creates invoice(s) for repair order.
356357
=== modified file 'procurement/procurement.py'
--- procurement/procurement.py 2013-02-27 11:25:39 +0000
+++ procurement/procurement.py 2014-04-22 12:10:57 +0000
@@ -81,7 +81,7 @@
81 """81 """
82 _name = "procurement.order"82 _name = "procurement.order"
83 _description = "Procurement"83 _description = "Procurement"
84 _order = 'priority,date_planned desc'84 _order = 'priority desc,date_planned'
85 _log_create = False85 _log_create = False
86 _columns = {86 _columns = {
87 'name': fields.char('Reason', size=64, required=True, help='Procurement name.'),87 'name': fields.char('Reason', size=64, required=True, help='Procurement name.'),
8888
=== modified file 'product/pricelist.py'
--- product/pricelist.py 2012-01-31 13:36:57 +0000
+++ product/pricelist.py 2014-04-22 12:10:57 +0000
@@ -199,29 +199,52 @@
199 categ_ids = _create_parent_category_list(categ_id, [categ_id])199 categ_ids = _create_parent_category_list(categ_id, [categ_id])
200 if categ_ids:200 if categ_ids:
201 categ_where = '(categ_id IN (' + ','.join(map(str, categ_ids)) + '))'201 categ_where = '(categ_id IN (' + ','.join(map(str, categ_ids)) + '))'
202 categ_where_i = '(i.categ_id IN (' + ','.join(map(str, categ_ids)) + '))'
202 else:203 else:
203 categ_where = '(categ_id IS NULL)'204 categ_where = '(categ_id IS NULL)'
205 categ_where_i = '(i.categ_id IS NULL)'
204206
205 if partner:207 if partner:
206 partner_where = 'base <> -2 OR %s IN (SELECT name FROM product_supplierinfo WHERE product_id = %s) '208 partner_where = 'base <> -2 OR %s IN (SELECT name FROM product_supplierinfo WHERE product_id = %s) '
207 partner_args = (partner, product_id)209 partner_args = (partner, tmpl_id)
208 else:210 else:
209 partner_where = 'base <> -2 '211 partner_where = 'base <> -2 '
210 partner_args = ()212 partner_args = ()
211213
212 cr.execute(214 query = (
213 'SELECT i.*, pl.currency_id '215 'SELECT '
214 'FROM product_pricelist_item AS i, '216 'i.*, pl.currency_id , p.* '
215 'product_pricelist_version AS v, product_pricelist AS pl '217 'FROM '
216 'WHERE (product_tmpl_id IS NULL OR product_tmpl_id = %s) '218 'product_pricelist_item AS i '
217 'AND (product_id IS NULL OR product_id = %s) '219 'JOIN product_pricelist_version AS v '
218 'AND (' + categ_where + ' OR (categ_id IS NULL)) '220 'ON i.price_version_id = v.id '
219 'AND (' + partner_where + ') '221 'JOIN product_pricelist AS pl '
220 'AND price_version_id = %s '222 'ON v.pricelist_id = pl.id '
221 'AND (min_quantity IS NULL OR min_quantity <= %s) '223 'LEFT OUTER JOIN ( '
222 'AND i.price_version_id = v.id AND v.pricelist_id = pl.id '224 'WITH RECURSIVE subtree(depth, categ_id, parent_id, name) AS ( '
223 'ORDER BY sequence',225 'SELECT 0, id, parent_id, name FROM product_category WHERE parent_id is NULL '
224 (tmpl_id, product_id) + partner_args + (pricelist_version_ids[0], qty))226 'UNION '
227 'SELECT depth+1, m.id, m.parent_id, m.name '
228 'FROM subtree t, product_category m '
229 'WHERE m.parent_id = t.categ_id '
230 ') '
231 'SELECT * '
232 'FROM subtree '
233 'WHERE (' + categ_where + ' OR (categ_id IS NULL)) '
234 ') AS p '
235 'on i.categ_id = p.categ_id '
236 'WHERE '
237 '(product_tmpl_id IS NULL OR product_tmpl_id = %s) '
238 'AND (product_id IS NULL OR product_id = %s) '
239 'AND (' + categ_where_i + ' OR (i.categ_id IS NULL)) '
240 'AND (' + partner_where + ') '
241 'AND price_version_id = %s '
242 'AND (min_quantity IS NULL OR min_quantity <= %s) '
243 'ORDER BY '
244 'sequence, depth desc '
245 ) % ((tmpl_id, product_id) + partner_args + (pricelist_version_ids[0], qty))
246
247 cr.execute(query)
225 res1 = cr.dictfetchall()248 res1 = cr.dictfetchall()
226 uom_price_already_computed = False249 uom_price_already_computed = False
227 for res in res1:250 for res in res1:
@@ -232,7 +255,7 @@
232 else:255 else:
233 price_tmp = self.price_get(cr, uid,256 price_tmp = self.price_get(cr, uid,
234 [res['base_pricelist_id']], product_id,257 [res['base_pricelist_id']], product_id,
235 qty, context=context)[res['base_pricelist_id']]258 qty, partner=partner, context=context)[res['base_pricelist_id']]
236 ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id259 ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id
237 uom_price_already_computed = True260 uom_price_already_computed = True
238 price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False)261 price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False)
@@ -269,10 +292,17 @@
269 price_type.field, context=context)[product_id], round=False, context=context)292 price_type.field, context=context)[product_id], round=False, context=context)
270293
271 if price is not False:294 if price is not False:
295 surcharge = res['price_surcharge'] or 0.0
296 if 'uom' in context:
297 product = products_dict[product_id]
298 uom = product.uos_id or product.uom_id
299 surcharge = product_uom_obj._compute_price(cr, uid, uom.id, surcharge, context['uom'])
300
272 price_limit = price301 price_limit = price
273 price = price * (1.0+(res['price_discount'] or 0.0))302 price = price * (1.0+(res['price_discount'] or 0.0))
274 price = rounding(price, res['price_round']) #TOFIX: rounding with tools.float_rouding303 price = rounding(price, res['price_round']) #TOFIX: rounding with tools.float_rouding
275 price += (res['price_surcharge'] or 0.0)304 price += surcharge
305
276 if res['price_min_margin']:306 if res['price_min_margin']:
277 price = max(price, price_limit+res['price_min_margin'])307 price = max(price, price_limit+res['price_min_margin'])
278 if res['price_max_margin']:308 if res['price_max_margin']:
@@ -304,6 +334,7 @@
304 res.update({'item_id': {ids[-1]: res_multi.get('item_id', ids[-1])}})334 res.update({'item_id': {ids[-1]: res_multi.get('item_id', ids[-1])}})
305 return res335 return res
306336
337
307product_pricelist()338product_pricelist()
308339
309340
310341
=== modified file 'product/product.py'
--- product/product.py 2012-04-03 13:05:28 +0000
+++ product/product.py 2014-04-22 12:10:57 +0000
@@ -611,9 +611,9 @@
611 # Performing a quick memory merge of ids in Python will give much better performance611 # Performing a quick memory merge of ids in Python will give much better performance
612 ids = set()612 ids = set()
613 ids.update(self.search(cr, user, args + [('default_code',operator,name)], limit=limit, context=context))613 ids.update(self.search(cr, user, args + [('default_code',operator,name)], limit=limit, context=context))
614 if len(ids) < limit:614 if not limit or len(ids) < limit:
615 # we may underrun the limit because of dupes in the results, that's fine615 # we may underrun the limit because of dupes in the results, that's fine
616 ids.update(self.search(cr, user, args + [('name',operator,name)], limit=(limit-len(ids)), context=context))616 ids.update(self.search(cr, user, args + [('name',operator,name)], limit=(limit-len(ids) if limit else limit) , context=context))
617 ids = list(ids)617 ids = list(ids)
618 if not ids:618 if not ids:
619 ptrn = re.compile('(\[(.*?)\])')619 ptrn = re.compile('(\[(.*?)\])')
620620
=== modified file 'product/report/product_label.xsl'
--- product/report/product_label.xsl 2011-01-14 00:11:01 +0000
+++ product/report/product_label.xsl 2014-04-22 12:10:57 +0000
@@ -70,7 +70,7 @@
70 </td>70 </td>
71 </tr><tr>71 </tr><tr>
72 <td>72 <td>
73 <barCode><xsl:value-of select="code"/></barCode>73 <barCode><xsl:value-of select="ean13"/></barCode>
74 </td><td>74 </td><td>
75 <para style="nospace"><xsl:value-of select="product"/></para><xsl:text>, </xsl:text>75 <para style="nospace"><xsl:value-of select="product"/></para><xsl:text>, </xsl:text>
76 <para style="nospace"><xsl:value-of select="variant"/></para>76 <para style="nospace"><xsl:value-of select="variant"/></para>
7777
=== modified file 'project/project_view.xml'
--- project/project_view.xml 2012-03-12 10:20:01 +0000
+++ project/project_view.xml 2014-04-22 12:10:57 +0000
@@ -68,8 +68,8 @@
68 </field>68 </field>
69 </page>69 </page>
70 <page string="Billing" groups="account.group_account_invoice">70 <page string="Billing" groups="account.group_account_invoice">
71 <field colspan="4" name="partner_id" on_change="onchange_partner_id(partner_id)" select="1" string="Customer"/>71 <field name="partner_id" on_change="onchange_partner_id(partner_id)" select="1" string="Customer" colspan="4" />
72 <field domain="[('partner_id','=',partner_id)]" name="contact_id" string="Contact Address"/>72 <field name="contact_id" string="Contact Address" domain="[('partner_id','=',partner_id)]" options='{"quick_create": false}' context="{'default_partner_id':partner_id}" />
73 <field name="warn_customer"/>73 <field name="warn_customer"/>
74 <field name="currency_id" select="1" groups="base.group_multi_company" required="1"/>74 <field name="currency_id" select="1" groups="base.group_multi_company" required="1"/>
75 <newline/>75 <newline/>
7676
=== modified file 'project_issue/project_issue_view.xml'
--- project_issue/project_issue_view.xml 2012-03-12 11:29:31 +0000
+++ project_issue/project_issue_view.xml 2014-04-22 12:10:57 +0000
@@ -68,7 +68,7 @@
68 <group col="2" colspan="2">68 <group col="2" colspan="2">
69 <separator colspan="2" string="Contact Information"/>69 <separator colspan="2" string="Contact Information"/>
70 <field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/>70 <field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/>
71 <field name="partner_address_id" string="Contact" on_change="onchange_partner_address_id(partner_address_id, email_from)"/>71 <field name="partner_address_id" string="Contact" on_change="onchange_partner_address_id(partner_address_id, email_from)" options='{"quick_create": false}' context="{'default_partner_id':partner_id}" />
72 <field name="email_from"/>72 <field name="email_from"/>
73 </group>73 </group>
74 <group col="3" colspan="2">74 <group col="3" colspan="2">
7575
=== modified file 'project_mrp/project_procurement.py'
--- project_mrp/project_procurement.py 2011-12-19 16:54:40 +0000
+++ project_mrp/project_procurement.py 2014-04-22 12:10:57 +0000
@@ -20,6 +20,7 @@
20##############################################################################20##############################################################################
2121
22from osv import fields, osv22from osv import fields, osv
23from openerp.tools.translate import _
2324
24class procurement_order(osv.osv):25class procurement_order(osv.osv):
25 _name = "procurement.order"26 _name = "procurement.order"
@@ -37,8 +38,10 @@
37 """ Checks if task is done or not.38 """ Checks if task is done or not.
38 @return: True or False.39 @return: True or False.
39 """40 """
40 return all(proc.product_id.type != 'service' or (proc.task_id and proc.task_id.state in ('done', 'cancelled')) \41 for p in self.browse(cr, uid, ids, context=context):
41 for proc in self.browse(cr, uid, ids, context=context))42 if (p.product_id.type=='service') and (p.procure_method=='make_to_order') and p.task_id and (p.task_id.state not in ('done', 'cancelled')):
43 return False
44 return True
4245
43 def check_produce_service(self, cr, uid, procurement, context=None): 46 def check_produce_service(self, cr, uid, procurement, context=None):
44 return True47 return True
@@ -79,8 +82,9 @@
79 'description': procurement.note,82 'description': procurement.note,
80 'project_id': project and project.id or False,83 'project_id': project and project.id or False,
81 'company_id': procurement.company_id.id,84 'company_id': procurement.company_id.id,
85 'partner_id': procurement.sale_line_id and procurement.sale_line_id.order_id.partner_id.id,
82 },context=context)86 },context=context)
83 self.write(cr, uid, [procurement.id], {'task_id': task_id, 'state': 'running'}, context=context)87 self.write(cr, uid, [procurement.id], {'task_id': task_id, 'state': 'running', 'message':_('Task created.')}, context=context)
84 return task_id88 return task_id
8589
86procurement_order()90procurement_order()
8791
=== modified file 'project_timesheet/project_timesheet.py'
--- project_timesheet/project_timesheet.py 2012-01-31 13:36:57 +0000
+++ project_timesheet/project_timesheet.py 2014-04-22 12:10:57 +0000
@@ -142,10 +142,6 @@
142 vals_line['name'] = '%s: %s' % (tools.ustr(task.task_id.name), tools.ustr(vals['name']) or '/')142 vals_line['name'] = '%s: %s' % (tools.ustr(task.task_id.name), tools.ustr(vals['name']) or '/')
143 if 'user_id' in vals:143 if 'user_id' in vals:
144 vals_line['user_id'] = vals['user_id']144 vals_line['user_id'] = vals['user_id']
145 result = self.get_user_related_details(cr, uid, vals['user_id'])
146 for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'):
147 if result.get(fld, False):
148 vals_line[fld] = result[fld]
149 145
150 if 'date' in vals:146 if 'date' in vals:
151 vals_line['date'] = vals['date'][:10]147 vals_line['date'] = vals['date'][:10]
@@ -153,6 +149,10 @@
153 default_uom = self.pool.get('res.users').browse(cr, uid, uid).company_id.project_time_mode_id.id149 default_uom = self.pool.get('res.users').browse(cr, uid, uid).company_id.project_time_mode_id.id
154 vals_line['unit_amount'] = vals['hours']150 vals_line['unit_amount'] = vals['hours']
155 prod_id = vals_line.get('product_id', line_id.product_id.id) # False may be set151 prod_id = vals_line.get('product_id', line_id.product_id.id) # False may be set
152 result = self.get_user_related_details(cr, uid, vals.get('user_id', task.user_id.id))
153 for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'):
154 if result.get(fld, False):
155 vals_line[fld] = result[fld]
156156
157 if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom):157 if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom):
158 vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id'])158 vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id'])
@@ -165,7 +165,9 @@
165 if amount_unit and 'amount' in amount_unit.get('value',{}):165 if amount_unit and 'amount' in amount_unit.get('value',{}):
166 vals_line['amount'] = amount_unit['value']['amount']166 vals_line['amount'] = amount_unit['value']['amount']
167167
168 self.pool.get('hr.analytic.timesheet').write(cr, uid, [line_id.id], vals_line, context=context)168 #workaround for lp:1023047
169 if vals_line:
170 self.pool.get('hr.analytic.timesheet').write(cr, uid, [line_id.id], vals_line, context=context)
169 171
170 return super(project_work,self).write(cr, uid, ids, vals, context)172 return super(project_work,self).write(cr, uid, ids, vals, context)
171173
172174
=== modified file 'purchase/purchase.py' (properties changed: -x to +x)
--- purchase/purchase.py 2012-10-09 12:16:14 +0000
+++ purchase/purchase.py 2014-04-22 12:10:57 +0000
@@ -294,6 +294,20 @@
294 self.write(cr, uid, [id], {'state' : 'confirmed', 'validator' : uid})294 self.write(cr, uid, [id], {'state' : 'confirmed', 'validator' : uid})
295 return True295 return True
296296
297 def _choose_account_from_po_line(self, cr, uid, po_line, context=None):
298 fiscal_obj = self.pool.get('account.fiscal.position')
299 property_obj = self.pool.get('ir.property')
300 if po_line.product_id:
301 acc_id = po_line.product_id.property_account_expense.id
302 if not acc_id:
303 acc_id = po_line.product_id.categ_id.property_account_expense_categ.id
304 if not acc_id:
305 raise osv.except_osv(_('Error!'), _('Define expense account for this company: "%s" (id:%d).') % (po_line.product_id.name, po_line.product_id.id,))
306 else:
307 acc_id = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category').id
308 fpos = po_line.order_id.fiscal_position or False
309 return fiscal_obj.map_account(cr, uid, fpos, acc_id)
310
297 def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):311 def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None):
298 """Collects require data from purchase order line that is used to create invoice line 312 """Collects require data from purchase order line that is used to create invoice line
299 for that purchase order line313 for that purchase order line
@@ -338,8 +352,6 @@
338 journal_obj = self.pool.get('account.journal')352 journal_obj = self.pool.get('account.journal')
339 inv_obj = self.pool.get('account.invoice')353 inv_obj = self.pool.get('account.invoice')
340 inv_line_obj = self.pool.get('account.invoice.line')354 inv_line_obj = self.pool.get('account.invoice.line')
341 fiscal_obj = self.pool.get('account.fiscal.position')
342 property_obj = self.pool.get('ir.property')
343355
344 for order in self.browse(cr, uid, ids, context=context):356 for order in self.browse(cr, uid, ids, context=context):
345 pay_acc_id = order.partner_id.property_account_payable.id357 pay_acc_id = order.partner_id.property_account_payable.id
@@ -351,16 +363,7 @@
351 # generate invoice line correspond to PO line and link that to created invoice (inv_id) and PO line363 # generate invoice line correspond to PO line and link that to created invoice (inv_id) and PO line
352 inv_lines = []364 inv_lines = []
353 for po_line in order.order_line:365 for po_line in order.order_line:
354 if po_line.product_id:366 acc_id = self._choose_account_from_po_line(cr, uid, po_line, context=context)
355 acc_id = po_line.product_id.product_tmpl_id.property_account_expense.id
356 if not acc_id:
357 acc_id = po_line.product_id.categ_id.property_account_expense_categ.id
358 if not acc_id:
359 raise osv.except_osv(_('Error !'), _('There is no expense account defined for this product: "%s" (id:%d)') % (po_line.product_id.name, po_line.product_id.id,))
360 else:
361 acc_id = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category').id
362 fpos = order.fiscal_position or False
363 acc_id = fiscal_obj.map_account(cr, uid, fpos, acc_id)
364367
365 inv_line_data = self._prepare_inv_line(cr, uid, acc_id, po_line, context=context)368 inv_line_data = self._prepare_inv_line(cr, uid, acc_id, po_line, context=context)
366 inv_line_id = inv_line_obj.create(cr, uid, inv_line_data, context=context)369 inv_line_id = inv_line_obj.create(cr, uid, inv_line_data, context=context)
@@ -539,7 +542,6 @@
539 @param context: A standard dictionary542 @param context: A standard dictionary
540543
541 @return: new purchase order id544 @return: new purchase order id
542
543 """545 """
544 #TOFIX: merged order line should be unlink546 #TOFIX: merged order line should be unlink
545 wf_service = netsvc.LocalService("workflow")547 wf_service = netsvc.LocalService("workflow")
@@ -590,7 +592,8 @@
590 if porder.notes:592 if porder.notes:
591 order_infos['notes'] = (order_infos['notes'] or '') + ('\n%s' % (porder.notes,))593 order_infos['notes'] = (order_infos['notes'] or '') + ('\n%s' % (porder.notes,))
592 if porder.origin:594 if porder.origin:
593 order_infos['origin'] = (order_infos['origin'] or '') + ' ' + porder.origin595 if not porder.origin in order_infos['origin'] and not order_infos['origin'] in porder.origin:
596 order_infos['origin'] = (order_infos['origin'] or '') + ' ' + porder.origin
594597
595 for order_line in porder.order_line:598 for order_line in porder.order_line:
596 line_key = make_key(order_line, ('name', 'date_planned', 'taxes_id', 'price_unit', 'notes', 'product_id', 'move_dest_id', 'account_analytic_id'))599 line_key = make_key(order_line, ('name', 'date_planned', 'taxes_id', 'price_unit', 'notes', 'product_id', 'move_dest_id', 'account_analytic_id'))
@@ -781,7 +784,7 @@
781784
782 qty = qty or 1.0785 qty = qty or 1.0
783 supplierinfo = False786 supplierinfo = False
784 supplierinfo_ids = product_supplierinfo.search(cr, uid, [('name','=',partner_id),('product_id','=',product.id)])787 supplierinfo_ids = product_supplierinfo.search(cr, uid, [('name', '=', partner_id),('product_id', '=', product.product_tmpl_id.id)])
785 if supplierinfo_ids:788 if supplierinfo_ids:
786 supplierinfo = product_supplierinfo.browse(cr, uid, supplierinfo_ids[0], context=context)789 supplierinfo = product_supplierinfo.browse(cr, uid, supplierinfo_ids[0], context=context)
787 if supplierinfo.product_uom.id != uom_id:790 if supplierinfo.product_uom.id != uom_id:
@@ -799,8 +802,12 @@
799 price = product_pricelist.price_get(cr, uid, [pricelist_id],802 price = product_pricelist.price_get(cr, uid, [pricelist_id],
800 product.id, qty or 1.0, partner_id, {'uom': uom_id, 'date': date_order})[pricelist_id]803 product.id, qty or 1.0, partner_id, {'uom': uom_id, 'date': date_order})[pricelist_id]
801 804
802 taxes = account_tax.browse(cr, uid, map(lambda x: x.id, product.supplier_taxes_id))
803 fpos = fiscal_position_id and account_fiscal_position.browse(cr, uid, fiscal_position_id, context=context) or False805 fpos = fiscal_position_id and account_fiscal_position.browse(cr, uid, fiscal_position_id, context=context) or False
806 a = product.product_tmpl_id.property_account_expense.id
807 if not a:
808 a = product.categ_id.property_account_expense_categ.id
809 a = account_fiscal_position.map_account(cr, uid, fpos, a)
810 taxes = product.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids)
804 taxes_ids = account_fiscal_position.map_tax(cr, uid, fpos, taxes)811 taxes_ids = account_fiscal_position.map_tax(cr, uid, fpos, taxes)
805 res['value'].update({'price_unit': price, 'taxes_id': taxes_ids})812 res['value'].update({'price_unit': price, 'taxes_id': taxes_ids})
806813
807814
=== modified file 'purchase/purchase_view.xml'
--- purchase/purchase_view.xml 2012-10-23 07:56:26 +0000
+++ purchase/purchase_view.xml 2014-04-22 12:10:57 +0000
@@ -173,7 +173,7 @@
173 <notebook colspan="4">173 <notebook colspan="4">
174 <page string="Purchase Order">174 <page string="Purchase Order">
175 <field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="[('supplier', '=', True)]" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}" options='{"quick_create": false}'/>175 <field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="[('supplier', '=', True)]" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}" options='{"quick_create": false}'/>
176 <field name="partner_address_id" options='{"quick_create": false}'/>176 <field name="partner_address_id" options='{"quick_create": false}' context="{'default_partner_id':partner_id}"/>
177 <field domain="[('type','=','purchase')]" name="pricelist_id" groups="base.group_extended"/>177 <field domain="[('type','=','purchase')]" name="pricelist_id" groups="base.group_extended"/>
178 <field name="origin" groups="base.group_extended"/>178 <field name="origin" groups="base.group_extended"/>
179 <newline/>179 <newline/>
180180
=== modified file 'purchase/wizard/purchase_line_invoice.py' (properties changed: -x to +x)
--- purchase/wizard/purchase_line_invoice.py 2011-09-08 09:27:55 +0000
+++ purchase/wizard/purchase_line_invoice.py 2014-04-22 12:10:57 +0000
@@ -48,12 +48,11 @@
48 if record_ids:48 if record_ids:
49 res = False49 res = False
50 invoices = {}50 invoices = {}
51 invoice_obj=self.pool.get('account.invoice')51 invoice_obj = self.pool.get('account.invoice')
52 purchase_line_obj=self.pool.get('purchase.order.line')52 purchase_obj = self.pool.get('purchase.order')
53 property_obj=self.pool.get('ir.property')53 purchase_line_obj = self.pool.get('purchase.order.line')
54 account_fiscal_obj=self.pool.get('account.fiscal.position')54 invoice_line_obj = self.pool.get('account.invoice.line')
55 invoice_line_obj=self.pool.get('account.invoice.line')55 account_jrnl_obj = self.pool.get('account.journal')
56 account_jrnl_obj=self.pool.get('account.journal')
5756
58 def multiple_order_invoice_notes(orders):57 def multiple_order_invoice_notes(orders):
59 notes = ""58 notes = ""
@@ -62,7 +61,6 @@
62 return notes61 return notes
6362
6463
65
66 def make_invoice_by_partner(partner, orders, lines_ids):64 def make_invoice_by_partner(partner, orders, lines_ids):
67 """65 """
68 create a new invoice for one supplier66 create a new invoice for one supplier
@@ -99,37 +97,16 @@
99 order.write({'invoice_ids': [(4, inv_id)]})97 order.write({'invoice_ids': [(4, inv_id)]})
100 return inv_id98 return inv_id
10199
102 for line in purchase_line_obj.browse(cr,uid,record_ids):100 for line in purchase_line_obj.browse(cr, uid, record_ids, context=context):
103 if (not line.invoiced) and (line.state not in ('draft','cancel')):101 if (not line.invoiced) and (line.state not in ('draft', 'cancel')):
104 if not line.partner_id.id in invoices:102 if not line.partner_id.id in invoices:
105 invoices[line.partner_id.id] = []103 invoices[line.partner_id.id] = []
106 if line.product_id:104
107 a = line.product_id.product_tmpl_id.property_account_expense.id105 acc_id = purchase_obj._choose_account_from_po_line(cr, uid, line, context=context)
108 if not a:106 inv_line_data = purchase_obj._prepare_inv_line(cr, uid, acc_id, line, context=context)
109 a = line.product_id.categ_id.property_account_expense_categ.id107 inv_line_data.update({'origin': line.order_id.name})
110 if not a:108 inv_id = invoice_line_obj.create(cr, uid, inv_line_data, context=context)
111 raise osv.except_osv(_('Error !'),109
112 _('There is no expense account defined ' \
113 'for this product: "%s" (id:%d)') % \
114 (line.product_id.name, line.product_id.id,))
115 else:
116 a = property_obj.get(cr, uid,
117 'property_account_expense_categ', 'product.category',
118 context=context).id
119 fpos = line.order_id.fiscal_position or False
120 a = account_fiscal_obj.map_account(cr, uid, fpos, a)
121 inv_id = invoice_line_obj.create(cr, uid, {
122 'name': line.name,
123 'origin': line.order_id.name,
124 'account_id': a,
125 'price_unit': line.price_unit,
126 'quantity': line.product_qty,
127 'uos_id': line.product_uom.id,
128 'product_id': line.product_id.id or False,
129 'invoice_line_tax_id': [(6, 0, [x.id for x in line.taxes_id])],
130 'note': line.notes,
131 'account_analytic_id': line.account_analytic_id and line.account_analytic_id.id or False,
132 })
133 purchase_line_obj.write(cr, uid, [line.id], {'invoiced': True, 'invoice_lines': [(4, inv_id)]})110 purchase_line_obj.write(cr, uid, [line.id], {'invoiced': True, 'invoice_lines': [(4, inv_id)]})
134 invoices[line.partner_id.id].append((line,inv_id))111 invoices[line.partner_id.id].append((line,inv_id))
135112
136113
=== modified file 'purchase_requisition/wizard/purchase_requisition_partner_view.xml'
--- purchase_requisition/wizard/purchase_requisition_partner_view.xml 2011-01-14 00:11:01 +0000
+++ purchase_requisition/wizard/purchase_requisition_partner_view.xml 2014-04-22 12:10:57 +0000
@@ -9,7 +9,7 @@
9 <form string="Purchase Requisition">9 <form string="Purchase Requisition">
10 <group colspan="2" col="2">10 <group colspan="2" col="2">
11 <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>11 <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
12 <field domain="[('partner_id','=',partner_id)]" name="partner_address_id"/>12 <field name="partner_address_id" domain="[('partner_id','=',partner_id)]" options='{"quick_create": false}' context="{'default_partner_id':partner_id}" />
13 <separator string="" colspan="4" />13 <separator string="" colspan="4" />
14 <button icon="gtk-cancel" special="cancel" string="_Cancel"/>14 <button icon="gtk-cancel" special="cancel" string="_Cancel"/>
15 <button icon="gtk-ok" name="create_order" string="Create Quotation" type="object"/>15 <button icon="gtk-ok" name="create_order" string="Create Quotation" type="object"/>
1616
=== modified file 'sale/report/sale_order.rml'
--- sale/report/sale_order.rml 2012-12-17 09:49:00 +0000
+++ sale/report/sale_order.rml 2014-04-22 12:10:57 +0000
@@ -126,33 +126,8 @@
126 <images/>126 <images/>
127 </stylesheet>127 </stylesheet>
128 <story>128 <story>
129 <pto>
130 <para style="terp_default_8">[[repeatIn(objects,'o')]]</para>129 <para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
131 <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>130 <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
132 <pto_header>
133 <blockTable colWidths="181.0,70.0,80.0,70.0,50.0,85.0" repeatRows="1" style="Table4">
134 <tr>
135 <td>
136 <para style="terp_tblheader_Details">Description</para>
137 </td>
138 <td>
139 <para style="terp_tblheader_Details_Centre">VAT</para>
140 </td>
141 <td>
142 <para style="terp_tblheader_Details_Right">Quantity</para>
143 </td>
144 <td>
145 <para style="terp_tblheader_Details_Right">Unit Price</para>
146 </td>
147 <td>
148 <para style="terp_tblheader_Details_Centre">Disc.(%)</para>
149 </td>
150 <td>
151 <para style="terp_tblheader_Details_Right">Price</para>
152 </td>
153 </tr>
154 </blockTable>
155 </pto_header>
156 <para style="terp_default_9">131 <para style="terp_default_9">
157 <font color="white"> </font>132 <font color="white"> </font>
158 </para>133 </para>
@@ -233,6 +208,31 @@
233 <para style="terp_default_8">208 <para style="terp_default_8">
234 <font color="white"> </font>209 <font color="white"> </font>
235 </para>210 </para>
211 <pto>
212 <pto_header>
213 <blockTable colWidths="181.0,70.0,80.0,70.0,50.0,85.0" repeatRows="1" style="Table4">
214 <tr>
215 <td>
216 <para style="terp_tblheader_Details">Description</para>
217 </td>
218 <td>
219 <para style="terp_tblheader_Details_Centre">VAT</para>
220 </td>
221 <td>
222 <para style="terp_tblheader_Details_Right">Quantity</para>
223 </td>
224 <td>
225 <para style="terp_tblheader_Details_Right">Unit Price</para>
226 </td>
227 <td>
228 <para style="terp_tblheader_Details_Centre">Disc.(%)</para>
229 </td>
230 <td>
231 <para style="terp_tblheader_Details_Right">Price</para>
232 </td>
233 </tr>
234 </blockTable>
235 </pto_header>
236 <blockTable colWidths="181.0,70.0,80.0,70.0,50.0,85.0" repeatRows="1" style="Table4">236 <blockTable colWidths="181.0,70.0,80.0,70.0,50.0,85.0" repeatRows="1" style="Table4">
237 <tr>237 <tr>
238 <td>238 <td>
@@ -310,6 +310,7 @@
310 </tr>310 </tr>
311 </blockTable>311 </blockTable>
312 </section>312 </section>
313 </pto>
313 <blockTable colWidths="381.0,60.0,93.0" style="Table6">314 <blockTable colWidths="381.0,60.0,93.0" style="Table6">
314 <tr>315 <tr>
315 <td>316 <td>
@@ -365,6 +366,5 @@
365 <para style="terp_default_8">366 <para style="terp_default_8">
366 <font color="white"> </font>367 <font color="white"> </font>
367 </para>368 </para>
368 </pto>
369 </story>369 </story>
370</document>370</document>
371371
=== modified file 'sale/report/sale_report_view.xml'
--- sale/report/sale_report_view.xml 2011-12-19 16:54:40 +0000
+++ sale/report/sale_report_view.xml 2014-04-22 12:10:57 +0000
@@ -52,7 +52,7 @@
52 <search string="Sales Analysis">52 <search string="Sales Analysis">
53 <group>53 <group>
54 <filter icon="terp-go-year" string="Year" name="year"54 <filter icon="terp-go-year" string="Year" name="year"
55 domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-01-01'))]"55 domain="[('date','&lt;=', time.strftime('%%Y-12-31')),('date','&gt;=',time.strftime('%%Y-01-01'))]"
56 help="Sales order created in current year"/>56 help="Sales order created in current year"/>
57 <separator orientation="vertical"/>57 <separator orientation="vertical"/>
58 <filter icon="terp-go-month" string="Month"58 <filter icon="terp-go-month" string="Month"
5959
=== modified file 'sale/sale.py'
--- sale/sale.py 2012-10-09 12:16:14 +0000
+++ sale/sale.py 2014-04-22 12:10:57 +0000
@@ -756,7 +756,7 @@
756 return {756 return {
757 'name': pick_name,757 'name': pick_name,
758 'origin': order.name,758 'origin': order.name,
759 'date': order.date_order,759 'date': order.date_confirm,
760 'type': 'out',760 'type': 'out',
761 'state': 'auto',761 'state': 'auto',
762 'move_type': order.picking_policy,762 'move_type': order.picking_policy,
@@ -822,7 +822,7 @@
822 if line.state == 'done':822 if line.state == 'done':
823 continue823 continue
824824
825 date_planned = self._get_date_planned(cr, uid, order, line, order.date_order, context=context)825 date_planned = self._get_date_planned(cr, uid, order, line, order.date_confirm, context=context)
826826
827 if line.product_id:827 if line.product_id:
828 if line.product_id.product_tmpl_id.type in ('product', 'consu'):828 if line.product_id.product_tmpl_id.type in ('product', 'consu'):
@@ -1206,6 +1206,7 @@
1206 product_uom_obj = self.pool.get('product.uom')1206 product_uom_obj = self.pool.get('product.uom')
1207 partner_obj = self.pool.get('res.partner')1207 partner_obj = self.pool.get('res.partner')
1208 product_obj = self.pool.get('product.product')1208 product_obj = self.pool.get('product.product')
1209 fpos_obj = self.pool.get('account.fiscal.position')
1209 context = dict(context, lang=lang, partner_id=partner_id)1210 context = dict(context, lang=lang, partner_id=partner_id)
1210 if partner_id:1211 if partner_id:
1211 lang = partner_obj.browse(cr, uid, partner_id, context=context).lang1212 lang = partner_obj.browse(cr, uid, partner_id, context=context).lang
@@ -1241,7 +1242,12 @@
1241 fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position, context=context) or False1242 fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position, context=context) or False
1242 if update_tax: #The quantity only have changed1243 if update_tax: #The quantity only have changed
1243 result['delay'] = (product_obj.sale_delay or 0.0)1244 result['delay'] = (product_obj.sale_delay or 0.0)
1244 result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id)1245 a = product_obj.product_tmpl_id.property_account_income.id
1246 if not a:
1247 a = product_obj.categ_id.property_account_income_categ.id
1248 a = fpos_obj.map_account(cr, uid, fpos, a)
1249 taxes = product_obj.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids)
1250 result['tax_id'] = fpos_obj.map_tax(cr, uid, fpos, taxes)
1245 result.update({'type': product_obj.procure_method})1251 result.update({'type': product_obj.procure_method})
12461252
1247 if not flag:1253 if not flag:
12481254
=== modified file 'sale/sale_view.xml'
--- sale/sale_view.xml 2013-01-02 11:50:01 +0000
+++ sale/sale_view.xml 2014-04-22 12:10:57 +0000
@@ -116,9 +116,9 @@
116 <notebook colspan="5">116 <notebook colspan="5">
117 <page string="Sales Order">117 <page string="Sales Order">
118 <field name="partner_id" options='{"quick_create": false}' on_change="onchange_partner_id(partner_id)" domain="[('customer','=',True)]" context="{'search_default_customer':1}" required="1"/>118 <field name="partner_id" options='{"quick_create": false}' on_change="onchange_partner_id(partner_id)" domain="[('customer','=',True)]" context="{'search_default_customer':1}" required="1"/>
119 <field domain="[('partner_id','=',partner_id)]" name="partner_order_id" on_change="onchange_partner_order_id(partner_order_id, partner_invoice_id, partner_shipping_id)" options='{"quick_create": false}'/>119 <field domain="[('partner_id','=',partner_id)]" name="partner_order_id" on_change="onchange_partner_order_id(partner_order_id, partner_invoice_id, partner_shipping_id)" options='{"quick_create": false}' context="{'default_partner_id':partner_id}"/>
120 <field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id" groups="base.group_extended" options='{"quick_create": false}'/>120 <field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id" groups="base.group_extended" options='{"quick_create": false}' context="{'default_partner_id':partner_id}"/>
121 <field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id" groups="base.group_extended" options='{"quick_create": false}'/>121 <field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id" groups="base.group_extended" options='{"quick_create": false}' context="{'default_partner_id':partner_id}"/>
122 <field domain="[('type','=','sale')]" name="pricelist_id" groups="base.group_extended" on_change="onchange_pricelist_id(pricelist_id,order_line)"/>122 <field domain="[('type','=','sale')]" name="pricelist_id" groups="base.group_extended" on_change="onchange_pricelist_id(pricelist_id,order_line)"/>
123 <field name="project_id" context="{'partner_id':partner_id, 'contact_id':partner_order_id, 'pricelist_id':pricelist_id, 'default_name':name}" groups="analytic.group_analytic_accounting" domain="[('type','&lt;&gt;','view'), ('company_id', '=', company_id), ('parent_id', '!=', False)]"/>123 <field name="project_id" context="{'partner_id':partner_id, 'contact_id':partner_order_id, 'pricelist_id':pricelist_id, 'default_name':name}" groups="analytic.group_analytic_accounting" domain="[('type','&lt;&gt;','view'), ('company_id', '=', company_id), ('parent_id', '!=', False)]"/>
124 <newline/>124 <newline/>
125125
=== modified file 'stock/report/report_stock_move.py'
--- stock/report/report_stock_move.py 2013-04-04 12:46:09 +0000
+++ stock/report/report_stock_move.py 2014-04-22 12:10:57 +0000
@@ -153,7 +153,8 @@
153 'date': fields.datetime('Date', readonly=True),153 'date': fields.datetime('Date', readonly=True),
154 'year': fields.char('Year', size=4, readonly=True),154 'year': fields.char('Year', size=4, readonly=True),
155 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),155 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
156 ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September')]),156 ('05', 'May'), ('06', 'June'), ('07', 'July'), ('08', 'August'), ('09', 'September'),
157 ('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly = True),
157 'partner_id':fields.many2one('res.partner.address', 'Partner', readonly=True),158 'partner_id':fields.many2one('res.partner.address', 'Partner', readonly=True),
158 'product_id':fields.many2one('product.product', 'Product', readonly=True),159 'product_id':fields.many2one('product.product', 'Product', readonly=True),
159 'product_categ_id':fields.many2one('product.category', 'Product Category', readonly=True),160 'product_categ_id':fields.many2one('product.category', 'Product Category', readonly=True),
@@ -173,6 +174,8 @@
173CREATE OR REPLACE view report_stock_inventory AS (174CREATE OR REPLACE view report_stock_inventory AS (
174 (SELECT175 (SELECT
175 min(m.id) as id, m.date as date,176 min(m.id) as id, m.date as date,
177 to_char(m.date, 'YYYY') as year,
178 to_char(m.date, 'MM') as month,
176 m.address_id as partner_id, m.location_id as location_id,179 m.address_id as partner_id, m.location_id as location_id,
177 m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,180 m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
178 m.company_id,181 m.company_id,
@@ -196,6 +199,8 @@
196) UNION ALL (199) UNION ALL (
197 SELECT200 SELECT
198 -m.id as id, m.date as date,201 -m.id as id, m.date as date,
202 to_char(m.date, 'YYYY') as year,
203 to_char(m.date, 'MM') as month,
199 m.address_id as partner_id, m.location_dest_id as location_id,204 m.address_id as partner_id, m.location_dest_id as location_id,
200 m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,205 m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
201 m.company_id,206 m.company_id,
202207
=== modified file 'stock/stock.py'
--- stock/stock.py 2013-10-02 13:19:11 +0000
+++ stock/stock.py 2014-04-22 12:10:57 +0000
@@ -1268,7 +1268,7 @@
1268 'product_uos_qty': product_qty, #TODO: put correct uos_qty1268 'product_uos_qty': product_qty, #TODO: put correct uos_qty
1269 'picking_id' : new_picking,1269 'picking_id' : new_picking,
1270 'state': 'assigned',1270 'state': 'assigned',
1271 'move_dest_id': False,1271 'move_dest_id': move.move_dest_id.id,
1272 'price_unit': move.price_unit,1272 'price_unit': move.price_unit,
1273 'product_uom': product_uoms[move.id]1273 'product_uom': product_uoms[move.id]
1274 }1274 }
@@ -2572,7 +2572,7 @@
2572 'product_uos_qty': product_qty,2572 'product_uos_qty': product_qty,
2573 'picking_id' : move.picking_id.id,2573 'picking_id' : move.picking_id.id,
2574 'state': 'assigned',2574 'state': 'assigned',
2575 'move_dest_id': False,2575 'move_dest_id': move.move_dest_id.id,
2576 'price_unit': move.price_unit,2576 'price_unit': move.price_unit,
2577 }2577 }
2578 prodlot_id = prodlot_ids[move.id]2578 prodlot_id = prodlot_ids[move.id]
25792579
=== modified file 'stock/wizard/stock_return_picking.py'
--- stock/wizard/stock_return_picking.py 2013-10-01 14:45:37 +0000
+++ stock/wizard/stock_return_picking.py 2014-04-22 12:10:57 +0000
@@ -72,9 +72,10 @@
72 res.update({'invoice_state': 'none'})72 res.update({'invoice_state': 'none'})
73 return_history = self.get_return_history(cr, uid, record_id, context) 73 return_history = self.get_return_history(cr, uid, record_id, context)
74 for line in pick.move_lines:74 for line in pick.move_lines:
75 qty = line.product_qty - return_history[line.id]75 if line.state <> 'cancel':
76 if qty > 0:76 qty = line.product_qty - return_history[line.id]
77 result1.append({'product_id': line.product_id.id, 'quantity': qty,'move_id':line.id})77 if qty > 0:
78 result1.append({'product_id': line.product_id.id, 'quantity': qty,'move_id':line.id})
78 if 'product_return_moves' in fields:79 if 'product_return_moves' in fields:
79 res.update({'product_return_moves': result1})80 res.update({'product_return_moves': result1})
80 return res81 return res
@@ -128,7 +129,7 @@
128 # a valid return move will be the exact opposite of ours:129 # a valid return move will be the exact opposite of ours:
129 # (src location, dest location) <=> (dest location, src location))130 # (src location, dest location) <=> (dest location, src location))
130 if rec.location_dest_id.id == m.location_id.id \131 if rec.location_dest_id.id == m.location_id.id \
131 and rec.location_id.id == m.location_dest_id.id:132 and rec.location_id.id == m.location_dest_id.id and rec.state != 'cancel':
132 return_history[m.id] += (rec.product_qty * rec.product_uom.factor)133 return_history[m.id] += (rec.product_qty * rec.product_uom.factor)
133 return return_history134 return return_history
134135
@@ -166,9 +167,14 @@
166 new_type = 'internal'167 new_type = 'internal'
167 seq_obj_name = 'stock.picking.' + new_type168 seq_obj_name = 'stock.picking.' + new_type
168 new_pick_name = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name)169 new_pick_name = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name)
169 new_picking = pick_obj.copy(cr, uid, pick.id, {'name':'%s-%s-return' % (new_pick_name, pick.name),170 new_picking = pick_obj.copy(cr, uid, pick.id, {
170 'move_lines':[], 'state':'draft', 'type':new_type,171 'name':'%s-%s-return' % (new_pick_name, pick.name),
171 'date':date_cur, 'invoice_state':data['invoice_state'],})172 'move_lines':[],
173 'state':'draft',
174 'backorder_id': False,
175 'type':new_type,
176 'date':date_cur,
177 'invoice_state':data['invoice_state'],})
172 178
173 val_id = data['product_return_moves']179 val_id = data['product_return_moves']
174 for v in val_id:180 for v in val_id:
175181
=== modified file 'users_ldap/users_ldap.py'
--- users_ldap/users_ldap.py 2014-01-27 13:36:44 +0000
+++ users_ldap/users_ldap.py 2014-04-22 12:10:57 +0000
@@ -184,7 +184,7 @@
184 """184 """
185 185
186 user_id = False186 user_id = False
187 login = tools.ustr(login)187 login = tools.ustr(login.lower())
188 cr.execute("SELECT id, active FROM res_users WHERE login=%s", (login,))188 cr.execute("SELECT id, active FROM res_users WHERE login=%s", (login,))
189 res = cr.fetchone()189 res = cr.fetchone()
190 if res:190 if res:
191191
=== modified file 'warning/warning.py'
--- warning/warning.py 2012-09-06 10:32:09 +0000
+++ warning/warning.py 2014-04-22 12:10:57 +0000
@@ -231,7 +231,7 @@
231class purchase_order_line(osv.osv):231class purchase_order_line(osv.osv):
232 _inherit = 'purchase.order.line'232 _inherit = 'purchase.order.line'
233 def onchange_product_id(self,cr, uid, ids, pricelist, product, qty, uom,233 def onchange_product_id(self,cr, uid, ids, pricelist, product, qty, uom,
234 partner_id, date_order=False, fiscal_position=False, date_planned=False,234 partner_id, date_order=False, fiscal_position_id=False, date_planned=False,
235 name=False, price_unit=False, notes=False, context=None):235 name=False, price_unit=False, notes=False, context=None):
236 warning = {}236 warning = {}
237 if not product:237 if not product:
@@ -250,7 +250,7 @@
250 warning['message'] = message250 warning['message'] = message
251251
252 result = super(purchase_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, uom,252 result = super(purchase_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, uom,
253 partner_id, date_order, fiscal_position)253 partner_id, date_order, fiscal_position_id)
254254
255 if result.get('warning',False):255 if result.get('warning',False):
256 warning['title'] = title and title +' & '+result['warning']['title'] or result['warning']['title']256 warning['title'] = title and title +' & '+result['warning']['title'] or result['warning']['title']
257257
=== modified file 'wiki/wiki.py'
--- wiki/wiki.py 2012-03-28 06:02:25 +0000
+++ wiki/wiki.py 2014-04-22 12:10:57 +0000
@@ -81,6 +81,7 @@
81 }81 }
82 group = self.browse(cr, uid, group_id, context=context)82 group = self.browse(cr, uid, group_id, context=context)
83 value['domain'] = "[('group_id','=',%d)]" % (group.id)83 value['domain'] = "[('group_id','=',%d)]" % (group.id)
84 value['context'] = "{'default_group_id': %d}" % (group.id)
84 if group.method == 'page':85 if group.method == 'page':
85 value['res_id'] = group.home.id86 value['res_id'] = group.home.id
86 elif group.method == 'list':87 elif group.method == 'list':
8788
=== modified file 'wiki/wizard/wiki_create_menu.py'
--- wiki/wizard/wiki_create_menu.py 2011-01-14 00:11:01 +0000
+++ wiki/wizard/wiki_create_menu.py 2014-04-22 12:10:57 +0000
@@ -66,6 +66,7 @@
66 }66 }
67 group = obj_wiki_group.browse(cr, uid, group_id, context=context)67 group = obj_wiki_group.browse(cr, uid, group_id, context=context)
68 value['domain'] = "[('group_id','=',%d)]" % (group.id)68 value['domain'] = "[('group_id','=',%d)]" % (group.id)
69 value['context'] = "{'default_group_id': %d}" % (group.id)
69 if group.method == 'page':70 if group.method == 'page':
70 value['res_id'] = group.home.id71 value['res_id'] = group.home.id
71 elif group.method == 'list':72 elif group.method == 'list':
7273
=== modified file 'wiki/wizard/wiki_wiki_page_open.py'
--- wiki/wizard/wiki_wiki_page_open.py 2011-01-14 00:11:01 +0000
+++ wiki/wizard/wiki_wiki_page_open.py 2014-04-22 12:10:57 +0000
@@ -41,6 +41,7 @@
41 for group in self.pool.get('wiki.groups').browse(cr, uid, group_ids, context=context):41 for group in self.pool.get('wiki.groups').browse(cr, uid, group_ids, context=context):
42 value = {42 value = {
43 'domain': "[('group_id','=',%d)]" % (group.id),43 'domain': "[('group_id','=',%d)]" % (group.id),
44 'context': "{'default_group_id': %d}" % (group.id),
44 'name': 'Wiki Page',45 'name': 'Wiki Page',
45 'view_type': 'form',46 'view_type': 'form',
46 'view_mode': 'form,tree',47 'view_mode': 'form,tree',