Merge lp:~camptocamp/openobject-addons/ocb-6.1-fix_1311004_account_move_line_index-afe into lp:openobject-addons/6.1
- ocb-6.1-fix_1311004_account_move_line_index-afe
- Merge into 6.1
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 | ||||
Related bugs: |
|
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.
Commit message
Description of the change
improve reading account_move_lines by using an index on date, id matching _order
port of https:/
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : | # |
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
It seems other revisions were dragged in.
Is it wanted ?
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
1 | === modified file 'account/__init__.py' |
2 | --- account/__init__.py 2011-12-30 11:44:10 +0000 |
3 | +++ account/__init__.py 2014-04-22 12:10:57 +0000 |
4 | @@ -23,6 +23,7 @@ |
5 | import installer |
6 | import project |
7 | import partner |
8 | +import company |
9 | import account_invoice |
10 | import account_bank_statement |
11 | import account_bank |
12 | @@ -34,7 +35,6 @@ |
13 | import report |
14 | import product |
15 | import ir_sequence |
16 | -import company |
17 | import res_currency |
18 | import edi |
19 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
20 | |
21 | === modified file 'account/account.py' |
22 | --- account/account.py 2013-01-23 10:11:30 +0000 |
23 | +++ account/account.py 2014-04-22 12:10:57 +0000 |
24 | @@ -29,6 +29,7 @@ |
25 | from osv import fields, osv |
26 | import decimal_precision as dp |
27 | from tools.translate import _ |
28 | +from openerp.tools.float_utils import float_round |
29 | |
30 | def check_cycle(self, cr, uid, ids, context=None): |
31 | """ climbs the ``self._table.parent_id`` chains for 100 levels or |
32 | @@ -106,7 +107,7 @@ |
33 | 'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \ |
34 | "If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."), |
35 | '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)."), |
36 | - 'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True), |
37 | + 'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True, ondelete='cascade'), |
38 | } |
39 | _defaults = { |
40 | 'value': 'balance', |
41 | @@ -1396,7 +1397,7 @@ |
42 | if not l[0]: |
43 | l[2].update({ |
44 | 'reconcile_id':False, |
45 | - 'reconcil_partial_id':False, |
46 | + 'reconcile_partial_id':False, |
47 | 'analytic_lines':False, |
48 | 'invoice':False, |
49 | 'ref':False, |
50 | @@ -1523,7 +1524,13 @@ |
51 | cr.execute('update account_move_line set '+mode2+'=%s where id=%s', (result, line_id)) |
52 | |
53 | #adjust also the amount in currency if needed |
54 | - 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,)) |
55 | + cr.execute( |
56 | + '''select currency_id, sum(amount_currency) as amount_currency |
57 | + from account_move_line |
58 | + where move_id = %s |
59 | + and currency_id is not null |
60 | + and amount_currency is not null |
61 | + group by currency_id''', (move.id,)) |
62 | for row in cr.dictfetchall(): |
63 | currency_id = currency_obj.browse(cr, uid, row['currency_id'], context=context) |
64 | if not currency_obj.is_zero(cr, uid, currency_id, row['amount_currency']): |
65 | @@ -1855,6 +1862,14 @@ |
66 | return result in the context |
67 | Ex: result=round(price_unit*0.21,4) |
68 | """ |
69 | + |
70 | + def copy_data(self, cr, uid, id, default=None, context=None): |
71 | + if default is None: |
72 | + default = {} |
73 | + name = self.read(cr, uid, id, ['name'], context=context)['name'] |
74 | + default = default.copy() |
75 | + default.update({'name': name + _(' (Copy)')}) |
76 | + return super(account_tax, self).copy_data(cr, uid, id, default=default, context=context) |
77 | |
78 | def get_precision_tax(): |
79 | def change_digit_tax(cr): |
80 | @@ -2070,7 +2085,9 @@ |
81 | cur_price_unit+=amount2 |
82 | return res |
83 | |
84 | - def compute_all(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None, force_excluded=False): |
85 | + def compute_all(self, cr, uid, taxes, price_unit, quantity, |
86 | + address_id=None, product=None, partner=None, force_excluded=False, |
87 | + context=None): |
88 | """ |
89 | :param force_excluded: boolean used to say that we don't want to consider the value of field price_include of |
90 | tax. It's used in encoding by line where you don't matter if you encoded a tax with that boolean to True or |
91 | @@ -2081,8 +2098,25 @@ |
92 | 'taxes': [] # List of taxes, see compute for the format |
93 | } |
94 | """ |
95 | + |
96 | + # By default, for each tax, tax amount will first be computed |
97 | + # and rounded at the 'Account' decimal precision for each |
98 | + # PO/SO/invoice line and then these rounded amounts will be |
99 | + # summed, leading to the total amount for that tax. But, if the |
100 | + # company has tax_calculation_rounding_method = round_globally, |
101 | + # we still follow the same method, but we use a much larger |
102 | + # precision when we round the tax amount for each line (we use |
103 | + # the 'Account' decimal precision + 5), and that way it's like |
104 | + # rounding after the sum of the tax amounts of each line |
105 | precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account') |
106 | - totalin = totalex = round(price_unit * quantity, precision) |
107 | + tax_compute_precision = precision |
108 | + rounding_method = ( |
109 | + (context and context.get('tax_calculation_rounding_method')) |
110 | + or (taxes and taxes[0].company_id.tax_calculation_rounding_method) |
111 | + or 'round_per_line') |
112 | + if rounding_method == 'round_globally': |
113 | + tax_compute_precision += 5 |
114 | + totalin = totalex = float_round(price_unit * quantity, precision) |
115 | tin = [] |
116 | tex = [] |
117 | for tax in taxes: |
118 | @@ -2090,7 +2124,7 @@ |
119 | tex.append(tax) |
120 | else: |
121 | tin.append(tax) |
122 | - tin = self.compute_inv(cr, uid, tin, price_unit, quantity, address_id=address_id, product=product, partner=partner) |
123 | + tin = self.compute_inv(cr, uid, tin, price_unit, quantity, address_id=address_id, product=product, partner=partner, precision=tax_compute_precision) |
124 | for r in tin: |
125 | totalex -= r.get('amount', 0.0) |
126 | totlex_qty = 0.0 |
127 | @@ -2098,7 +2132,7 @@ |
128 | totlex_qty = totalex/quantity |
129 | except: |
130 | pass |
131 | - tex = self._compute(cr, uid, tex, totlex_qty, quantity, address_id=address_id, product=product, partner=partner) |
132 | + tex = self._compute(cr, uid, tex, totlex_qty, quantity, address_id=address_id, product=product, partner=partner, precision=tax_compute_precision) |
133 | for r in tex: |
134 | totalin += r.get('amount', 0.0) |
135 | return { |
136 | @@ -2113,7 +2147,7 @@ |
137 | "Deprecated, use compute_all(...)['taxes'] instead of compute(...) to manage prices with tax included") |
138 | return self._compute(cr, uid, taxes, price_unit, quantity, address_id, product, partner) |
139 | |
140 | - def _compute(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None): |
141 | + def _compute(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None, precision=None): |
142 | """ |
143 | Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID. |
144 | |
145 | @@ -2122,14 +2156,15 @@ |
146 | tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2} |
147 | one tax for each tax id in IDS and their children |
148 | """ |
149 | + if not precision: |
150 | + precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account') |
151 | res = self._unit_compute(cr, uid, taxes, price_unit, address_id, product, partner, quantity) |
152 | total = 0.0 |
153 | - precision_pool = self.pool.get('decimal.precision') |
154 | for r in res: |
155 | if r.get('balance',False): |
156 | - r['amount'] = round(r.get('balance', 0.0) * quantity, precision_pool.precision_get(cr, uid, 'Account')) - total |
157 | + r['amount'] = round(r.get('balance', 0.0) * quantity, precision) - total |
158 | else: |
159 | - r['amount'] = round(r.get('amount', 0.0) * quantity, precision_pool.precision_get(cr, uid, 'Account')) |
160 | + r['amount'] = round(r.get('amount', 0.0) * quantity, precision) |
161 | total += r['amount'] |
162 | return res |
163 | |
164 | @@ -2207,7 +2242,7 @@ |
165 | r['todo'] = 0 |
166 | return res |
167 | |
168 | - def compute_inv(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None): |
169 | + def compute_inv(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None, precision=None): |
170 | """ |
171 | Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID. |
172 | Price Unit is a VAT included price |
173 | @@ -2217,15 +2252,15 @@ |
174 | tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2} |
175 | one tax for each tax id in IDS and their children |
176 | """ |
177 | + if not precision: |
178 | + precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account') |
179 | res = self._unit_compute_inv(cr, uid, taxes, price_unit, address_id, product, partner=None) |
180 | total = 0.0 |
181 | - obj_precision = self.pool.get('decimal.precision') |
182 | for r in res: |
183 | - prec = obj_precision.precision_get(cr, uid, 'Account') |
184 | if r.get('balance',False): |
185 | - r['amount'] = round(r['balance'] * quantity, prec) - total |
186 | + r['amount'] = round(r['balance'] * quantity, precision) - total |
187 | else: |
188 | - r['amount'] = round(r['amount'] * quantity, prec) |
189 | + r['amount'] = round(r['amount'] * quantity, precision) |
190 | total += r['amount'] |
191 | return res |
192 | |
193 | @@ -2323,6 +2358,14 @@ |
194 | |
195 | return move_ids |
196 | |
197 | + def onchange_journal_id(self, cr, uid, ids, journal_id, context=None): |
198 | + company_id = False |
199 | + if journal_id: |
200 | + journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context) |
201 | + if journal.company_id.id: |
202 | + company_id = journal.company_id.id |
203 | + return {'value': {'company_id': company_id}} |
204 | + |
205 | account_model() |
206 | |
207 | class account_model_line(osv.osv): |
208 | |
209 | === modified file 'account/account_invoice.py' |
210 | --- account/account_invoice.py 2013-01-31 10:22:57 +0000 |
211 | +++ account/account_invoice.py 2014-04-22 12:10:57 +0000 |
212 | @@ -91,19 +91,44 @@ |
213 | return [('none', _('Free Reference'))] |
214 | |
215 | def _amount_residual(self, cr, uid, ids, name, args, context=None): |
216 | + if context is None: |
217 | + context = {} |
218 | + ctx = context.copy() |
219 | result = {} |
220 | + currency_obj = self.pool.get('res.currency') |
221 | for invoice in self.browse(cr, uid, ids, context=context): |
222 | - checked_partial_rec_ids = [] |
223 | + nb_inv_in_partial_rec = max_invoice_id = 0 |
224 | result[invoice.id] = 0.0 |
225 | if invoice.move_id: |
226 | - for move_line in invoice.move_id.line_id: |
227 | - if move_line.account_id.type in ('receivable','payable'): |
228 | - if move_line.reconcile_partial_id: |
229 | - partial_reconcile_id = move_line.reconcile_partial_id.id |
230 | - if partial_reconcile_id in checked_partial_rec_ids: |
231 | - continue |
232 | - checked_partial_rec_ids.append(partial_reconcile_id) |
233 | - result[invoice.id] += move_line.amount_residual_currency |
234 | + for aml in invoice.move_id.line_id: |
235 | + if aml.account_id.type in ('receivable','payable'): |
236 | + if aml.currency_id and aml.currency_id.id == invoice.currency_id.id: |
237 | + result[invoice.id] += aml.amount_residual_currency |
238 | + else: |
239 | + ctx['date'] = aml.date |
240 | + result[invoice.id] += currency_obj.compute(cr, uid, aml.company_id.currency_id.id, invoice.currency_id.id, aml.amount_residual, context=ctx) |
241 | + |
242 | + if aml.reconcile_partial_id.line_partial_ids: |
243 | + #we check if the invoice is partially reconciled and if there are other invoices |
244 | + #involved in this partial reconciliation (and we sum these invoices) |
245 | + for line in aml.reconcile_partial_id.line_partial_ids: |
246 | + if line.invoice: |
247 | + nb_inv_in_partial_rec += 1 |
248 | + #store the max invoice id as for this invoice we will make a balance instead of a simple division |
249 | + max_invoice_id = max(max_invoice_id, line.invoice.id) |
250 | + if nb_inv_in_partial_rec: |
251 | + #if there are several invoices in a partial reconciliation, we split the residual by the number |
252 | + #of invoice to have a sum of residual amounts that matches the partner balance |
253 | + new_value = currency_obj.round(cr, uid, invoice.currency_id, result[invoice.id] / nb_inv_in_partial_rec) |
254 | + if invoice.id == max_invoice_id: |
255 | + #if it's the last the invoice of the bunch of invoices partially reconciled together, we make a |
256 | + #balance to avoid rounding errors |
257 | + result[invoice.id] = result[invoice.id] - ((nb_inv_in_partial_rec - 1) * new_value) |
258 | + else: |
259 | + result[invoice.id] = new_value |
260 | + |
261 | + #prevent the residual amount on the invoice to be less than 0 |
262 | + result[invoice.id] = max(result[invoice.id], 0.0) |
263 | return result |
264 | |
265 | # Give Journal Items related to the payment reconciled to this invoice |
266 | @@ -284,8 +309,40 @@ |
267 | 'payment_ids': fields.function(_compute_lines, relation='account.move.line', type="many2many", string='Payments'), |
268 | 'move_name': fields.char('Journal Entry', size=64, readonly=True, states={'draft':[('readonly',False)]}), |
269 | 'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}), |
270 | - 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True, states={'draft':[('readonly',False)]}) |
271 | + 'fiscal_position': fields.many2one('account.fiscal.position', |
272 | + 'Fiscal Position', readonly=True, |
273 | + states={'draft':[('readonly',False)]}), |
274 | + 'tax_calculation_rounding_method': fields.selection([ |
275 | + ('round_per_line', 'Round per line'), |
276 | + ('round_globally', 'Round globally'), |
277 | + ], 'Tax calculation rounding method', |
278 | + help='''If you select 'Round per line' : for each tax, the tax |
279 | +amount will first be computed and rounded for each PO/SO/invoice line and then |
280 | +these rounded amounts will be summed, leading to the total amount for that tax. |
281 | +If you select 'Round globally': for each tax, the tax amount will be computed |
282 | +for each PO/SO/invoice line, then these amounts will be summed and eventually |
283 | +this total tax amount will be rounded. If you sell with tax included, you |
284 | +should choose 'Round per line' because you certainly want the sum of your |
285 | +tax-included line subtotals to be equal to the total amount with taxes.'''), |
286 | } |
287 | + |
288 | + def _get_company_rounding(self, cr, uid, company_id, context=None): |
289 | + res = 'round_per_line' |
290 | + if company_id: |
291 | + company_model = self.pool.get('res.company') |
292 | + company_obj = company_model.browse( |
293 | + cr, uid, company_id, context=context) |
294 | + if company_obj and company_obj['tax_calculation_rounding_method']: |
295 | + res = company_obj['tax_calculation_rounding_method'] |
296 | + return res |
297 | + |
298 | + def _get_default_rounding_method(self, cr, uid, context=None): |
299 | + # default rounding depends on company. We start with default company |
300 | + company_model = self.pool.get('res.company') |
301 | + company_id = company_model._company_default_get( |
302 | + cr, uid, 'account.invoice', context=context) |
303 | + return self._get_company_rounding(cr, uid, company_id, context) |
304 | + |
305 | _defaults = { |
306 | 'type': _get_type, |
307 | 'state': 'draft', |
308 | @@ -296,6 +353,7 @@ |
309 | 'check_total': 0.0, |
310 | 'internal_number': False, |
311 | 'user_id': lambda s, cr, u, c: u, |
312 | + 'tax_calculation_rounding_method': _get_default_rounding_method, |
313 | } |
314 | _sql_constraints = [ |
315 | ('number_uniq', 'unique(number, company_id, journal_id, type)', 'Invoice Number must be unique per Company!'), |
316 | @@ -516,6 +574,9 @@ |
317 | obj_journal = self.pool.get('account.journal') |
318 | account_obj = self.pool.get('account.account') |
319 | inv_line_obj = self.pool.get('account.invoice.line') |
320 | + if company_id: |
321 | + val['tax_calculation_rounding_method'] = ( |
322 | + self._get_company_rounding(cr, uid, company_id)) |
323 | if company_id and part_id and type: |
324 | acc_id = False |
325 | partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id) |
326 | @@ -1026,6 +1087,23 @@ |
327 | self.log(cr, uid, inv_id, message, context=ctx) |
328 | return True |
329 | |
330 | + def action_proforma(self, cr, uid, ids, context=None): |
331 | + """ |
332 | + Check if all taxes are present with the correct base amount |
333 | + on creating a proforma invoice. This leaves room for manual |
334 | + corrections of the tax amount. |
335 | + """ |
336 | + if not ids: |
337 | + return True |
338 | + if isinstance(ids, (int, long)): |
339 | + ids = [ids] |
340 | + ait_obj = self.pool.get('account.invoice.tax') |
341 | + for inv in self.browse(cr, uid, ids, context=context): |
342 | + compute_taxes = ait_obj.compute(cr, uid, inv.id, context=context) |
343 | + self.check_tax_lines(cr, uid, inv, compute_taxes, ait_obj) |
344 | + return self.write( |
345 | + cr, uid, ids, {'state': 'proforma2'}, context=context) |
346 | + |
347 | def action_cancel(self, cr, uid, ids, *args): |
348 | context = {} # TODO: Use context from arguments |
349 | account_move_obj = self.pool.get('account.move') |
350 | @@ -1268,9 +1346,17 @@ |
351 | res = {} |
352 | tax_obj = self.pool.get('account.tax') |
353 | cur_obj = self.pool.get('res.currency') |
354 | + local_context = {} |
355 | for line in self.browse(cr, uid, ids): |
356 | price = line.price_unit * (1-(line.discount or 0.0)/100.0) |
357 | - 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) |
358 | + local_context['tax_calculation_rounding_method'] = ( |
359 | + line.invoice_id.tax_calculation_rounding_method) |
360 | + taxes = tax_obj.compute_all( |
361 | + cr, uid, line.invoice_line_tax_id, price, line.quantity, |
362 | + product=line.product_id, |
363 | + address_id=line.invoice_id.address_invoice_id, |
364 | + partner=line.invoice_id.partner_id, |
365 | + context=local_context) |
366 | res[line.id] = taxes['total'] |
367 | if line.invoice_id: |
368 | cur = line.invoice_id.currency_id |
369 | @@ -1380,11 +1466,19 @@ |
370 | else: |
371 | 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) |
372 | tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes) |
373 | - |
374 | - if type in ('in_invoice', 'in_refund'): |
375 | - result.update( {'price_unit': price_unit or res.standard_price,'invoice_line_tax_id': tax_id} ) |
376 | - else: |
377 | - result.update({'price_unit': res.list_price, 'invoice_line_tax_id': tax_id}) |
378 | + result['invoice_line_tax_id'] = tax_id |
379 | + |
380 | + warning = {} |
381 | + # When product changes, price ALWAYS need to be reset. If not price |
382 | + # found in product, or pricelist, it should become False. Only if |
383 | + # product_id has been cleared by user, we will leave price_unit as is. |
384 | + if product: |
385 | + price_unit, pu_warning = self._price_unit_get( |
386 | + cr, uid, product, uom, qty, type, partner_id, |
387 | + currency_id, context=context) |
388 | + result['price_unit'] = price_unit # might be False |
389 | + warning.update(pu_warning) |
390 | + |
391 | result['name'] = res.partner_ref |
392 | |
393 | domain = {} |
394 | @@ -1395,27 +1489,88 @@ |
395 | if res2: |
396 | domain = {'uos_id':[('category_id','=',res2 )]} |
397 | |
398 | - res_final = {'value':result, 'domain':domain} |
399 | - |
400 | - if not company_id or not currency_id: |
401 | - return res_final |
402 | - |
403 | - company = self.pool.get('res.company').browse(cr, uid, company_id, context=context) |
404 | - currency = self.pool.get('res.currency').browse(cr, uid, currency_id, context=context) |
405 | - |
406 | - if company.currency_id.id != currency.id: |
407 | - if type in ('in_invoice', 'in_refund'): |
408 | - res_final['value']['price_unit'] = res.standard_price |
409 | - new_price = res_final['value']['price_unit'] * currency.rate |
410 | - res_final['value']['price_unit'] = new_price |
411 | - |
412 | - if uom: |
413 | - uom = self.pool.get('product.uom').browse(cr, uid, uom, context=context) |
414 | - if res.uom_id.category_id.id == uom.category_id.id: |
415 | - new_price = res_final['value']['price_unit'] * uom.factor_inv |
416 | - res_final['value']['price_unit'] = new_price |
417 | + res_final = {'value': result, 'domain': domain, 'warning': warning} |
418 | return res_final |
419 | |
420 | + def _price_unit_get( |
421 | + self, cr, uid, product_id, uom_id, qty, invoice_type, partner_id, |
422 | + currency_id, context=None): |
423 | + price_unit = False |
424 | + warning = {} |
425 | + standard_currency_id = currency_id |
426 | + partner_model = self.pool.get('res.partner') |
427 | + partner_obj = partner_model.browse( |
428 | + cr, uid, partner_id, context=context) |
429 | + assert partner_obj, _('No partner found for id %d') % partner_id |
430 | + if invoice_type in ('in_invoice', 'in_refund'): |
431 | + field = 'list_price' |
432 | + pricelist_property = 'property_product_pricelist_purchase' |
433 | + else: |
434 | + field = 'standard_price' |
435 | + pricelist_property = 'property_product_pricelist' |
436 | + if pricelist_property in partner_obj: |
437 | + pricelist_id = partner_obj[pricelist_property].id |
438 | + else: |
439 | + pricelist_id = False |
440 | + # Check whether standard price p.u. modified by pricelist |
441 | + if pricelist_id: |
442 | + pricelist_model = self.pool.get('product.pricelist') |
443 | + price_unit = pricelist_model.price_get( |
444 | + cr, uid, [pricelist_id], product_id, qty or 1.0, partner_id, |
445 | + {'uom': uom_id})[pricelist_id] |
446 | + if price_unit is False: # 0.0 is OK, we night have free products |
447 | + warning = { |
448 | + 'title': _('No valid pricelist line found!'), |
449 | + 'message': |
450 | + _("Couldn't find a pricelist line matching this product" |
451 | + " and quantity.\n" |
452 | + "You have to change either the product, the quantity or" |
453 | + " the pricelist.") |
454 | + } |
455 | + # Pricelist converts price from standard currency to pricelist |
456 | + # currency. We have to convert this to the invoice currency. |
457 | + # In practice that will often mean undoing the conversion |
458 | + # done by the pricelist object |
459 | + pricelist_obj = pricelist_model.browse(cr, uid, pricelist_id) |
460 | + if (pricelist_obj and pricelist_obj.currency_id and |
461 | + pricelist_obj.currency_id.id): |
462 | + standard_currency_id = pricelist_obj.currency_id.id |
463 | + else: |
464 | + # Take standard price per unit directly from product |
465 | + product_model = self.pool.get('product.product') |
466 | + product_obj = product_model.browse( |
467 | + cr, uid, product_id, context=context) |
468 | + assert product_obj, _('No product found for id %d') % product_id |
469 | + assert field in product_obj, _( |
470 | + 'Field %s not found in product') % field |
471 | + price_unit = product_obj[field] |
472 | + # If price_unit not taken from price-list, we still have to |
473 | + # take unit of measurement into account |
474 | + if uom_id: |
475 | + uom_model = self.pool.get('product.uom') |
476 | + uom_obj = uom_model.browse(cr, uid, uom_id) |
477 | + p_uom_category_id = product_obj.uom_id.category_id.id |
478 | + if p_uom_category_id == uom_obj.category_id.id: |
479 | + price_unit = price_unit * uom_obj.factor_inv |
480 | + # When price not taken from pricelist, the currency is |
481 | + # determined by the price_type: |
482 | + price_type_model = self.pool.get('product.price.type') |
483 | + price_type_ids = price_type_model.search( |
484 | + cr, uid, [('field', '=', field)]) |
485 | + if price_type_ids: |
486 | + price_type_obj = price_type_model.browse( |
487 | + cr, uid, price_type_ids[0]) |
488 | + if (price_type_obj and price_type_obj.currency_id and |
489 | + price_type_obj.currency_id.id): |
490 | + standard_currency_id = price_type_obj.currency_id.id |
491 | + # convert price_unit to currency of invoice |
492 | + if standard_currency_id != currency_id: |
493 | + currency_model = self.pool.get('res.currency') |
494 | + price_unit = currency_model.compute( |
495 | + cr, uid, standard_currency_id, currency_id, |
496 | + price_unit, round=True, context=context) |
497 | + return price_unit, warning |
498 | + |
499 | 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): |
500 | if context is None: |
501 | context = {} |
502 | @@ -1448,6 +1603,10 @@ |
503 | inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context) |
504 | company_currency = inv.company_id.currency_id.id |
505 | |
506 | + local_context = { |
507 | + 'tax_calculation_rounding_method': |
508 | + inv.tax_calculation_rounding_method |
509 | + } |
510 | for line in inv.invoice_line: |
511 | mres = self.move_line_get_item(cr, uid, line, context) |
512 | if not mres: |
513 | @@ -1457,7 +1616,7 @@ |
514 | for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, |
515 | (line.price_unit * (1.0 - (line['discount'] or 0.0) / 100.0)), |
516 | line.quantity, inv.address_invoice_id.id, line.product_id, |
517 | - inv.partner_id)['taxes']: |
518 | + inv.partner_id, context=local_context)['taxes']: |
519 | |
520 | if inv.type in ('out_invoice', 'in_invoice'): |
521 | tax_code_id = tax['base_code_id'] |
522 | @@ -1596,16 +1755,23 @@ |
523 | cur = inv.currency_id |
524 | company_currency = inv.company_id.currency_id.id |
525 | |
526 | + local_context = { |
527 | + 'tax_calculation_rounding_method': |
528 | + inv.tax_calculation_rounding_method |
529 | + } |
530 | for line in inv.invoice_line: |
531 | - 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']: |
532 | - tax['price_unit'] = cur_obj.round(cr, uid, cur, tax['price_unit']) |
533 | + for tax in tax_obj.compute_all( |
534 | + cr, uid, line.invoice_line_tax_id, |
535 | + (line.price_unit * (1 - (line.discount or 0.0) / 100.0)), |
536 | + line.quantity, inv.address_invoice_id.id, line.product_id, |
537 | + inv.partner_id, context=local_context)['taxes']: |
538 | val={} |
539 | val['invoice_id'] = inv.id |
540 | val['name'] = tax['name'] |
541 | val['amount'] = tax['amount'] |
542 | val['manual'] = False |
543 | val['sequence'] = tax['sequence'] |
544 | - val['base'] = tax['price_unit'] * line['quantity'] |
545 | + val['base'] = cur_obj.round(cr, uid, cur, tax['price_unit'] * line['quantity']) |
546 | |
547 | if inv.type in ('out_invoice','in_invoice'): |
548 | val['base_code_id'] = tax['base_code_id'] |
549 | |
550 | === modified file 'account/account_invoice_view.xml' |
551 | --- account/account_invoice_view.xml 2012-02-16 18:50:48 +0000 |
552 | +++ account/account_invoice_view.xml 2014-04-22 12:10:57 +0000 |
553 | @@ -168,6 +168,7 @@ |
554 | <field name="reference_type" nolabel="1" size="0"/> |
555 | <field name="reference" nolabel="1"/> |
556 | <field name="date_due"/> |
557 | + <field name="tax_calculation_rounding_method"/> |
558 | <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"> |
559 | <tree string="Invoice lines"> |
560 | <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)"/> |
561 | @@ -259,6 +260,9 @@ |
562 | <field name="journal_id" groups="base.group_user" on_change="onchange_journal_id(journal_id, context)" widget="selection"/> |
563 | <field name="number"/> |
564 | <field name="type" invisible="1"/> |
565 | + <field |
566 | + name="tax_calculation_rounding_method" |
567 | + invisible="1" /> |
568 | <field name="currency_id" width="50"/> |
569 | <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"/> |
570 | <newline/> |
571 | @@ -292,7 +296,7 @@ |
572 | </group> |
573 | <group col="4" colspan="2"> |
574 | <group colspan="2" col="1"> |
575 | - <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"/> |
576 | + <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"/> |
577 | </group> |
578 | <field name="amount_untaxed"/> |
579 | <label string="" colspan="2"/> |
580 | |
581 | === modified file 'account/account_invoice_workflow.xml' |
582 | --- account/account_invoice_workflow.xml 2011-01-14 00:11:01 +0000 |
583 | +++ account/account_invoice_workflow.xml 2014-04-22 12:10:57 +0000 |
584 | @@ -17,7 +17,7 @@ |
585 | <record id="act_proforma2" model="workflow.activity"> |
586 | <field name="wkf_id" ref="wkf"/> |
587 | <field name="name">proforma2</field> |
588 | - <field name="action">write({'state':'proforma2'})</field> |
589 | + <field name="action">action_proforma()</field> |
590 | <field name="kind">function</field> |
591 | </record> |
592 | |
593 | |
594 | === modified file 'account/account_move_line.py' |
595 | --- account/account_move_line.py 2014-01-10 15:40:23 +0000 |
596 | +++ account/account_move_line.py 2014-04-22 12:10:57 +0000 |
597 | @@ -567,6 +567,9 @@ |
598 | cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'') |
599 | if not cr.fetchone(): |
600 | cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)') |
601 | + cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('account_move_line_date_id_index',)) |
602 | + if not cr.fetchone(): |
603 | + cr.execute('CREATE INDEX account_move_line_date_id_index ON account_move_line (date DESC, id desc)') |
604 | |
605 | def _check_no_view(self, cr, uid, ids, context=None): |
606 | lines = self.browse(cr, uid, ids, context=context) |
607 | |
608 | === modified file 'account/account_view.xml' |
609 | --- account/account_view.xml 2013-03-13 09:17:04 +0000 |
610 | +++ account/account_view.xml 2014-04-22 12:10:57 +0000 |
611 | @@ -1703,7 +1703,7 @@ |
612 | <filter string="Purchase" icon="terp-purchase" domain="[('journal_id.type', '=', 'purchase')]"/> |
613 | <separator orientation="vertical"/> |
614 | <field name="name"/> |
615 | - <field name="journal_id" widget="selection"/> |
616 | + <field name="journal_id" on_change="onchange_journal_id(journal_id)"/> |
617 | <field name="company_id" widget="selection" groups="base.group_multi_company"/> |
618 | </group> |
619 | <newline/> |
620 | |
621 | === modified file 'account/company.py' |
622 | --- account/company.py 2011-11-16 13:43:36 +0000 |
623 | +++ account/company.py 2014-04-22 12:10:57 +0000 |
624 | @@ -24,6 +24,11 @@ |
625 | class res_company(osv.osv): |
626 | _inherit = "res.company" |
627 | _columns = { |
628 | + 'tax_calculation_rounding_method': fields.selection([ |
629 | + ('round_per_line', 'Round per line'), |
630 | + ('round_globally', 'Round globally'), |
631 | + ], 'Tax calculation rounding method', |
632 | + 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."), |
633 | 'paypal_account': fields.char("Paypal Account", size=128, help="Paypal username (usually email) for receiving online payments."), |
634 | 'overdue_msg': fields.text('Overdue Payments Message', translate=True), |
635 | 'property_reserve_and_surplus_account': fields.property( |
636 | @@ -41,7 +46,8 @@ |
637 | has already been paid, please disregard this notice. However, if you have any |
638 | queries regarding your account, please contact us. |
639 | Thank you in advance. |
640 | -''' |
641 | +''', |
642 | + 'tax_calculation_rounding_method': 'round_per_line', |
643 | } |
644 | |
645 | res_company() |
646 | |
647 | === modified file 'account/company_view.xml' |
648 | --- account/company_view.xml 2011-09-29 11:08:56 +0000 |
649 | +++ account/company_view.xml 2014-04-22 12:10:57 +0000 |
650 | @@ -25,6 +25,7 @@ |
651 | <field name="currency_id" position="after"> |
652 | <field name="property_reserve_and_surplus_account" colspan="2"/> |
653 | <field name="paypal_account" /> |
654 | + <field name="tax_calculation_rounding_method" /> |
655 | </field> |
656 | </field> |
657 | </record> |
658 | |
659 | === modified file 'account/data/data_account_type.xml' |
660 | --- account/data/data_account_type.xml 2012-01-31 13:36:57 +0000 |
661 | +++ account/data/data_account_type.xml 2014-04-22 12:10:57 +0000 |
662 | @@ -22,6 +22,7 @@ |
663 | <field name="name">Bank</field> |
664 | <field name="code">bank</field> |
665 | <field name="close_method">balance</field> |
666 | + <field name="report_type">asset</field> |
667 | </record> |
668 | <record model="account.account.type" id="data_account_type_cash"> |
669 | <field name="name">Cash</field> |
670 | |
671 | === modified file 'account/partner_view.xml' |
672 | --- account/partner_view.xml 2011-09-21 07:13:12 +0000 |
673 | +++ account/partner_view.xml 2014-04-22 12:10:57 +0000 |
674 | @@ -96,7 +96,7 @@ |
675 | <separator string="Supplier Debit" colspan="2"/> |
676 | <field name="debit"/> |
677 | </group> |
678 | - <field colspan="4" context="{'address': address}" name="bank_ids" nolabel="1"> |
679 | + <field colspan="4" context="{'address': address, 'default_partner_id': active_id}" name="bank_ids" nolabel="1"> |
680 | <form string="Bank account"> |
681 | <field name="state"/> |
682 | <newline/> |
683 | |
684 | === modified file 'account/report/account_aged_partner_balance.py' |
685 | --- account/report/account_aged_partner_balance.py 2012-09-24 12:41:57 +0000 |
686 | +++ account/report/account_aged_partner_balance.py 2014-04-22 12:10:57 +0000 |
687 | @@ -75,7 +75,7 @@ |
688 | AND (account_account.type IN %s)\ |
689 | AND account_account.active\ |
690 | AND ((reconcile_id IS NULL)\ |
691 | - OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ |
692 | + OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
693 | AND (l.partner_id=res_partner.id)\ |
694 | AND (l.date <= %s)\ |
695 | AND ' + self.query + ' \ |
696 | @@ -99,7 +99,7 @@ |
697 | AND (account_account.type IN %s)\ |
698 | AND (l.partner_id IN %s)\ |
699 | AND ((l.reconcile_id IS NULL)\ |
700 | - OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ |
701 | + OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
702 | AND ' + self.query + '\ |
703 | AND account_account.active\ |
704 | AND (l.date <= %s)\ |
705 | @@ -119,7 +119,7 @@ |
706 | AND (COALESCE(l.date_maturity, l.date) < %s)\ |
707 | AND (l.partner_id IN %s)\ |
708 | AND ((l.reconcile_id IS NULL)\ |
709 | - OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ |
710 | + OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
711 | AND '+ self.query + '\ |
712 | AND account_account.active\ |
713 | AND (l.date <= %s)\ |
714 | @@ -136,7 +136,7 @@ |
715 | AND (COALESCE(l.date_maturity,l.date) > %s)\ |
716 | AND (l.partner_id IN %s)\ |
717 | AND ((l.reconcile_id IS NULL)\ |
718 | - OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ |
719 | + OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
720 | AND '+ self.query + '\ |
721 | AND account_account.active\ |
722 | AND (l.date <= %s)\ |
723 | @@ -168,7 +168,7 @@ |
724 | AND (account_account.type IN %s) |
725 | AND (l.partner_id IN %s) |
726 | AND ((l.reconcile_id IS NULL) |
727 | - OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s ))) |
728 | + OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval ))) |
729 | AND ''' + self.query + ''' |
730 | AND account_account.active |
731 | AND ''' + dates_query + ''' |
732 | @@ -242,7 +242,7 @@ |
733 | AND (l.partner_id IS NULL)\ |
734 | AND (account_account.type IN %s)\ |
735 | AND ((l.reconcile_id IS NULL) \ |
736 | - OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ |
737 | + OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
738 | AND ' + self.query + '\ |
739 | AND (l.date <= %s)\ |
740 | AND account_account.active ',(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,)) |
741 | @@ -259,7 +259,7 @@ |
742 | AND (account_account.type IN %s)\ |
743 | AND (COALESCE(l.date_maturity, l.date) < %s)\ |
744 | AND ((l.reconcile_id IS NULL)\ |
745 | - OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ |
746 | + OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
747 | AND '+ self.query + '\ |
748 | AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from)) |
749 | t = self.cr.fetchall() |
750 | @@ -274,7 +274,7 @@ |
751 | AND (account_account.type IN %s)\ |
752 | AND (COALESCE(l.date_maturity,l.date) > %s)\ |
753 | AND ((l.reconcile_id IS NULL)\ |
754 | - OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ |
755 | + OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
756 | AND '+ self.query + '\ |
757 | AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from)) |
758 | t = self.cr.fetchall() |
759 | @@ -302,7 +302,7 @@ |
760 | AND (account_account.type IN %s)\ |
761 | AND (l.partner_id IS NULL)\ |
762 | AND ((l.reconcile_id IS NULL)\ |
763 | - OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ |
764 | + OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
765 | AND '+ self.query + '\ |
766 | AND account_account.active\ |
767 | AND ' + dates_query + '\ |
768 | |
769 | === modified file 'account/report/account_print_invoice.rml' |
770 | --- account/report/account_print_invoice.rml 2011-12-22 15:17:58 +0000 |
771 | +++ account/report/account_print_invoice.rml 2014-04-22 12:10:57 +0000 |
772 | @@ -138,21 +138,8 @@ |
773 | <images/> |
774 | </stylesheet> |
775 | <story> |
776 | - <pto> |
777 | <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para> |
778 | <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para> |
779 | - <pto_header><!-- Must be after setLang() --> |
780 | - <blockTable colWidths="202.0,87.0,71.0,57.0,42.0,71.0" style="Table7"> |
781 | - <tr> |
782 | - <td> <para style="terp_tblheader_Details">Description</para> </td> |
783 | - <td> <para style="terp_tblheader_Details_Centre">Taxes</para> </td> |
784 | - <td> <para style="terp_tblheader_Details_Centre">Quantity</para> </td> |
785 | - <td> <para style="terp_tblheader_Details_Right">Unit Price </para> </td> |
786 | - <td> <para style="terp_tblheader_Details_Right">Disc.(%)</para> </td> |
787 | - <td> <para style="terp_tblheader_Details_Right">Price</para> </td> |
788 | - </tr> |
789 | - </blockTable> |
790 | - </pto_header> |
791 | <blockTable colWidths="297.0,233.0" style="Table_Partner_Address"> |
792 | <tr> |
793 | <td> |
794 | @@ -217,6 +204,19 @@ |
795 | <para style="terp_default_8"> |
796 | <font color="white"> </font> |
797 | </para> |
798 | + <pto> |
799 | + <pto_header> |
800 | + <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7"> |
801 | + <tr> |
802 | + <td> <para style="terp_tblheader_Details">Description</para> </td> |
803 | + <td> <para style="terp_tblheader_Details_Centre">Taxes</para> </td> |
804 | + <td> <para style="terp_tblheader_Details_Centre">Quantity</para> </td> |
805 | + <td> <para style="terp_tblheader_Details_Right">Unit Price </para> </td> |
806 | + <td> <para style="terp_tblheader_Details_Right">Disc.(%)</para> </td> |
807 | + <td> <para style="terp_tblheader_Details_Right">Price</para> </td> |
808 | + </tr> |
809 | + </blockTable> |
810 | + </pto_header> |
811 | <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7"> |
812 | <tr> |
813 | <td> |
814 | @@ -294,6 +294,7 @@ |
815 | </tr> |
816 | </blockTable> |
817 | </section> |
818 | + </pto> |
819 | <blockTable colWidths="385.0,60.0,85.0" style="Table10"> |
820 | <tr> |
821 | <td> |
822 | @@ -401,6 +402,5 @@ |
823 | <para style="terp_default_2"> |
824 | <font color="white"> </font> |
825 | </para> |
826 | - </pto> |
827 | </story> |
828 | </document> |
829 | |
830 | === modified file 'account_analytic_analysis/account_analytic_analysis.py' |
831 | --- account_analytic_analysis/account_analytic_analysis.py 2012-01-31 13:36:57 +0000 |
832 | +++ account_analytic_analysis/account_analytic_analysis.py 2014-04-22 12:10:57 +0000 |
833 | @@ -419,39 +419,24 @@ |
834 | |
835 | def init(self, cr): |
836 | tools.sql.drop_view_if_exists(cr, 'account_analytic_analysis_summary_user') |
837 | - cr.execute('CREATE OR REPLACE VIEW account_analytic_analysis_summary_user AS (' \ |
838 | - 'SELECT ' \ |
839 | - '(u.account_id * u.max_user) + u."user" AS id, ' \ |
840 | - 'u.account_id AS account_id, ' \ |
841 | - 'u."user" AS "user", ' \ |
842 | - 'COALESCE(SUM(l.unit_amount), 0.0) AS unit_amount ' \ |
843 | - 'FROM ' \ |
844 | - '(SELECT ' \ |
845 | - 'a.id AS account_id, ' \ |
846 | - 'u1.id AS "user", ' \ |
847 | - 'MAX(u2.id) AS max_user ' \ |
848 | - 'FROM ' \ |
849 | - 'res_users AS u1, ' \ |
850 | - 'res_users AS u2, ' \ |
851 | - 'account_analytic_account AS a ' \ |
852 | - 'GROUP BY u1.id, a.id ' \ |
853 | - ') AS u ' \ |
854 | - 'LEFT JOIN ' \ |
855 | - '(SELECT ' \ |
856 | - 'l.account_id AS account_id, ' \ |
857 | - 'l.user_id AS "user", ' \ |
858 | - 'SUM(l.unit_amount) AS unit_amount ' \ |
859 | - 'FROM account_analytic_line AS l, ' \ |
860 | - 'account_analytic_journal AS j ' \ |
861 | - 'WHERE (j.type = \'general\') and (j.id=l.journal_id) ' \ |
862 | - 'GROUP BY l.account_id, l.user_id ' \ |
863 | - ') AS l ' |
864 | - 'ON (' \ |
865 | - 'u.account_id = l.account_id ' \ |
866 | - 'AND u."user" = l."user"' \ |
867 | - ') ' \ |
868 | - 'GROUP BY u."user", u.account_id, u.max_user' \ |
869 | - ')') |
870 | + cr.execute('''CREATE OR REPLACE VIEW account_analytic_analysis_summary_user AS ( |
871 | + with mu as |
872 | + (select max(id) as max_user from res_users) |
873 | + , lu AS |
874 | + (SELECT |
875 | + l.account_id AS account_id, |
876 | + coalesce(l.user_id, 0) AS user_id, |
877 | + SUM(l.unit_amount) AS unit_amount |
878 | + FROM account_analytic_line AS l, |
879 | + account_analytic_journal AS j |
880 | + WHERE (j.type = 'general' ) and (j.id=l.journal_id) |
881 | + GROUP BY l.account_id, l.user_id |
882 | + ) |
883 | + select (lu.account_id * mu.max_user) + lu.user_id as id, |
884 | + lu.account_id as account_id, |
885 | + lu.user_id as "user", |
886 | + unit_amount |
887 | + from lu, mu)''') |
888 | |
889 | account_analytic_account_summary_user() |
890 | |
891 | |
892 | === modified file 'account_analytic_plans/account_analytic_plans_view.xml' |
893 | --- account_analytic_plans/account_analytic_plans_view.xml 2011-05-31 21:55:34 +0000 |
894 | +++ account_analytic_plans/account_analytic_plans_view.xml 2014-04-22 12:10:57 +0000 |
895 | @@ -23,10 +23,10 @@ |
896 | <field name="inherit_id" ref="account.view_move_form"/> |
897 | <field name="arch" type="xml"> |
898 | <xpath expr="/form/notebook/page/field[@name='line_id']/tree/field[@name='analytic_account_id']" position="replace"> |
899 | - <field name="analytics_id" context="{'journal_id':journal_id}" groups="analytic.group_analytic_accounting"/> |
900 | + <field name="analytics_id" context="{'journal_id':parent.journal_id}" groups="analytic.group_analytic_accounting"/> |
901 | </xpath> |
902 | <xpath expr="/form/notebook/page/field[@name='line_id']/form/notebook/page/group/field[@name='analytic_account_id']" position="replace"> |
903 | - <field name="analytics_id" context="{'journal_id':journal_id}" groups="analytic.group_analytic_accounting"/> |
904 | + <field name="analytics_id" context="{'journal_id':parent.journal_id}" groups="analytic.group_analytic_accounting"/> |
905 | </xpath> |
906 | </field> |
907 | </record> |
908 | |
909 | === modified file 'account_anglo_saxon/__openerp__.py' |
910 | --- account_anglo_saxon/__openerp__.py 2012-01-31 13:36:57 +0000 |
911 | +++ account_anglo_saxon/__openerp__.py 2014-04-22 12:10:57 +0000 |
912 | @@ -38,7 +38,7 @@ |
913 | "depends": ["product", "purchase"], |
914 | "category": "Hidden/Dependency", |
915 | "init_xml": [], |
916 | - "demo_xml": [], |
917 | + "demo_xml": ['account_anglo_saxon_demo.xml'], |
918 | "update_xml": ["product_view.xml",], |
919 | "auto_install": False, |
920 | "installable": True, |
921 | |
922 | === added file 'account_anglo_saxon/account_anglo_saxon_demo.xml' |
923 | --- account_anglo_saxon/account_anglo_saxon_demo.xml 1970-01-01 00:00:00 +0000 |
924 | +++ account_anglo_saxon/account_anglo_saxon_demo.xml 2014-04-22 12:10:57 +0000 |
925 | @@ -0,0 +1,34 @@ |
926 | +<?xml version="1.0" encoding="utf-8"?> |
927 | +<openerp> |
928 | + <data> |
929 | + |
930 | + <!-- |
931 | + Create a stock input account in the minimal |
932 | + chart of accounts |
933 | + --> |
934 | + |
935 | + <record id="stk_in" model="account.account"> |
936 | + <field name="code">X12000</field> |
937 | + <field name="name">Incoming Stocks - (test)</field> |
938 | + <field ref="account.cas" name="parent_id"/> |
939 | + <field name="type">other</field> |
940 | + <field name="user_type" ref="account.data_account_type_asset"/> |
941 | + </record> |
942 | + |
943 | + <!-- |
944 | + Set the input account to these products, purchased in |
945 | + the tests in purchase_double_validation |
946 | + --> |
947 | + |
948 | + <record id="product.product_product_pc4" model="product.product"> |
949 | + <field name="property_stock_account_input" |
950 | + ref="stk_in" /> |
951 | + </record> |
952 | + |
953 | + <record id="product.product_product_hdd2" model="product.product"> |
954 | + <field name="property_stock_account_input" |
955 | + ref="stk_in" /> |
956 | + </record> |
957 | + |
958 | + </data> |
959 | +</openerp> |
960 | |
961 | === modified file 'account_anglo_saxon/purchase.py' |
962 | --- account_anglo_saxon/purchase.py 2011-12-19 16:54:40 +0000 |
963 | +++ account_anglo_saxon/purchase.py 2014-04-22 12:10:57 +0000 |
964 | @@ -26,17 +26,17 @@ |
965 | _inherit = "purchase.order" |
966 | _description = "Purchase Order" |
967 | |
968 | - def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None): |
969 | - line = super(purchase_order, self)._prepare_inv_line(cr, uid, account_id, order_line, context=context) |
970 | + def _choose_account_from_po_line(self, cr, uid, order_line, context=None): |
971 | + account_id = super(purchase_order, self)._choose_account_from_po_line(cr, uid, order_line, context=context) |
972 | if order_line.product_id and not order_line.product_id.type == 'service': |
973 | acc_id = order_line.product_id.property_stock_account_input and order_line.product_id.property_stock_account_input.id |
974 | if not acc_id: |
975 | 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 |
976 | - if acc_id: |
977 | + if not acc_id: |
978 | + 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,)) |
979 | + else: |
980 | fpos = order_line.order_id.fiscal_position or False |
981 | - new_account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, acc_id) |
982 | - line.update({'account_id': new_account_id}) |
983 | - return line |
984 | -purchase_order() |
985 | + account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, acc_id) |
986 | + return account_id |
987 | |
988 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
989 | |
990 | === modified file 'account_asset/account_asset_invoice.py' |
991 | --- account_asset/account_asset_invoice.py 2011-11-11 19:29:54 +0000 |
992 | +++ account_asset/account_asset_invoice.py 2014-04-22 12:10:57 +0000 |
993 | @@ -57,6 +57,7 @@ |
994 | 'partner_id': line.invoice_id.partner_id.id, |
995 | 'company_id': line.invoice_id.company_id.id, |
996 | 'currency_id': line.invoice_id.currency_id.id, |
997 | + 'purchase_date' : line.invoice_id.date_invoice, |
998 | } |
999 | changed_vals = asset_obj.onchange_category_id(cr, uid, [], vals['category_id'], context=context) |
1000 | vals.update(changed_vals['value']) |
1001 | |
1002 | === modified file 'account_budget/account_budget.py' |
1003 | --- account_budget/account_budget.py 2011-12-31 07:57:20 +0000 |
1004 | +++ account_budget/account_budget.py 2014-04-22 12:10:57 +0000 |
1005 | @@ -113,8 +113,10 @@ |
1006 | result = 0.0 |
1007 | if context is None: |
1008 | context = {} |
1009 | + account_obj = self.pool.get('account.account') |
1010 | for line in self.browse(cr, uid, ids, context=context): |
1011 | acc_ids = [x.id for x in line.general_budget_id.account_ids] |
1012 | + acc_ids = account_obj._get_children_and_consol(cr, uid, acc_ids, context=context) |
1013 | if not acc_ids: |
1014 | raise osv.except_osv(_('Error!'),_("The Budget '%s' has no accounts!") % str(line.general_budget_id.name)) |
1015 | date_to = line.date_to |
1016 | @@ -124,7 +126,21 @@ |
1017 | if context.has_key('wizard_date_to'): |
1018 | date_to = context['wizard_date_to'] |
1019 | if line.analytic_account_id.id: |
1020 | - cr.execute("SELECT SUM(amount) FROM account_analytic_line WHERE account_id=%s AND (date " |
1021 | + cr.execute("SELECT SUM(amount) FROM account_analytic_line WHERE account_id in " |
1022 | + """(with recursive account_analytic_account_hierarchy(id) |
1023 | + as |
1024 | + ( |
1025 | + select id from account_analytic_account |
1026 | + where id=%s |
1027 | + union all |
1028 | + select account_analytic_account.id from |
1029 | + account_analytic_account |
1030 | + join account_analytic_account_hierarchy |
1031 | + on account_analytic_account.parent_id= |
1032 | + account_analytic_account_hierarchy.id |
1033 | + )""" |
1034 | + "select id from account_analytic_account_hierarchy) " |
1035 | + "AND (date " |
1036 | "between to_date(%s,'yyyy-mm-dd') AND to_date(%s,'yyyy-mm-dd')) AND " |
1037 | "general_account_id=ANY(%s)", (line.analytic_account_id.id, date_from, date_to,acc_ids,)) |
1038 | result = cr.fetchone()[0] |
1039 | |
1040 | === modified file 'account_payment/account_move_line.py' |
1041 | --- account_payment/account_move_line.py 2011-07-01 23:41:24 +0000 |
1042 | +++ account_payment/account_move_line.py 2014-04-22 12:10:57 +0000 |
1043 | @@ -51,7 +51,7 @@ |
1044 | if not args: |
1045 | return [] |
1046 | line_obj = self.pool.get('account.move.line') |
1047 | - query = line_obj._query_get(cr, uid, context={}) |
1048 | + query = line_obj._query_get(cr, uid, context=context) |
1049 | where = ' and '.join(map(lambda x: '''(SELECT |
1050 | CASE WHEN l.amount_currency < 0 |
1051 | THEN - l.amount_currency |
1052 | @@ -117,4 +117,4 @@ |
1053 | |
1054 | account_move_line() |
1055 | |
1056 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1057 | \ No newline at end of file |
1058 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1059 | |
1060 | === modified file 'account_payment/account_payment_view.xml' |
1061 | --- account_payment/account_payment_view.xml 2012-01-31 13:36:57 +0000 |
1062 | +++ account_payment/account_payment_view.xml 2014-04-22 12:10:57 +0000 |
1063 | @@ -107,7 +107,7 @@ |
1064 | <field name="user_id"/> |
1065 | <field name="date_prefered"/> |
1066 | <field name="date_scheduled" select="1" attrs="{'readonly':[('date_prefered','!=','fixed')]}" /> |
1067 | - <button colspan="2" name="%(action_create_payment_order)d" string="Select Invoices to Pay" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/> |
1068 | + <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"/> |
1069 | <field name="company_id" widget='selection' groups="base.group_multi_company"/> |
1070 | </group> |
1071 | <field name="line_ids" colspan="4" widget="one2many_list" nolabel="1" context="{'order_id': active_id or False}" > |
1072 | |
1073 | === modified file 'analytic/analytic.py' |
1074 | --- analytic/analytic.py 2012-02-16 18:01:11 +0000 |
1075 | +++ analytic/analytic.py 2014-04-22 12:10:57 +0000 |
1076 | @@ -263,18 +263,15 @@ |
1077 | if name: |
1078 | account = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context) |
1079 | if not account: |
1080 | - names=map(lambda i : i.strip(),name.split('/')) |
1081 | - for i in range(len(names)): |
1082 | - dom=[('name', operator, names[i])] |
1083 | - if i>0: |
1084 | - dom+=[('id','child_of',account)] |
1085 | - account = self.search(cr, uid, dom, limit=limit, context=context) |
1086 | - newacc = account |
1087 | - while newacc: |
1088 | - newacc = self.search(cr, uid, [('parent_id', 'in', newacc)], limit=limit, context=context) |
1089 | - account += newacc |
1090 | - if args: |
1091 | - account = self.search(cr, uid, [('id', 'in', account)] + args, limit=limit, context=context) |
1092 | + dom = [] |
1093 | + for name2 in map(lambda i : i.strip(),name.split('/')): |
1094 | + account = self.search( |
1095 | + cr, uid, |
1096 | + dom + [('name', 'ilike', name2)] + args, |
1097 | + limit=limit, context=context) |
1098 | + if not account: |
1099 | + break |
1100 | + dom = [('parent_id','in',account)] |
1101 | else: |
1102 | account = self.search(cr, uid, args, limit=limit, context=context) |
1103 | return self.name_get(cr, uid, account, context=context) |
1104 | |
1105 | === modified file 'audittrail/audittrail.py' |
1106 | --- audittrail/audittrail.py 2012-03-23 14:25:41 +0000 |
1107 | +++ audittrail/audittrail.py 2014-04-22 12:10:57 +0000 |
1108 | @@ -173,6 +173,10 @@ |
1109 | class audittrail_objects_proxy(object_proxy): |
1110 | """ Uses Object proxy for auditing changes on object of subscribed Rules""" |
1111 | |
1112 | + _default_recursive_level = 1 |
1113 | + "Columns to be filtered from audited fields" |
1114 | + __filtered_columns = ('__last_update', 'id') |
1115 | + |
1116 | def get_value_text(self, cr, uid, pool, resource_pool, method, field, value): |
1117 | """ |
1118 | Gets textual values for the fields. |
1119 | @@ -300,7 +304,7 @@ |
1120 | self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list) |
1121 | return res |
1122 | |
1123 | - def get_data(self, cr, uid, pool, res_ids, model, method): |
1124 | + def get_data(self, cr, uid, pool, res_ids, model, method, recursive_level=None): |
1125 | """ |
1126 | This function simply read all the fields of the given res_ids, and also recurisvely on |
1127 | all records of a x2m fields read that need to be logged. Then it returns the result in |
1128 | @@ -319,6 +323,8 @@ |
1129 | }, |
1130 | } |
1131 | """ |
1132 | + if recursive_level is None: |
1133 | + recursive_level = self._default_recursive_level |
1134 | data = {} |
1135 | resource_pool = pool.get(model.model) |
1136 | # read all the fields of the given resources in super admin mode |
1137 | @@ -328,14 +334,14 @@ |
1138 | resource_id = resource['id'] |
1139 | # loop on each field on the res_ids we just have read |
1140 | for field in resource: |
1141 | - if field in ('__last_update', 'id'): |
1142 | + if field in self.__filtered_columns: |
1143 | continue |
1144 | values[field] = resource[field] |
1145 | # get the textual value of that field for this record |
1146 | values_text[field] = self.get_value_text(cr, 1, pool, resource_pool, method, field, resource[field]) |
1147 | |
1148 | field_obj = resource_pool._all_columns.get(field).column |
1149 | - if field_obj._type in ('one2many','many2many'): |
1150 | + if field_obj._type in ('one2many','many2many') and recursive_level: |
1151 | # check if an audittrail rule apply in super admin mode |
1152 | if self.check_rules(cr, 1, field_obj._obj, method): |
1153 | # check if the model associated to a *2m field exists, in super admin mode |
1154 | @@ -344,11 +350,11 @@ |
1155 | assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj)) |
1156 | x2m_model = pool.get('ir.model').browse(cr, 1, x2m_model_id) |
1157 | #recursive call on x2m fields that need to be checked too |
1158 | - data.update(self.get_data(cr, 1, pool, resource[field], x2m_model, method)) |
1159 | + data.update(self.get_data(cr, 1, pool, resource[field], x2m_model, method, recursive_level - 1)) |
1160 | data[(model.id, resource_id)] = {'text':values_text, 'value': values} |
1161 | return data |
1162 | |
1163 | - def prepare_audittrail_log_line(self, cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=[]): |
1164 | + def prepare_audittrail_log_line(self, cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=[], recursive_level=None): |
1165 | """ |
1166 | This function compares the old data (i.e before the method was executed) and the new data |
1167 | (after the method was executed) and returns a structure with all the needed information to |
1168 | @@ -378,6 +384,8 @@ |
1169 | record (res.partner, for example), we may have to log a change done in a x2many field (on |
1170 | res.partner.address, for example) |
1171 | """ |
1172 | + if recursive_level is None: |
1173 | + recursive_level = self._default_recursive_level |
1174 | key = (model.id, resource_id) |
1175 | lines = { |
1176 | key: [] |
1177 | @@ -385,10 +393,10 @@ |
1178 | # loop on all the fields |
1179 | for field_name, field_definition in pool.get(model.model)._all_columns.items(): |
1180 | #if the field_list param is given, skip all the fields not in that list |
1181 | - if field_list and field_name not in field_list: |
1182 | + if field_list and field_name not in field_list or field_name in self.__filtered_columns: |
1183 | continue |
1184 | field_obj = field_definition.column |
1185 | - if field_obj._type in ('one2many','many2many'): |
1186 | + if field_obj._type in ('one2many','many2many') and recursive_level: |
1187 | # checking if an audittrail rule apply in super admin mode |
1188 | if self.check_rules(cr, 1, field_obj._obj, method): |
1189 | # checking if the model associated to a *2m field exists, in super admin mode |
1190 | @@ -403,7 +411,7 @@ |
1191 | # We use list(set(...)) to remove duplicates. |
1192 | res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids)) |
1193 | for res_id in res_ids: |
1194 | - lines.update(self.prepare_audittrail_log_line(cr, 1, pool, x2m_model, res_id, method, old_values, new_values, field_list)) |
1195 | + 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)) |
1196 | # if the value value is different than the old value: record the change |
1197 | 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]: |
1198 | data = { |
1199 | |
1200 | === modified file 'base_action_rule/base_action_rule.py' |
1201 | --- base_action_rule/base_action_rule.py 2012-04-26 08:03:00 +0000 |
1202 | +++ base_action_rule/base_action_rule.py 2014-04-22 12:10:57 +0000 |
1203 | @@ -20,6 +20,7 @@ |
1204 | ############################################################################## |
1205 | |
1206 | from osv import fields, osv, orm |
1207 | +from openerp import SUPERUSER_ID |
1208 | from tools.translate import _ |
1209 | from datetime import datetime |
1210 | from datetime import timedelta |
1211 | @@ -202,11 +203,13 @@ |
1212 | return True |
1213 | return wrapper |
1214 | |
1215 | - def _register_hook(self, cr, uid, ids, context=None): |
1216 | + def _register_hook(self, cr, uid=SUPERUSER_ID, ids=None, context=None): |
1217 | """ |
1218 | Wrap every `create` and `write` methods of the models specified by |
1219 | the rules (given by `ids`). |
1220 | """ |
1221 | + if ids == [] or ids is None: |
1222 | + ids = self.search(cr, uid, []) |
1223 | for action_rule in self.browse(cr, uid, ids, context=context): |
1224 | model = action_rule.model_id.model |
1225 | obj_pool = self.pool.get(model) |
1226 | |
1227 | === modified file 'base_calendar/base_calendar.py' |
1228 | --- base_calendar/base_calendar.py 2012-03-05 14:35:54 +0000 |
1229 | +++ base_calendar/base_calendar.py 2014-04-22 12:10:57 +0000 |
1230 | @@ -30,6 +30,7 @@ |
1231 | import re |
1232 | import time |
1233 | import tools |
1234 | +from operator import itemgetter |
1235 | |
1236 | months = { |
1237 | 1: "January", 2: "February", 3: "March", 4: "April", \ |
1238 | @@ -85,7 +86,10 @@ |
1239 | return (int(real_id), real_date, end.strftime("%Y-%m-%d %H:%M:%S")) |
1240 | return int(real_id) |
1241 | |
1242 | - return base_calendar_id and int(base_calendar_id) or base_calendar_id |
1243 | + return int(base_calendar_id) |
1244 | + |
1245 | + return base_calendar_id |
1246 | + |
1247 | |
1248 | def real_id2base_calendar_id(real_id, recurrent_date): |
1249 | """ |
1250 | @@ -1303,6 +1307,18 @@ |
1251 | res.append(base_calendar_id2real_id(id)) |
1252 | return res |
1253 | |
1254 | + def _multikeysort(self, items, columns): |
1255 | + |
1256 | + comparers = [ ((itemgetter(col[1:].strip()), -1) if col.startswith('-') else (itemgetter(col.strip()), 1)) for col in columns] |
1257 | + def comparer(left, right): |
1258 | + for fn, mult in comparers: |
1259 | + result = cmp(fn(left), fn(right)) |
1260 | + if result: |
1261 | + return mult * result |
1262 | + else: |
1263 | + return 0 |
1264 | + return sorted(items, cmp=comparer) |
1265 | + |
1266 | def search(self, cr, uid, args, offset=0, limit=0, order=None, context=None, count=False): |
1267 | context = context or {} |
1268 | args_without_date = [] |
1269 | @@ -1327,6 +1343,16 @@ |
1270 | 0, 0, order, context, count=False) |
1271 | if context.get('virtual_id', True): |
1272 | res = self.get_recurrent_ids(cr, uid, res, args, limit, context=context) |
1273 | + if order: |
1274 | + order = order.split(',') |
1275 | + sortby = {} |
1276 | + for o in order: |
1277 | + spl = o.split() |
1278 | + sortby[spl[0]] = spl[1] |
1279 | + fields = sortby.keys() |
1280 | + ordered = self.read(cr, uid, res, fields=fields, context=context) |
1281 | + res = self._multikeysort(ordered, [key.split()[0] if sortby[key.split()[0]] == 'ASC' else '-%s' % key.split()[0] for key in order]) |
1282 | + res = [x['id'] for x in res] |
1283 | |
1284 | if count: |
1285 | return len(res) |
1286 | |
1287 | === modified file 'base_contact/base_contact.py' |
1288 | --- base_contact/base_contact.py 2012-02-15 13:22:13 +0000 |
1289 | +++ base_contact/base_contact.py 2014-04-22 12:10:57 +0000 |
1290 | @@ -93,7 +93,7 @@ |
1291 | return bool(value == 1) |
1292 | |
1293 | exists = table_exists(self._table) |
1294 | - super(res_partner_contact, self)._auto_init(cr, context) |
1295 | + result = super(res_partner_contact, self)._auto_init(cr, context) |
1296 | |
1297 | if not exists: |
1298 | cr.execute(""" |
1299 | @@ -108,6 +108,8 @@ |
1300 | cr.execute("update res_partner_address set contact_id=id") |
1301 | cr.execute("select setval('res_partner_contact_id_seq', (select max(id)+1 from res_partner_contact))") |
1302 | |
1303 | + return result |
1304 | + |
1305 | res_partner_contact() |
1306 | |
1307 | class res_partner_location(osv.osv): |
1308 | |
1309 | === modified file 'crm/crm_lead_view.xml' |
1310 | --- crm/crm_lead_view.xml 2012-11-20 11:39:58 +0000 |
1311 | +++ crm/crm_lead_view.xml 2014-04-22 12:10:57 +0000 |
1312 | @@ -483,6 +483,8 @@ |
1313 | <field name="partner_address_id" |
1314 | string="Contact" |
1315 | on_change="onchange_partner_address_id(partner_address_id, email_from)" |
1316 | + options='{"quick_create": false}' |
1317 | + context="{'default_partner_id':partner_id}" |
1318 | colspan="1" /> |
1319 | <group col="3" colspan="2"> |
1320 | <field name="email_from" string="Email" /> |
1321 | |
1322 | === modified file 'crm/crm_meeting_view.xml' |
1323 | --- crm/crm_meeting_view.xml 2012-01-31 13:36:57 +0000 |
1324 | +++ crm/crm_meeting_view.xml 2014-04-22 12:10:57 +0000 |
1325 | @@ -62,7 +62,9 @@ |
1326 | on_change="onchange_partner_id(partner_id)" /> |
1327 | <field name="partner_address_id" |
1328 | string="Contact" |
1329 | - on_change="onchange_partner_address_id(partner_address_id, email_from)" /> |
1330 | + on_change="onchange_partner_address_id(partner_address_id, email_from)" |
1331 | + options='{"quick_create": false}' |
1332 | + context="{'default_partner_id':partner_id}" /> |
1333 | <field name="email_from"/> |
1334 | </group><group col="2" colspan="2"> |
1335 | <separator colspan="2" string="Visibility"/> |
1336 | |
1337 | === modified file 'crm/crm_phonecall_view.xml' |
1338 | --- crm/crm_phonecall_view.xml 2011-12-21 13:10:28 +0000 |
1339 | +++ crm/crm_phonecall_view.xml 2014-04-22 12:10:57 +0000 |
1340 | @@ -92,7 +92,9 @@ |
1341 | groups="base.group_partner_manager"/> |
1342 | <newline/> |
1343 | <field name="partner_address_id" |
1344 | - on_change="onchange_partner_address_id(partner_address_id)" /> |
1345 | + on_change="onchange_partner_address_id(partner_address_id)" |
1346 | + options='{"quick_create": false}' |
1347 | + context="{'default_partner_id':partner_id}" /> |
1348 | <newline/> |
1349 | <field name="partner_mobile" /> |
1350 | </group> |
1351 | |
1352 | === modified file 'crm_claim/crm_claim_view.xml' |
1353 | --- crm_claim/crm_claim_view.xml 2012-01-31 13:36:57 +0000 |
1354 | +++ crm_claim/crm_claim_view.xml 2014-04-22 12:10:57 +0000 |
1355 | @@ -91,7 +91,9 @@ |
1356 | <field name="partner_id" string="Partner" |
1357 | on_change="onchange_partner_id(partner_id)" /> |
1358 | <field name="partner_address_id" string="Contact" |
1359 | - on_change="onchange_partner_address_id(partner_address_id, email_from)" /> |
1360 | + on_change="onchange_partner_address_id(partner_address_id, email_from)" |
1361 | + options='{"quick_create": false}' |
1362 | + context="{'default_partner_id':partner_id}" /> |
1363 | <field name="partner_phone"/> |
1364 | <field name="email_from" widget="email"/> |
1365 | </group> |
1366 | |
1367 | === modified file 'crm_fundraising/crm_fundraising_view.xml' |
1368 | --- crm_fundraising/crm_fundraising_view.xml 2011-12-19 16:54:40 +0000 |
1369 | +++ crm_fundraising/crm_fundraising_view.xml 2014-04-22 12:10:57 +0000 |
1370 | @@ -97,6 +97,8 @@ |
1371 | <field name="partner_address_id" |
1372 | string="Contact" |
1373 | on_change="onchange_partner_address_id(partner_address_id, email_from)" |
1374 | + options='{"quick_create": false}' |
1375 | + context="{'default_partner_id':partner_id}" |
1376 | colspan="1" /> |
1377 | <field name="email_from" colspan="2"/> |
1378 | </group> |
1379 | |
1380 | === modified file 'crm_helpdesk/crm_helpdesk_view.xml' |
1381 | --- crm_helpdesk/crm_helpdesk_view.xml 2011-12-19 16:54:40 +0000 |
1382 | +++ crm_helpdesk/crm_helpdesk_view.xml 2014-04-22 12:10:57 +0000 |
1383 | @@ -49,7 +49,8 @@ |
1384 | select="1" /> |
1385 | <field name="partner_address_id" colspan="2" |
1386 | on_change="onchange_partner_address_id(partner_address_id, email_from)" |
1387 | - /> |
1388 | + options='{"quick_create": false}' |
1389 | + context="{'default_partner_id':partner_id}" /> |
1390 | <newline/> |
1391 | <field name="email_from" colspan="2"/> |
1392 | <button name="remind_partner" |
1393 | |
1394 | === modified file 'delivery/__openerp__.py' |
1395 | --- delivery/__openerp__.py 2012-01-31 13:36:57 +0000 |
1396 | +++ delivery/__openerp__.py 2014-04-22 12:10:57 +0000 |
1397 | @@ -46,6 +46,7 @@ |
1398 | 'demo_xml': ['delivery_demo.xml'], |
1399 | 'test': [ |
1400 | 'test/delivery_cost.yml', |
1401 | + 'test/delivery_chained_pickings.yml', |
1402 | ], |
1403 | 'installable': True, |
1404 | 'auto_install': False, |
1405 | |
1406 | === modified file 'delivery/stock.py' |
1407 | --- delivery/stock.py 2011-12-21 18:11:49 +0000 |
1408 | +++ delivery/stock.py 2014-04-22 12:10:57 +0000 |
1409 | @@ -75,7 +75,7 @@ |
1410 | :param browse_record picking: the stock picking being invoiced |
1411 | :param browse_record invoice: the stock picking's invoice |
1412 | :return: dict containing the values to create the invoice line, |
1413 | - or None to create nothing |
1414 | + or None to create nothing |
1415 | """ |
1416 | carrier_obj = self.pool.get('delivery.carrier') |
1417 | grid_obj = self.pool.get('delivery.grid') |
1418 | @@ -160,6 +160,17 @@ |
1419 | } |
1420 | return res |
1421 | |
1422 | + def _prepare_chained_picking(self, cr, uid, picking_name, picking, picking_type, moves_todo, context=None): |
1423 | + values = super(stock_move, self)._prepare_chained_picking(cr, uid, picking_name, picking, picking_type, moves_todo, context=context) |
1424 | + if picking.carrier_id: |
1425 | + values['carrier_id'] = picking.carrier_id.id |
1426 | + values['volume'] = picking.volume |
1427 | + values['weight'] = picking.weight |
1428 | + values['weight_net'] = picking.weight_net |
1429 | + values['carrier_tracking_ref'] = picking.carrier_tracking_ref |
1430 | + values['number_of_packages'] = picking.number_of_packages |
1431 | + return values |
1432 | + |
1433 | _columns = { |
1434 | 'weight': fields.function(_cal_move_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight', |
1435 | store={ |
1436 | |
1437 | === added file 'delivery/test/delivery_chained_pickings.yml' |
1438 | --- delivery/test/delivery_chained_pickings.yml 1970-01-01 00:00:00 +0000 |
1439 | +++ delivery/test/delivery_chained_pickings.yml 2014-04-22 12:10:57 +0000 |
1440 | @@ -0,0 +1,37 @@ |
1441 | +- |
1442 | + I create a picking to stock.location_convenience_shop, which is chained with stock.location_refrigerator |
1443 | +- |
1444 | + !record {model: stock.picking, id: shipment_with_delivery}: |
1445 | + type: internal |
1446 | + carrier_id: delivery.delivery_carrier |
1447 | + volume: 42 |
1448 | + carrier_tracking_ref: FDX123 |
1449 | + number_of_packages: 7 |
1450 | +- |
1451 | + I add a move in the picking |
1452 | +- |
1453 | + !record {model: stock.move, id: icecream_move}: |
1454 | + picking_id: shipment_with_delivery |
1455 | + product_id: stock.product_icecream |
1456 | + product_uom: product.product_uom_kgm |
1457 | + product_qty: 130.0 |
1458 | + location_id: stock.stock_location_suppliers |
1459 | + location_dest_id: stock.location_convenience_shop |
1460 | +- |
1461 | + I confirm the picking |
1462 | +- |
1463 | + !workflow {model: stock.picking, action: button_confirm, ref: shipment_with_delivery} |
1464 | +- |
1465 | + I check that the delivery fields have been propagated to the chained picking |
1466 | +- |
1467 | + !python {model: stock.move}: | |
1468 | + original_move = self.browse(cr, uid, ref('icecream_move'), context=context) |
1469 | + original_picking = original_move.picking_id |
1470 | + chained_move = original_move.move_dest_id |
1471 | + chained_picking = chained_move.picking_id |
1472 | + assert chained_picking.carrier_tracking_ref == original_picking.carrier_tracking_ref, 'no propagation of carrier_tracking_ref' |
1473 | + assert chained_picking.carrier_id == original_picking.carrier_id, 'no propagation of carrier_id' |
1474 | + assert chained_picking.volume == original_picking.volume, 'no propagation of volume' |
1475 | + assert chained_picking.weight == original_picking.weight, 'no propagation of weight' |
1476 | + assert chained_picking.weight_net == original_picking.weight_net, 'no propagation of weight' |
1477 | + |
1478 | |
1479 | === modified file 'document/document.py' |
1480 | --- document/document.py 2012-08-22 09:10:40 +0000 |
1481 | +++ document/document.py 2014-04-22 12:10:57 +0000 |
1482 | @@ -147,6 +147,9 @@ |
1483 | # filename_uniq is not possible in pure SQL |
1484 | ] |
1485 | def _check_duplication(self, cr, uid, vals, ids=[], op='create'): |
1486 | + """ |
1487 | + Returns True if not same filename is attached already to an object (res_model, res_id) |
1488 | + """ |
1489 | name = vals.get('name', False) |
1490 | parent_id = vals.get('parent_id', False) |
1491 | res_model = vals.get('res_model', False) |
1492 | @@ -340,14 +343,21 @@ |
1493 | storage_id = par.storage_id |
1494 | break |
1495 | par = par.parent_id |
1496 | - #assert storage_id, "Strange, found file #%s w/o storage!" % f.id #TOCHECK: after run yml, it's fail |
1497 | - if storage_id: |
1498 | - r = stor.prepare_unlink(cr, uid, storage_id, f) |
1499 | - if r: |
1500 | - unres.append(r) |
1501 | - else: |
1502 | - logging.getLogger('document').warning("Unlinking attachment #%s %s that has no storage", |
1503 | - f.id, f.name) |
1504 | + #We get the ids of attachement that correspond to the document |
1505 | + attachment_ids = self.search(cr, uid, [('store_fname', '=', f.store_fname), ('parent_id.name', '=', f.parent_id.name)], context=context) |
1506 | + #If we have more than 1 attachment for a same file, we will not unlink it. |
1507 | + canUnlink = len(attachment_ids) |
1508 | + #If canUnlink is bigger than 1 it means that the document has more than 1 attachement. |
1509 | + #We therefore cannot unlink that document. |
1510 | + if canUnlink == 1: |
1511 | + #assert storage_id, "Strange, found file #%s w/o storage!" % f.id #TOCHECK: after run yml, it's fail |
1512 | + if storage_id: |
1513 | + r = stor.prepare_unlink(cr, uid, storage_id, f) |
1514 | + if r: |
1515 | + unres.append(r) |
1516 | + else: |
1517 | + logging.getLogger('document').warning("Unlinking attachment #%s %s that has no storage", |
1518 | + f.id, f.name) |
1519 | res = super(document_file, self).unlink(cr, uid, ids, context) |
1520 | stor.do_unlink(cr, uid, unres) |
1521 | return res |
1522 | |
1523 | === modified file 'fetchmail/fetchmail.py' |
1524 | --- fetchmail/fetchmail.py 2012-07-27 13:50:07 +0000 |
1525 | +++ fetchmail/fetchmail.py 2014-04-22 12:10:57 +0000 |
1526 | @@ -255,7 +255,7 @@ |
1527 | context={} |
1528 | fetchmail_server_id = context.get('fetchmail_server_id') |
1529 | if fetchmail_server_id: |
1530 | - values['fetchmail_server_id'] = server_id |
1531 | + values['fetchmail_server_id'] = fetchmail_server_id |
1532 | res = super(mail_message,self).write(cr, uid, ids, values, context=context) |
1533 | return res |
1534 | |
1535 | |
1536 | === modified file 'hr/hr.py' |
1537 | --- hr/hr.py 2012-01-31 13:36:57 +0000 |
1538 | +++ hr/hr.py 2014-04-22 12:10:57 +0000 |
1539 | @@ -184,9 +184,10 @@ |
1540 | resource = employee.resource_id |
1541 | if resource: |
1542 | resource_ids.append(resource.id) |
1543 | + res = super(hr_employee, self).unlink(cr, uid, ids, context=context) |
1544 | if resource_ids: |
1545 | resource_obj.unlink(cr, uid, resource_ids, context=context) |
1546 | - return super(hr_employee, self).unlink(cr, uid, ids, context=context) |
1547 | + return res |
1548 | |
1549 | def onchange_address_id(self, cr, uid, ids, address, context=None): |
1550 | if address: |
1551 | |
1552 | === modified file 'hr_payroll/hr_payroll.py' |
1553 | --- hr_payroll/hr_payroll.py 2012-01-31 13:36:57 +0000 |
1554 | +++ hr_payroll/hr_payroll.py 2014-04-22 12:10:57 +0000 |
1555 | @@ -375,7 +375,7 @@ |
1556 | #OR if it starts between the given dates |
1557 | clause_2 = ['&',('date_start', '<=', date_to),('date_start','>=', date_from)] |
1558 | #OR if it starts before the date_from and finish after the date_end (or never finish) |
1559 | - clause_3 = [('date_start','<=', date_from),'|',('date_end', '=', False),('date_end','>=', date_to)] |
1560 | + clause_3 = ['&',('date_start','<=', date_from),'|',('date_end', '=', False),('date_end','>=', date_to)] |
1561 | clause_final = [('employee_id', '=', employee.id),'|','|'] + clause_1 + clause_2 + clause_3 |
1562 | contract_ids = contract_obj.search(cr, uid, clause_final, context=context) |
1563 | return contract_ids |
1564 | |
1565 | === modified file 'hr_recruitment/hr_recruitment_view.xml' |
1566 | --- hr_recruitment/hr_recruitment_view.xml 2011-12-21 13:10:28 +0000 |
1567 | +++ hr_recruitment/hr_recruitment_view.xml 2014-04-22 12:10:57 +0000 |
1568 | @@ -104,7 +104,7 @@ |
1569 | name="%(action_hr_recruitment_partner_create)d" |
1570 | icon="gtk-index" type="action" attrs="{'readonly':[('partner_id','!=',False)]}" groups="base.group_partner_manager"/> |
1571 | <newline/> |
1572 | - <field name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)" colspan="3"/> |
1573 | + <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"/> |
1574 | <field name="email_from" colspan="3"/> |
1575 | <field name="partner_phone" colspan="3"/> |
1576 | <field name="partner_mobile" colspan="3"/> |
1577 | |
1578 | === modified file 'hr_timesheet/hr_timesheet.py' |
1579 | --- hr_timesheet/hr_timesheet.py 2012-02-14 12:25:20 +0000 |
1580 | +++ hr_timesheet/hr_timesheet.py 2014-04-22 12:10:57 +0000 |
1581 | @@ -74,8 +74,7 @@ |
1582 | toremove = {} |
1583 | for obj in self.browse(cr, uid, ids, context=context): |
1584 | toremove[obj.line_id.id] = True |
1585 | - self.pool.get('account.analytic.line').unlink(cr, uid, toremove.keys(), context=context) |
1586 | - return super(hr_analytic_timesheet, self).unlink(cr, uid, ids, context=context) |
1587 | + return self.pool.get('account.analytic.line').unlink(cr, uid, toremove.keys(), context=context) |
1588 | |
1589 | |
1590 | def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, company_id, unit=False, journal_id=False, context=None): |
1591 | |
1592 | === modified file 'hr_timesheet_invoice/hr_timesheet_invoice.py' |
1593 | --- hr_timesheet_invoice/hr_timesheet_invoice.py 2012-01-03 12:33:39 +0000 |
1594 | +++ hr_timesheet_invoice/hr_timesheet_invoice.py 2014-04-22 12:10:57 +0000 |
1595 | @@ -193,10 +193,13 @@ |
1596 | res = super(account_move_line, self).create_analytic_lines(cr, uid, ids,context=context) |
1597 | analytic_line_obj = self.pool.get('account.analytic.line') |
1598 | for move_line in self.browse(cr, uid, ids, context=context): |
1599 | + #For customer invoice, link analytic line to the invoice so it is not proposed for invoicing in Bill Tasks Work |
1600 | + invoice_id = move_line.invoice and move_line.invoice.type in ('out_invoice','out_refund') and move_line.invoice.id or False |
1601 | for line in move_line.analytic_lines: |
1602 | - toinv = line.account_id.to_invoice.id |
1603 | - if toinv: |
1604 | - analytic_line_obj.write(cr, uid, line.id, {'to_invoice': toinv}) |
1605 | + analytic_line_obj.write(cr, uid, line.id, { |
1606 | + 'invoice_id': invoice_id, |
1607 | + 'to_invoice': line.account_id.to_invoice and line.account_id.to_invoice.id or False |
1608 | + }, context=context) |
1609 | return res |
1610 | |
1611 | account_move_line() |
1612 | |
1613 | === modified file 'hr_timesheet_sheet/hr_timesheet_sheet.py' |
1614 | --- hr_timesheet_sheet/hr_timesheet_sheet.py 2012-08-31 10:45:03 +0000 |
1615 | +++ hr_timesheet_sheet/hr_timesheet_sheet.py 2014-04-22 12:10:57 +0000 |
1616 | @@ -519,7 +519,7 @@ |
1617 | store={ |
1618 | 'hr_timesheet_sheet.sheet': (_get_hr_timesheet_sheet, ['employee_id', 'date_from', 'date_to'], 10), |
1619 | 'account.analytic.line': (_get_account_analytic_line, ['user_id', 'date'], 10), |
1620 | - 'hr.analytic.timesheet': (lambda self,cr,uid,ids,context=None: ids, ['line_id'], 10), |
1621 | + 'hr.analytic.timesheet': (lambda self,cr,uid,ids,context=None: ids, None, 10), |
1622 | }, |
1623 | ), |
1624 | } |
1625 | |
1626 | === modified file 'l10n_nl/__openerp__.py' |
1627 | --- l10n_nl/__openerp__.py 2011-12-19 16:54:40 +0000 |
1628 | +++ l10n_nl/__openerp__.py 2014-04-22 12:10:57 +0000 |
1629 | @@ -118,6 +118,9 @@ |
1630 | ], |
1631 | "init_xml" : [], |
1632 | "update_xml" : ["account_chart_netherlands.xml", |
1633 | + "account_fiscal_position_template.xml", |
1634 | + "account_fiscal_position_tax_template.xml", |
1635 | + "account_fiscal_position_account_template.xml", |
1636 | "l10n_nl_wizard.xml" |
1637 | ], |
1638 | "demo_xml" : [ |
1639 | |
1640 | === modified file 'l10n_nl/account_chart_netherlands.xml' |
1641 | --- l10n_nl/account_chart_netherlands.xml 2012-03-14 12:53:24 +0000 |
1642 | +++ l10n_nl/account_chart_netherlands.xml 2014-04-22 12:10:57 +0000 |
1643 | @@ -1424,7 +1424,7 @@ |
1644 | <field name="reconcile" eval="True"/> |
1645 | <field ref="a_15" name="parent_id"/> |
1646 | </record> |
1647 | - <record id="vat_payable6" model="account.account.template"> |
1648 | + <record id="vat_payable_low" model="account.account.template"> |
1649 | <field name="name">Btw af te dragen laag</field> |
1650 | <field name="code">1601</field> |
1651 | <field name="type">other</field> |
1652 | @@ -1432,7 +1432,7 @@ |
1653 | <field name="reconcile" eval="False"/> |
1654 | <field ref="a_15" name="parent_id"/> |
1655 | </record> |
1656 | - <record id="vat_payable19" model="account.account.template"> |
1657 | + <record id="vat_payable_high" model="account.account.template"> |
1658 | <field name="name">Btw af te dragen hoog</field> |
1659 | <field name="code">1602</field> |
1660 | <field name="type">other</field> |
1661 | @@ -1448,7 +1448,7 @@ |
1662 | <field name="reconcile" eval="False"/> |
1663 | <field ref="a_15" name="parent_id"/> |
1664 | </record> |
1665 | - <record id="vat_refund6" model="account.account.template"> |
1666 | + <record id="vat_refund_low" model="account.account.template"> |
1667 | <field name="name">Btw te vorderen laag</field> |
1668 | <field name="code">1611</field> |
1669 | <field name="type">other</field> |
1670 | @@ -1456,7 +1456,7 @@ |
1671 | <field name="reconcile" eval="False"/> |
1672 | <field ref="a_15" name="parent_id"/> |
1673 | </record> |
1674 | - <record id="vat_refund19" model="account.account.template"> |
1675 | + <record id="vat_refund_high" model="account.account.template"> |
1676 | <field name="name">Btw te vorderen hoog</field> |
1677 | <field name="code">1612</field> |
1678 | <field name="type">other</field> |
1679 | @@ -3909,7 +3909,7 @@ |
1680 | <record id="btw_code_1a" model="account.tax.code.template"> |
1681 | <field name="code">1a</field> |
1682 | <field name="parent_id" ref="btw_code_binnenland"/> |
1683 | - <field name="name">Leveringen/diensten belast met 19% (BTW)</field> |
1684 | + <field name="name">Leveringen/diensten belast met 21% (BTW)</field> |
1685 | </record> |
1686 | <record id="btw_code_1b" model="account.tax.code.template"> |
1687 | <field name="code">1b</field> |
1688 | @@ -3955,11 +3955,13 @@ |
1689 | <field name="code">4a</field> |
1690 | <field name="parent_id" ref="btw_code_vanuit_buitenland"/> |
1691 | <field name="name">Leveringen uit landen buiten de EU (invoer) (BTW)</field> |
1692 | + <field name="sign" eval="-1" /> |
1693 | </record> |
1694 | <record id="btw_code_4b" model="account.tax.code.template"> |
1695 | <field name="code">4b</field> |
1696 | <field name="parent_id" ref="btw_code_vanuit_buitenland"/> |
1697 | <field name="name">Verwerving van goederen uit landen binnen de EU (BTW)</field> |
1698 | + <field name="sign" eval="-1" /> |
1699 | </record> |
1700 | <!-- 5. Voorbelasting, kleineondernemersregeling, schatting en eindtotaal --> |
1701 | <record id="btw_code_voorbelasting" model="account.tax.code.template"> |
1702 | @@ -4019,7 +4021,7 @@ |
1703 | <record id="omz_code_1a" model="account.tax.code.template"> |
1704 | <field name="code">1a</field> |
1705 | <field name="parent_id" ref="omz_code_binnenland"/> |
1706 | - <field name="name">Leveringen/diensten belast met 19% (omzet)</field> |
1707 | + <field name="name">Leveringen/diensten belast met 21% (omzet)</field> |
1708 | </record> |
1709 | <record id="omz_code_1b" model="account.tax.code.template"> |
1710 | <field name="code">1b</field> |
1711 | @@ -4100,6 +4102,7 @@ |
1712 | <field name="property_account_payable" ref="a_pay"/> <!-- crediteuren --> |
1713 | <field name="property_account_expense_categ" ref="a_expense"/><!-- aankoop grondstoffen --> |
1714 | <field name="property_account_income_categ" ref="a_sale"/> <!-- verkoop rekening --> |
1715 | + <field name="property_reserve_and_surplus_account" ref="a_9999"/> |
1716 | </record> |
1717 | |
1718 | <!-- BTW Template |
1719 | @@ -4130,436 +4133,541 @@ |
1720 | <!-- Binnen Nederland --> |
1721 | <!-- Verkoop BTW --> |
1722 | <record id="btw_0" model="account.tax.template"> |
1723 | + <field name="sequence">10</field> |
1724 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1725 | <field name="name">Verkopen/omzet onbelast (nul-tarief)</field> |
1726 | <field name="description">0% BTW</field> |
1727 | <field eval="0.00" name="amount"/> |
1728 | <field name="type">percent</field> |
1729 | <field name="account_collected_id" ref="vat_payable0"/> |
1730 | - <field name="account_paid_id" ref="vat_refund0"/> |
1731 | + <field name="account_paid_id" ref="vat_payable0"/> |
1732 | <field name="base_code_id" ref="omz_code_1e"/> |
1733 | <field name="ref_base_code_id" ref="omz_code_1e"/> |
1734 | + <field name="ref_base_sign" eval="-1"/> |
1735 | + <field name="ref_tax_sign" eval="-1"/> |
1736 | <field name="type_tax_use">sale</field> |
1737 | </record> |
1738 | <record id="btw_6" model="account.tax.template"> |
1739 | + <field name="sequence">10</field> |
1740 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1741 | <field name="name">Verkopen/omzet laag</field> |
1742 | <field name="description">6% BTW</field> |
1743 | <field eval="0.06" name="amount"/> |
1744 | <field name="type">percent</field> |
1745 | - <field name="account_collected_id" ref="vat_payable6"/> |
1746 | - <field name="account_paid_id" ref="vat_refund6"/> |
1747 | + <field name="account_collected_id" ref="vat_payable_low"/> |
1748 | + <field name="account_paid_id" ref="vat_payable_low"/> |
1749 | <field name="base_code_id" ref="omz_code_1b"/> |
1750 | <field name="tax_code_id" ref="btw_code_1b"/> |
1751 | <field name="ref_base_code_id" ref="omz_code_1b"/> |
1752 | <field name="ref_tax_code_id" ref="btw_code_1b"/> |
1753 | + <field name="ref_base_sign" eval="-1"/> |
1754 | + <field name="ref_tax_sign" eval="-1"/> |
1755 | <field name="type_tax_use">sale</field> |
1756 | </record> |
1757 | - <record id="btw_19" model="account.tax.template"> |
1758 | + <record id="btw_21" model="account.tax.template"> |
1759 | + <field name="sequence">5</field> |
1760 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1761 | <field name="name">Verkopen/omzet hoog</field> |
1762 | - <field name="description">19% BTW</field> |
1763 | - <field eval="0.19" name="amount"/> |
1764 | + <field name="description">21% BTW</field> |
1765 | + <field eval="0.21" name="amount"/> |
1766 | <field name="type">percent</field> |
1767 | - <field name="account_collected_id" ref="vat_payable19"/> |
1768 | - <field name="account_paid_id" ref="vat_refund19"/> |
1769 | + <field name="account_collected_id" ref="vat_payable_high"/> |
1770 | + <field name="account_paid_id" ref="vat_payable_high"/> |
1771 | <field name="base_code_id" ref="omz_code_1a"/> |
1772 | <field name="tax_code_id" ref="btw_code_1a"/> |
1773 | <field name="ref_base_code_id" ref="omz_code_1a"/> |
1774 | <field name="ref_tax_code_id" ref="btw_code_1a"/> |
1775 | + <field name="ref_base_sign" eval="-1"/> |
1776 | + <field name="ref_tax_sign" eval="-1"/> |
1777 | <field name="type_tax_use">sale</field> |
1778 | </record> |
1779 | <!-- TODO - nakijken btw overig op percentage--> |
1780 | <record id="btw_overig" model="account.tax.template"> |
1781 | + <field name="sequence">15</field> |
1782 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1783 | <field name="name">Verkopen/omzet overig</field> |
1784 | <field name="description">variabel BTW</field> |
1785 | - <field eval="0.19" name="amount"/> |
1786 | + <field eval="0.21" name="amount"/> |
1787 | <field name="type">percent</field> |
1788 | - <field name="account_collected_id" ref="vat_payable19"/> |
1789 | - <field name="account_paid_id" ref="vat_refund19"/> |
1790 | + <field name="account_collected_id" ref="vat_payable_high"/> |
1791 | + <field name="account_paid_id" ref="vat_payable_high"/> |
1792 | <field name="base_code_id" ref="omz_code_1a"/> |
1793 | <field name="tax_code_id" ref="btw_code_1a"/> |
1794 | <field name="ref_base_code_id" ref="omz_code_1c"/> |
1795 | <field name="ref_tax_code_id" ref="btw_code_1c"/> |
1796 | + <field name="ref_base_sign" eval="-1"/> |
1797 | + <field name="ref_tax_sign" eval="-1"/> |
1798 | <field name="type_tax_use">sale</field> |
1799 | </record> |
1800 | |
1801 | <!--Inkoop BTW --> |
1802 | <record id="btw_6_buy" model="account.tax.template"> |
1803 | + <field name="sequence">10</field> |
1804 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1805 | <field name="name">BTW te vorderen laag (inkopen)</field> |
1806 | <field name="description">6% BTW</field> |
1807 | <field eval="0.06" name="amount"/> |
1808 | <field name="type">percent</field> |
1809 | - <field name="account_collected_id" ref="vat_refund6"/> |
1810 | - <field name="account_paid_id" ref="vat_payable6"/> |
1811 | + <field name="account_collected_id" ref="vat_refund_low"/> |
1812 | + <field name="account_paid_id" ref="vat_refund_low"/> |
1813 | <field name="tax_code_id" ref="btw_code_5b"/> |
1814 | <field name="ref_tax_code_id" ref="btw_code_5b"/> |
1815 | + <field name="ref_base_sign" eval="-1"/> |
1816 | + <field name="ref_tax_sign" eval="-1"/> |
1817 | <field name="type_tax_use">purchase</field> |
1818 | </record> |
1819 | - <record id="btw_19_buy" model="account.tax.template"> |
1820 | + <record id="btw_21_buy" model="account.tax.template"> |
1821 | + <field name="sequence">5</field> |
1822 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1823 | <field name="name">BTW te vorderen hoog (inkopen)</field> |
1824 | - <field name="description">19% BTW</field> |
1825 | - <field eval="0.19" name="amount"/> |
1826 | + <field name="description">21% BTW</field> |
1827 | + <field eval="0.21" name="amount"/> |
1828 | <field name="type">percent</field> |
1829 | - <field name="account_collected_id" ref="vat_refund19"/> |
1830 | - <field name="account_paid_id" ref="vat_payable19"/> |
1831 | + <field name="account_collected_id" ref="vat_refund_high"/> |
1832 | + <field name="account_paid_id" ref="vat_refund_high"/> |
1833 | <field name="tax_code_id" ref="btw_code_5b"/> |
1834 | <field name="ref_tax_code_id" ref="btw_code_5b"/> |
1835 | + <field name="ref_base_sign" eval="-1"/> |
1836 | + <field name="ref_tax_sign" eval="-1"/> |
1837 | <field name="type_tax_use">purchase</field> |
1838 | </record> |
1839 | <record id="btw_overig_buy" model="account.tax.template"> |
1840 | + <field name="sequence">15</field> |
1841 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1842 | <field name="name">BTW te vorderen overig (inkopen)</field> |
1843 | <field name="description">variabel BTW</field> |
1844 | - <field eval="0.19" name="amount"/> |
1845 | + <field eval="0.21" name="amount"/> |
1846 | <field name="type">percent</field> |
1847 | - <field name="account_collected_id" ref="vat_refund19"/> |
1848 | - <field name="account_paid_id" ref="vat_payable19"/> |
1849 | + <field name="account_collected_id" ref="vat_refund_high"/> |
1850 | + <field name="account_paid_id" ref="vat_refund_high"/> |
1851 | <field name="tax_code_id" ref="btw_code_5b"/> |
1852 | <field name="ref_tax_code_id" ref="btw_code_5b"/> |
1853 | + <field name="ref_base_sign" eval="-1"/> |
1854 | + <field name="ref_tax_sign" eval="-1"/> |
1855 | <field name="type_tax_use">purchase</field> |
1856 | </record> |
1857 | <!--BTW verlegd--> |
1858 | - <record id="btw_verk_0" model="account.tax.template"> |
1859 | + <record id="btw_verk_0" model="account.tax.template"> |
1860 | + <field name="sequence">15</field> |
1861 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1862 | <field name="name">BTW af te dragen verlegd (verkopen)</field> |
1863 | <field name="description">0% BTW verlegd</field> |
1864 | <field eval="0.00" name="amount"/> |
1865 | <field name="type">percent</field> |
1866 | <field name="account_collected_id" ref="vat_payable_verlegd"/> |
1867 | - <field name="account_paid_id" ref="vat_refund_verlegd"/> |
1868 | + <field name="account_paid_id" ref="vat_payable_verlegd"/> |
1869 | <field eval="omz_code_1e" name="base_code_id"/> |
1870 | <field eval="omz_code_1e" name="ref_base_code_id"/> |
1871 | + <field name="ref_base_sign" eval="-1"/> |
1872 | + <field name="ref_tax_sign" eval="-1"/> |
1873 | <field name="type_tax_use">purchase</field> |
1874 | </record> |
1875 | <record id="btw_ink_0" model="account.tax.template"> |
1876 | + <field name="sequence">15</field> |
1877 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1878 | <field name="name">BTW af te dragen verlegd (inkopen)</field> |
1879 | - <field name="description">19% BTW verlegd</field> |
1880 | - <field eval="0.19" name="amount"/> |
1881 | + <field name="description">21% BTW verlegd</field> |
1882 | + <field eval="0.21" name="amount"/> |
1883 | <field name="type">percent</field> |
1884 | <field name="account_collected_id" ref="vat_payable_verlegd"/> |
1885 | - <field name="account_paid_id" ref="vat_refund_verlegd"/> |
1886 | + <field name="account_paid_id" ref="vat_payable_verlegd"/> |
1887 | <field eval="omz_code_2a" name="base_code_id"/> |
1888 | <field eval="omz_code_2a" name="ref_base_code_id"/> |
1889 | + <field name="ref_base_sign" eval="-1"/> |
1890 | + <field name="ref_tax_sign" eval="-1"/> |
1891 | <field name="type_tax_use">purchase</field> |
1892 | <field eval="True" name="child_depend"/> |
1893 | </record> |
1894 | - <record id="btw_ink_0_1" model="account.tax.template"> |
1895 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1896 | - <field name="name">BTW af te dragen verlegd (inkopen1)</field> |
1897 | - <field eval="1.00" name="amount"/> |
1898 | - <field name="type">percent</field> |
1899 | - <field eval="btw_ink_0" name="parent_id"/> |
1900 | - <field name="account_collected_id" ref="vat_payable_verlegd"/> |
1901 | - <field name="account_paid_id" ref="vat_refund_verlegd"/> |
1902 | - <field eval="btw_code_2a" name="tax_code_id"/> |
1903 | - <field eval="btw_code_2a" name="ref_tax_code_id"/> |
1904 | - <field name="type_tax_use">purchase</field> |
1905 | - </record> |
1906 | - <record id="btw_ink_0_2" model="account.tax.template"> |
1907 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1908 | - <field name="name">BTW af te dragen verlegd (inkopen2)</field> |
1909 | - <field eval="-1.00" name="amount"/> |
1910 | - <field name="type">percent</field> |
1911 | - <field eval="btw_ink_0" name="parent_id"/> |
1912 | - <field name="account_collected_id" ref="vat_payable_verlegd"/> |
1913 | - <field name="account_paid_id" ref="vat_refund_verlegd"/> |
1914 | - <field eval="btw_code_5b" name="tax_code_id"/> |
1915 | - <field eval="btw_code_5b" name="ref_tax_code_id"/> |
1916 | - <field name="type_tax_use">purchase</field> |
1917 | - </record> |
1918 | + <record id="btw_ink_0_1" model="account.tax.template"> |
1919 | + <field name="sequence">99</field> |
1920 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1921 | + <field name="name">BTW af te dragen verlegd (inkopen1)</field> |
1922 | + <field eval="1.00" name="amount"/> |
1923 | + <field name="type">percent</field> |
1924 | + <field eval="btw_ink_0" name="parent_id"/> |
1925 | + <field name="account_collected_id" ref="vat_payable_verlegd"/> |
1926 | + <field name="account_paid_id" ref="vat_payable_verlegd"/> |
1927 | + <field eval="btw_code_2a" name="tax_code_id"/> |
1928 | + <field eval="btw_code_2a" name="ref_tax_code_id"/> |
1929 | + <field name="ref_base_sign" eval="-1"/> |
1930 | + <field name="ref_tax_sign" eval="-1"/> |
1931 | + <field name="type_tax_use">purchase</field> |
1932 | + </record> |
1933 | + <record id="btw_ink_0_2" model="account.tax.template"> |
1934 | + <field name="sequence">99</field> |
1935 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1936 | + <field name="name">BTW af te dragen verlegd (inkopen2)</field> |
1937 | + <field eval="-1.00" name="amount"/> |
1938 | + <field name="type">percent</field> |
1939 | + <field eval="btw_ink_0" name="parent_id"/> |
1940 | + <field name="account_collected_id" ref="vat_payable_verlegd"/> |
1941 | + <field name="account_paid_id" ref="vat_payable_verlegd"/> |
1942 | + <field eval="btw_code_5b" name="tax_code_id"/> |
1943 | + <field eval="btw_code_5b" name="ref_tax_code_id"/> |
1944 | + <field name="ref_base_sign" eval="-1"/> |
1945 | + <field name="ref_tax_sign" eval="-1"/> |
1946 | + <field name="type_tax_use">purchase</field> |
1947 | + </record> |
1948 | <record id="btw_ink2_0" model="account.tax.template"> |
1949 | + <field name="sequence">15</field> |
1950 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1951 | <field name="name">BTW te vorderen verlegd (inkopen)</field> |
1952 | - <field name="description">19% BTW verlegd</field> |
1953 | - <field eval="0.19" name="amount"/> |
1954 | + <field name="description">21% BTW verlegd</field> |
1955 | + <field eval="0.21" name="amount"/> |
1956 | <field name="type">percent</field> |
1957 | <field name="account_collected_id" ref="vat_refund_verlegd"/> |
1958 | - <field name="account_paid_id" ref="vat_payable_verlegd"/> |
1959 | + <field name="account_paid_id" ref="vat_refund_verlegd"/> |
1960 | <field eval="omz_code_2a" name="base_code_id"/> |
1961 | <field eval="omz_code_2a" name="ref_base_code_id"/> |
1962 | + <field name="ref_base_sign" eval="-1"/> |
1963 | + <field name="ref_tax_sign" eval="-1"/> |
1964 | <field name="type_tax_use">purchase</field> |
1965 | <field eval="True" name="child_depend"/> |
1966 | </record> |
1967 | - <record id="btw_ink2_0_1" model="account.tax.template"> |
1968 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1969 | - <field name="name">BTW te vorderen verlegd (inkopen1)</field> |
1970 | - <field eval="1.00" name="amount"/> |
1971 | - <field name="type">percent</field> |
1972 | - <field eval="btw_ink2_0" name="parent_id"/> |
1973 | - <field name="account_collected_id" ref="vat_refund_verlegd"/> |
1974 | - <field name="account_paid_id" ref="vat_payable_verlegd"/> |
1975 | - <field eval="btw_code_2a" name="tax_code_id"/> |
1976 | - <field eval="btw_code_2a" name="ref_tax_code_id"/> |
1977 | - <field name="type_tax_use">purchase</field> |
1978 | - </record> |
1979 | - <record id="btw_ink2_0_2" model="account.tax.template"> |
1980 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1981 | - <field name="name">BTW te vorderen verlegd (inkopen2)</field> |
1982 | - <field eval="-1.00" name="amount"/> |
1983 | - <field name="type">percent</field> |
1984 | - <field eval="btw_ink2_0" name="parent_id"/> |
1985 | - <field name="account_collected_id" ref="vat_refund_verlegd"/> |
1986 | - <field name="account_paid_id" ref="vat_payable_verlegd"/> |
1987 | - <field eval="btw_code_5b" name="tax_code_id"/> |
1988 | - <field eval="btw_code_5b" name="ref_tax_code_id"/> |
1989 | - <field name="type_tax_use">purchase</field> |
1990 | - </record> |
1991 | + <record id="btw_ink2_0_1" model="account.tax.template"> |
1992 | + <field name="sequence">99</field> |
1993 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1994 | + <field name="name">BTW te vorderen verlegd (inkopen1)</field> |
1995 | + <field eval="1.00" name="amount"/> |
1996 | + <field name="type">percent</field> |
1997 | + <field eval="btw_ink2_0" name="parent_id"/> |
1998 | + <field name="account_collected_id" ref="vat_refund_verlegd"/> |
1999 | + <field name="account_paid_id" ref="vat_refund_verlegd"/> |
2000 | + <field eval="btw_code_2a" name="tax_code_id"/> |
2001 | + <field eval="btw_code_2a" name="ref_tax_code_id"/> |
2002 | + <field name="ref_base_sign" eval="-1"/> |
2003 | + <field name="ref_tax_sign" eval="-1"/> |
2004 | + <field name="type_tax_use">purchase</field> |
2005 | + </record> |
2006 | + <record id="btw_ink2_0_2" model="account.tax.template"> |
2007 | + <field name="sequence">99</field> |
2008 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2009 | + <field name="name">BTW te vorderen verlegd (inkopen2)</field> |
2010 | + <field eval="-1.00" name="amount"/> |
2011 | + <field name="type">percent</field> |
2012 | + <field eval="btw_ink2_0" name="parent_id"/> |
2013 | + <field name="account_collected_id" ref="vat_refund_verlegd"/> |
2014 | + <field name="account_paid_id" ref="vat_refund_verlegd"/> |
2015 | + <field eval="btw_code_5b" name="tax_code_id"/> |
2016 | + <field eval="btw_code_5b" name="ref_tax_code_id"/> |
2017 | + <field name="ref_base_sign" eval="-1"/> |
2018 | + <field name="ref_tax_sign" eval="-1"/> |
2019 | + <field name="type_tax_use">purchase</field> |
2020 | + </record> |
2021 | <!-- Binnen de EU --> |
2022 | <!-- BTW inkoop --> |
2023 | <record id="btw_I_6" model="account.tax.template"> |
2024 | + <field name="sequence">20</field> |
2025 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2026 | <field name="name">Inkopen import binnen EU laag</field> |
2027 | - <field name="description">6% BTW import binnen EU</field> |
2028 | + <field name="description">6% BTW import binnen EU</field> |
2029 | <field eval="0.06" name="amount"/> |
2030 | <field name="type">percent</field> |
2031 | <field eval="True" name="child_depend"/> |
2032 | <field eval="omz_code_4b" name="base_code_id"/> |
2033 | <field eval="omz_code_4b" name="ref_base_code_id"/> |
2034 | + <field name="ref_base_sign" eval="-1"/> |
2035 | + <field name="ref_tax_sign" eval="-1"/> |
2036 | <field name="type_tax_use">purchase</field> |
2037 | </record> |
2038 | - <record id="btw_I_6_1" model="account.tax.template"> |
2039 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2040 | - <field name="name">Inkopen import binnen EU laag(1)</field> |
2041 | - <field eval="1.00" name="amount"/> |
2042 | - <field name="type">percent</field> |
2043 | - <field name="parent_id" ref="btw_I_6"/> |
2044 | - <field name="account_collected_id" ref="vat_payable6"/> |
2045 | - <field name="account_paid_id" ref="vat_payable6"/> |
2046 | - <field eval="btw_code_4b" name="tax_code_id"/> |
2047 | - <field eval="btw_code_4b" name="ref_tax_code_id"/> |
2048 | - <field name="type_tax_use">purchase</field> |
2049 | - </record> |
2050 | - <record id="btw_I_6_2" model="account.tax.template"> |
2051 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2052 | - <field name="name">Inkopen import binnen EU laag(2)</field> |
2053 | - <field eval="-1.00" name="amount"/> |
2054 | - <field name="type">percent</field> |
2055 | - <field name="parent_id" ref="btw_I_6"/> |
2056 | - <field name="account_collected_id" ref="vat_refund6"/> |
2057 | - <field name="account_paid_id" ref="vat_refund6"/> |
2058 | - <field eval="btw_code_5b" name="tax_code_id"/> |
2059 | - <field eval="btw_code_5b" name="ref_tax_code_id"/> |
2060 | - <field name="type_tax_use">purchase</field> |
2061 | - </record> |
2062 | - <record id="btw_I_19" model="account.tax.template"> |
2063 | + <record id="btw_I_6_1" model="account.tax.template"> |
2064 | + <field name="sequence">99</field> |
2065 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2066 | + <field name="name">Inkopen import binnen EU laag(1)</field> |
2067 | + <field eval="-1.00" name="amount"/> |
2068 | + <field name="type">percent</field> |
2069 | + <field name="parent_id" ref="btw_I_6"/> |
2070 | + <field name="account_collected_id" ref="vat_payable_low"/> |
2071 | + <field name="account_paid_id" ref="vat_payable_low"/> |
2072 | + <field eval="btw_code_4b" name="tax_code_id"/> |
2073 | + <field eval="btw_code_4b" name="ref_tax_code_id"/> |
2074 | + <field name="ref_base_sign" eval="-1"/> |
2075 | + <field name="ref_tax_sign" eval="-1"/> |
2076 | + <field name="type_tax_use">purchase</field> |
2077 | + </record> |
2078 | + <record id="btw_I_6_2" model="account.tax.template"> |
2079 | + <field name="sequence">99</field> |
2080 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2081 | + <field name="name">Inkopen import binnen EU laag(2)</field> |
2082 | + <field eval="1.00" name="amount"/> |
2083 | + <field name="type">percent</field> |
2084 | + <field name="parent_id" ref="btw_I_6"/> |
2085 | + <field name="account_collected_id" ref="vat_refund_low"/> |
2086 | + <field name="account_paid_id" ref="vat_refund_low"/> |
2087 | + <field eval="btw_code_5b" name="tax_code_id"/> |
2088 | + <field eval="btw_code_5b" name="ref_tax_code_id"/> |
2089 | + <field name="ref_base_sign" eval="-1"/> |
2090 | + <field name="ref_tax_sign" eval="-1"/> |
2091 | + <field name="type_tax_use">purchase</field> |
2092 | + </record> |
2093 | + <record id="btw_I_21" model="account.tax.template"> |
2094 | + <field name="sequence">20</field> |
2095 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2096 | <field name="name">Inkopen import binnen EU hoog</field> |
2097 | - <field name="description">19% BTW import binnen EU</field> |
2098 | - <field eval="0.19" name="amount"/> |
2099 | + <field name="description">21% BTW import binnen EU</field> |
2100 | + <field eval="0.21" name="amount"/> |
2101 | <field name="type">percent</field> |
2102 | <field eval="True" name="child_depend"/> |
2103 | <field eval="omz_code_4b" name="base_code_id"/> |
2104 | <field eval="omz_code_4b" name="ref_base_code_id"/> |
2105 | + <field name="ref_base_sign" eval="-1"/> |
2106 | + <field name="ref_tax_sign" eval="-1"/> |
2107 | <field name="type_tax_use">purchase</field> |
2108 | </record> |
2109 | - <record id="btw_I_19_1" model="account.tax.template"> |
2110 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2111 | - <field name="name">Inkopen import binnen EU hoog(1)</field> |
2112 | - <field eval="1.00" name="amount"/> |
2113 | - <field name="type">percent</field> |
2114 | - <field name="parent_id" ref="btw_I_19"/> |
2115 | - <field name="account_collected_id" ref="vat_payable19"/> |
2116 | - <field name="account_paid_id" ref="vat_payable19"/> |
2117 | - <field eval="btw_code_4b" name="tax_code_id"/> |
2118 | - <field eval="btw_code_4b" name="ref_tax_code_id"/> |
2119 | - <field name="type_tax_use">purchase</field> |
2120 | - </record> |
2121 | - <record id="btw_I_19_2" model="account.tax.template"> |
2122 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2123 | - <field name="name">Inkopen import binnen EU hoog(2)</field> |
2124 | - <field eval="-1.00" name="amount"/> |
2125 | - <field name="type">percent</field> |
2126 | - <field name="parent_id" ref="btw_I_19"/> |
2127 | - <field name="account_collected_id" ref="vat_refund19"/> |
2128 | - <field name="account_paid_id" ref="vat_refund19"/> |
2129 | - <field eval="btw_code_5b" name="tax_code_id"/> |
2130 | - <field eval="btw_code_5b" name="ref_tax_code_id"/> |
2131 | - <field name="type_tax_use">purchase</field> |
2132 | - </record> |
2133 | + <record id="btw_I_21_1" model="account.tax.template"> |
2134 | + <field name="sequence">99</field> |
2135 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2136 | + <field name="name">Inkopen import binnen EU hoog(1)</field> |
2137 | + <field eval="-1.00" name="amount"/> |
2138 | + <field name="type">percent</field> |
2139 | + <field name="parent_id" ref="btw_I_21"/> |
2140 | + <field name="account_collected_id" ref="vat_payable_high"/> |
2141 | + <field name="account_paid_id" ref="vat_payable_high"/> |
2142 | + <field eval="btw_code_4b" name="tax_code_id"/> |
2143 | + <field eval="btw_code_4b" name="ref_tax_code_id"/> |
2144 | + <field name="ref_base_sign" eval="-1"/> |
2145 | + <field name="ref_tax_sign" eval="-1"/> |
2146 | + <field name="type_tax_use">purchase</field> |
2147 | + </record> |
2148 | + <record id="btw_I_21_2" model="account.tax.template"> |
2149 | + <field name="sequence">99</field> |
2150 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2151 | + <field name="name">Inkopen import binnen EU hoog(2)</field> |
2152 | + <field eval="1.00" name="amount"/> |
2153 | + <field name="type">percent</field> |
2154 | + <field name="parent_id" ref="btw_I_21"/> |
2155 | + <field name="account_collected_id" ref="vat_refund_high"/> |
2156 | + <field name="account_paid_id" ref="vat_refund_high"/> |
2157 | + <field eval="btw_code_5b" name="tax_code_id"/> |
2158 | + <field eval="btw_code_5b" name="ref_tax_code_id"/> |
2159 | + <field name="ref_base_sign" eval="-1"/> |
2160 | + <field name="ref_tax_sign" eval="-1"/> |
2161 | + <field name="type_tax_use">purchase</field> |
2162 | + </record> |
2163 | <record id="btw_I_overig" model="account.tax.template"> |
2164 | + <field name="sequence">20</field> |
2165 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2166 | <field name="name">Inkopen import binnen EU overig</field> |
2167 | - <field name="description">0% BTW import binnen EU</field> |
2168 | + <field name="description">0% BTW import binnen EU</field> |
2169 | <field eval="0.00" name="amount"/> |
2170 | <field name="type">percent</field> |
2171 | <field eval="True" name="child_depend"/> |
2172 | <field eval="omz_code_4b" name="base_code_id"/> |
2173 | <field eval="omz_code_4b" name="ref_base_code_id"/> |
2174 | + <field name="ref_base_sign" eval="-1"/> |
2175 | + <field name="ref_tax_sign" eval="-1"/> |
2176 | <field name="type_tax_use">purchase</field> |
2177 | </record> |
2178 | - <record id="btw_I_overig_1" model="account.tax.template"> |
2179 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2180 | - <field name="name">Inkopen import binnen EU overig(1)</field> |
2181 | - <field eval="1.00" name="amount"/> |
2182 | - <field name="type">percent</field> |
2183 | - <field name="parent_id" ref="btw_I_overig"/> |
2184 | - <field name="account_collected_id" ref="vat_payable19"/> |
2185 | - <field name="account_paid_id" ref="vat_payable19"/> |
2186 | - <field eval="btw_code_4b" name="tax_code_id"/> |
2187 | - <field eval="btw_code_4b" name="ref_tax_code_id"/> |
2188 | - <field name="type_tax_use">purchase</field> |
2189 | - </record> |
2190 | - <record id="btw_I_overig_2" model="account.tax.template"> |
2191 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2192 | - <field name="name">Inkopen import binnen EU overig(2)</field> |
2193 | - <field eval="-1.00" name="amount"/> |
2194 | - <field name="type">percent</field> |
2195 | - <field name="parent_id" ref="btw_I_overig"/> |
2196 | - <field name="account_collected_id" ref="vat_refund19"/> |
2197 | - <field name="account_paid_id" ref="vat_refund19"/> |
2198 | - <field eval="btw_code_5b" name="tax_code_id"/> |
2199 | - <field eval="btw_code_5b" name="ref_tax_code_id"/> |
2200 | - <field name="type_tax_use">purchase</field> |
2201 | - </record> |
2202 | -<!-- BTW verkoop --> |
2203 | + <record id="btw_I_overig_1" model="account.tax.template"> |
2204 | + <field name="sequence">99</field> |
2205 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2206 | + <field name="name">Inkopen import binnen EU overig(1)</field> |
2207 | + <field eval="-1.00" name="amount"/> |
2208 | + <field name="type">percent</field> |
2209 | + <field name="parent_id" ref="btw_I_overig"/> |
2210 | + <field name="account_collected_id" ref="vat_payable_high"/> |
2211 | + <field name="account_paid_id" ref="vat_payable_high"/> |
2212 | + <field eval="btw_code_4b" name="tax_code_id"/> |
2213 | + <field eval="btw_code_4b" name="ref_tax_code_id"/> |
2214 | + <field name="ref_base_sign" eval="-1"/> |
2215 | + <field name="ref_tax_sign" eval="-1"/> |
2216 | + <field name="type_tax_use">purchase</field> |
2217 | + </record> |
2218 | + <record id="btw_I_overig_2" model="account.tax.template"> |
2219 | + <field name="sequence">99</field> |
2220 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2221 | + <field name="name">Inkopen import binnen EU overig(2)</field> |
2222 | + <field eval="1.00" name="amount"/> |
2223 | + <field name="type">percent</field> |
2224 | + <field name="parent_id" ref="btw_I_overig"/> |
2225 | + <field name="account_collected_id" ref="vat_refund_high"/> |
2226 | + <field name="account_paid_id" ref="vat_refund_high"/> |
2227 | + <field eval="btw_code_5b" name="tax_code_id"/> |
2228 | + <field eval="btw_code_5b" name="ref_tax_code_id"/> |
2229 | + <field name="ref_base_sign" eval="-1"/> |
2230 | + <field name="ref_tax_sign" eval="-1"/> |
2231 | + <field name="type_tax_use">purchase</field> |
2232 | + </record> |
2233 | +<!-- BTW verkoop --> |
2234 | <record id="btw_X0" model="account.tax.template"> |
2235 | + <field name="sequence">20</field> |
2236 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2237 | <field name="name">Verkopen export binnen EU</field> |
2238 | - <field name="description">BTW export binnen EU</field> |
2239 | + <field name="description">BTW export binnen EU</field> |
2240 | <field eval="0.00" name="amount"/> |
2241 | <field name="type">percent</field> |
2242 | <field name="account_collected_id" ref="vat_payable0"/> |
2243 | - <field name="account_paid_id" ref="vat_refund0"/> |
2244 | + <field name="account_paid_id" ref="vat_payable0"/> |
2245 | <field name="base_code_id" ref="omz_code_3b"/> |
2246 | <field name="ref_base_code_id" ref="omz_code_3b"/> |
2247 | + <field name="ref_base_sign" eval="-1"/> |
2248 | + <field name="ref_tax_sign" eval="-1"/> |
2249 | <field name="type_tax_use">sale</field> |
2250 | </record> |
2251 | <record id="btw_X2" model="account.tax.template"> |
2252 | + <field name="sequence">20</field> |
2253 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2254 | <field name="name">Installatie/afstandsverkopen binnen EU</field> |
2255 | - <field name="description">Inst./afst.verkopen binnen EU</field> |
2256 | + <field name="description">Inst./afst.verkopen binnen EU</field> |
2257 | <field eval="0.00" name="amount"/> |
2258 | <field name="type">percent</field> |
2259 | <field name="account_collected_id" ref="vat_payable0"/> |
2260 | - <field name="account_paid_id" ref="vat_refund0"/> |
2261 | + <field name="account_paid_id" ref="vat_payable0"/> |
2262 | <field name="base_code_id" ref="omz_code_3c"/> |
2263 | <field name="ref_base_code_id" ref="omz_code_3c"/> |
2264 | + <field name="ref_base_sign" eval="-1"/> |
2265 | + <field name="ref_tax_sign" eval="-1"/> |
2266 | <field name="type_tax_use">sale</field> |
2267 | </record> |
2268 | |
2269 | <!-- Buiten de EU --> |
2270 | <!-- BTW inkoop --> |
2271 | <record id="btw_E1" model="account.tax.template"> |
2272 | + <field name="sequence">20</field> |
2273 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2274 | <field name="name">Inkopen import buiten EU laag</field> |
2275 | - <field name="description">BTW import buiten EU</field> |
2276 | + <field name="description">BTW import buiten EU</field> |
2277 | <field eval="0.06" name="amount"/> |
2278 | <field name="type">percent</field> |
2279 | <field eval="True" name="child_depend"/> |
2280 | <field eval="omz_code_4a" name="base_code_id"/> |
2281 | <field eval="omz_code_4a" name="ref_base_code_id"/> |
2282 | + <field name="ref_base_sign" eval="-1"/> |
2283 | + <field name="ref_tax_sign" eval="-1"/> |
2284 | <field name="type_tax_use">purchase</field> |
2285 | </record> |
2286 | - <record id="btw_E1_1" model="account.tax.template"> |
2287 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2288 | - <field name="name">Inkopen import buiten EU laag(1)</field> |
2289 | - <field eval="1.00" name="amount"/> |
2290 | - <field name="type">percent</field> |
2291 | - <field name="parent_id" ref="btw_E1"/> |
2292 | - <field name="account_collected_id" ref="vat_payable6"/> |
2293 | - <field name="account_paid_id" ref="vat_payable6"/> |
2294 | - <field eval="btw_code_4a" name="tax_code_id"/> |
2295 | - <field eval="btw_code_4a" name="ref_tax_code_id"/> |
2296 | - <field name="type_tax_use">purchase</field> |
2297 | - </record> |
2298 | - <record id="btw_E1_2" model="account.tax.template"> |
2299 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2300 | - <field name="name">Inkopen import buiten EU laag(2)</field> |
2301 | - <field eval="-1.00" name="amount"/> |
2302 | - <field name="type">percent</field> |
2303 | - <field name="parent_id" ref="btw_E1"/> |
2304 | - <field name="account_collected_id" ref="vat_refund6"/> |
2305 | - <field name="account_paid_id" ref="vat_refund6"/> |
2306 | - <field eval="btw_code_5b" name="tax_code_id"/> |
2307 | - <field eval="btw_code_5b" name="ref_tax_code_id"/> |
2308 | - <field name="type_tax_use">purchase</field> |
2309 | - </record> |
2310 | + <record id="btw_E1_1" model="account.tax.template"> |
2311 | + <field name="sequence">99</field> |
2312 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2313 | + <field name="name">Inkopen import buiten EU laag(1)</field> |
2314 | + <field eval="-1.00" name="amount"/> |
2315 | + <field name="type">percent</field> |
2316 | + <field name="parent_id" ref="btw_E1"/> |
2317 | + <field name="account_collected_id" ref="vat_payable_low"/> |
2318 | + <field name="account_paid_id" ref="vat_payable_low"/> |
2319 | + <field eval="btw_code_4a" name="tax_code_id"/> |
2320 | + <field eval="btw_code_4a" name="ref_tax_code_id"/> |
2321 | + <field name="ref_base_sign" eval="-1"/> |
2322 | + <field name="ref_tax_sign" eval="-1"/> |
2323 | + <field name="type_tax_use">purchase</field> |
2324 | + </record> |
2325 | + <record id="btw_E1_2" model="account.tax.template"> |
2326 | + <field name="sequence">99</field> |
2327 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2328 | + <field name="name">Inkopen import buiten EU laag(2)</field> |
2329 | + <field eval="1.00" name="amount"/> |
2330 | + <field name="type">percent</field> |
2331 | + <field name="parent_id" ref="btw_E1"/> |
2332 | + <field name="account_collected_id" ref="vat_refund_low"/> |
2333 | + <field name="account_paid_id" ref="vat_refund_low"/> |
2334 | + <field eval="btw_code_5b" name="tax_code_id"/> |
2335 | + <field eval="btw_code_5b" name="ref_tax_code_id"/> |
2336 | + <field name="ref_base_sign" eval="-1"/> |
2337 | + <field name="ref_tax_sign" eval="-1"/> |
2338 | + <field name="type_tax_use">purchase</field> |
2339 | + </record> |
2340 | <record id="btw_E2" model="account.tax.template"> |
2341 | + <field name="sequence">20</field> |
2342 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2343 | <field name="name">Inkopen import buiten EU hoog</field> |
2344 | - <field name="description">BTW import buiten EU</field> |
2345 | - <field eval="0.19" name="amount"/> |
2346 | + <field name="description">BTW import buiten EU</field> |
2347 | + <field eval="0.21" name="amount"/> |
2348 | <field name="type">percent</field> |
2349 | <field eval="True" name="child_depend"/> |
2350 | <field eval="omz_code_4a" name="base_code_id"/> |
2351 | <field eval="omz_code_4a" name="ref_base_code_id"/> |
2352 | + <field name="ref_base_sign" eval="-1"/> |
2353 | + <field name="ref_tax_sign" eval="-1"/> |
2354 | <field name="type_tax_use">purchase</field> |
2355 | </record> |
2356 | - <record id="btw_E2_1" model="account.tax.template"> |
2357 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2358 | - <field name="name">Inkopen import buiten EU hoog(1)</field> |
2359 | - <field eval="1.00" name="amount"/> |
2360 | - <field name="type">percent</field> |
2361 | - <field name="parent_id" ref="btw_E2"/> |
2362 | - <field name="account_collected_id" ref="vat_payable19"/> |
2363 | - <field name="account_paid_id" ref="vat_payable19"/> |
2364 | - <field eval="btw_code_4a" name="tax_code_id"/> |
2365 | - <field eval="btw_code_4a" name="ref_tax_code_id"/> |
2366 | - <field name="type_tax_use">purchase</field> |
2367 | - </record> |
2368 | - <record id="btw_E2_2" model="account.tax.template"> |
2369 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2370 | - <field name="name">Inkopen import buiten EU hoog(2)</field> |
2371 | - <field eval="-1.00" name="amount"/> |
2372 | - <field name="type">percent</field> |
2373 | - <field name="parent_id" ref="btw_E2"/> |
2374 | - <field name="account_collected_id" ref="vat_refund19"/> |
2375 | - <field name="account_paid_id" ref="vat_refund19"/> |
2376 | - <field eval="btw_code_5b" name="tax_code_id"/> |
2377 | - <field eval="btw_code_5b" name="ref_tax_code_id"/> |
2378 | - <field name="type_tax_use">purchase</field> |
2379 | - </record> |
2380 | + <record id="btw_E2_1" model="account.tax.template"> |
2381 | + <field name="sequence">99</field> |
2382 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2383 | + <field name="name">Inkopen import buiten EU hoog(1)</field> |
2384 | + <field eval="-1.00" name="amount"/> |
2385 | + <field name="type">percent</field> |
2386 | + <field name="parent_id" ref="btw_E2"/> |
2387 | + <field name="account_collected_id" ref="vat_payable_high"/> |
2388 | + <field name="account_paid_id" ref="vat_payable_high"/> |
2389 | + <field eval="btw_code_4a" name="tax_code_id"/> |
2390 | + <field eval="btw_code_4a" name="ref_tax_code_id"/> |
2391 | + <field name="ref_base_sign" eval="-1"/> |
2392 | + <field name="ref_tax_sign" eval="-1"/> |
2393 | + <field name="type_tax_use">purchase</field> |
2394 | + </record> |
2395 | + <record id="btw_E2_2" model="account.tax.template"> |
2396 | + <field name="sequence">99</field> |
2397 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2398 | + <field name="name">Inkopen import buiten EU hoog(2)</field> |
2399 | + <field eval="1.00" name="amount"/> |
2400 | + <field name="type">percent</field> |
2401 | + <field name="parent_id" ref="btw_E2"/> |
2402 | + <field name="account_collected_id" ref="vat_refund_high"/> |
2403 | + <field name="account_paid_id" ref="vat_refund_high"/> |
2404 | + <field eval="btw_code_5b" name="tax_code_id"/> |
2405 | + <field eval="btw_code_5b" name="ref_tax_code_id"/> |
2406 | + <field name="ref_base_sign" eval="-1"/> |
2407 | + <field name="ref_tax_sign" eval="-1"/> |
2408 | + <field name="type_tax_use">purchase</field> |
2409 | + </record> |
2410 | <record id="btw_E_overig" model="account.tax.template"> |
2411 | + <field name="sequence">20</field> |
2412 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2413 | <field name="name">Inkopen import buiten EU overig</field> |
2414 | - <field name="description">BTW import buiten EU</field> |
2415 | - <field eval="0.19" name="amount"/> |
2416 | + <field name="description">BTW import buiten EU</field> |
2417 | + <field eval="0.21" name="amount"/> |
2418 | <field name="type">percent</field> |
2419 | <field eval="True" name="child_depend"/> |
2420 | <field eval="omz_code_4a" name="base_code_id"/> |
2421 | <field eval="omz_code_4a" name="ref_base_code_id"/> |
2422 | + <field name="ref_base_sign" eval="-1"/> |
2423 | + <field name="ref_tax_sign" eval="-1"/> |
2424 | <field name="type_tax_use">purchase</field> |
2425 | </record> |
2426 | - <record id="btw_E_overig_1" model="account.tax.template"> |
2427 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2428 | - <field name="name">Inkopen import buiten EU overig(1)</field> |
2429 | - <field eval="1.00" name="amount"/> |
2430 | - <field name="type">percent</field> |
2431 | - <field name="parent_id" ref="btw_E_overig"/> |
2432 | - <field name="account_collected_id" ref="vat_payable19"/> |
2433 | - <field name="account_paid_id" ref="vat_payable19"/> |
2434 | - <field eval="btw_code_4a" name="tax_code_id"/> |
2435 | - <field eval="btw_code_4a" name="ref_tax_code_id"/> |
2436 | - <field name="type_tax_use">purchase</field> |
2437 | - </record> |
2438 | - <record id="btw_E_overig_2" model="account.tax.template"> |
2439 | - <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2440 | - <field name="name">Inkopen import buiten EU overig(2)</field> |
2441 | - <field eval="-1.00" name="amount"/> |
2442 | - <field name="type">percent</field> |
2443 | - <field name="parent_id" ref="btw_E_overig"/> |
2444 | - <field name="account_collected_id" ref="vat_refund19"/> |
2445 | - <field name="account_paid_id" ref="vat_refund19"/> |
2446 | - <field eval="btw_code_5b" name="tax_code_id"/> |
2447 | - <field eval="btw_code_5b" name="ref_tax_code_id"/> |
2448 | - <field name="type_tax_use">purchase</field> |
2449 | - </record> |
2450 | + <record id="btw_E_overig_1" model="account.tax.template"> |
2451 | + <field name="sequence">99</field> |
2452 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2453 | + <field name="name">Inkopen import buiten EU overig(1)</field> |
2454 | + <field eval="-1.00" name="amount"/> |
2455 | + <field name="type">percent</field> |
2456 | + <field name="parent_id" ref="btw_E_overig"/> |
2457 | + <field name="account_collected_id" ref="vat_payable_high"/> |
2458 | + <field name="account_paid_id" ref="vat_payable_high"/> |
2459 | + <field eval="btw_code_4a" name="tax_code_id"/> |
2460 | + <field eval="btw_code_4a" name="ref_tax_code_id"/> |
2461 | + <field name="ref_base_sign" eval="-1"/> |
2462 | + <field name="ref_tax_sign" eval="-1"/> |
2463 | + <field name="type_tax_use">purchase</field> |
2464 | + </record> |
2465 | + <record id="btw_E_overig_2" model="account.tax.template"> |
2466 | + <field name="sequence">99</field> |
2467 | + <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2468 | + <field name="name">Inkopen import buiten EU overig(2)</field> |
2469 | + <field eval="1.00" name="amount"/> |
2470 | + <field name="type">percent</field> |
2471 | + <field name="parent_id" ref="btw_E_overig"/> |
2472 | + <field name="account_collected_id" ref="vat_refund_high"/> |
2473 | + <field name="account_paid_id" ref="vat_refund_high"/> |
2474 | + <field eval="btw_code_5b" name="tax_code_id"/> |
2475 | + <field eval="btw_code_5b" name="ref_tax_code_id"/> |
2476 | + <field name="ref_base_sign" eval="-1"/> |
2477 | + <field name="ref_tax_sign" eval="-1"/> |
2478 | + <field name="type_tax_use">purchase</field> |
2479 | + </record> |
2480 | <!-- BTW Verkoop --> |
2481 | <record id="btw_X1" model="account.tax.template"> |
2482 | + <field name="sequence">20</field> |
2483 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2484 | <field name="name">Verkopen export buiten EU</field> |
2485 | - <field name="description">BTW export buiten EU</field> |
2486 | + <field name="description">BTW export buiten EU</field> |
2487 | <field eval="0.00" name="amount"/> |
2488 | <field name="type">percent</field> |
2489 | <field name="account_collected_id" ref="vat_payable0"/> |
2490 | - <field name="account_paid_id" ref="vat_refund0"/> |
2491 | + <field name="account_paid_id" ref="vat_payable0"/> |
2492 | <field name="base_code_id" ref="omz_code_3a"/> |
2493 | <field name="ref_base_code_id" ref="omz_code_3a"/> |
2494 | + <field name="ref_base_sign" eval="-1"/> |
2495 | + <field name="ref_tax_sign" eval="-1"/> |
2496 | <field name="type_tax_use">sale</field> |
2497 | </record> |
2498 | </data> |
2499 | |
2500 | === added file 'l10n_nl/account_fiscal_position_account_template.xml' |
2501 | --- l10n_nl/account_fiscal_position_account_template.xml 1970-01-01 00:00:00 +0000 |
2502 | +++ l10n_nl/account_fiscal_position_account_template.xml 2014-04-22 12:10:57 +0000 |
2503 | @@ -0,0 +1,245 @@ |
2504 | +<?xml version="1.0" encoding="utf-8"?> |
2505 | +<openerp> |
2506 | + <data> |
2507 | + <!-- Fiscal Position Account Templates --> |
2508 | + |
2509 | + <!-- Position 2 - NON-EU Countries --> |
2510 | + <!-- inkopen laag --> |
2511 | + <record |
2512 | + id="position_account_non_eu_purchase_low" |
2513 | + model="account.fiscal.position.account.template"> |
2514 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2515 | + <field name="account_src_id" ref="l10n_nl.a_7001" /> |
2516 | + <field name="account_dest_id" ref="l10n_nl.a_7017" /> |
2517 | + </record> |
2518 | + <!-- inkopen hoog. NB: id not according to convention! --> |
2519 | + <record |
2520 | + id="position_account_non_eu_purchase_high" |
2521 | + model="account.fiscal.position.account.template"> |
2522 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2523 | + <field name="account_src_id" ref="l10n_nl.a_expense" /> |
2524 | + <field name="account_dest_id" ref="l10n_nl.a_7018" /> |
2525 | + </record> |
2526 | + <!-- inkopen overig --> |
2527 | + <record |
2528 | + id="position_account_non_eu_purchase_other" |
2529 | + model="account.fiscal.position.account.template"> |
2530 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2531 | + <field name="account_src_id" ref="l10n_nl.a_7003" /> |
2532 | + <field name="account_dest_id" ref="l10n_nl.a_7019" /> |
2533 | + </record> |
2534 | + <!-- verkopen fabricage --> |
2535 | + <!-- verkopen laag --> |
2536 | + <record |
2537 | + id="position_account_non_eu_production_sales_low" |
2538 | + model="account.fiscal.position.account.template"> |
2539 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2540 | + <field name="account_src_id" ref="l10n_nl.a_8001" /> |
2541 | + <field name="account_dest_id" ref="l10n_nl.a_8020" /> |
2542 | + </record> |
2543 | + <!-- verkopen hoog --> |
2544 | + <record |
2545 | + id="position_account_non_eu_production_sales_high" |
2546 | + model="account.fiscal.position.account.template"> |
2547 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2548 | + <field name="account_src_id" ref="l10n_nl.a_8002" /> |
2549 | + <field name="account_dest_id" ref="l10n_nl.a_8020" /> |
2550 | + </record> |
2551 | + <!-- verkopen overig --> |
2552 | + <record |
2553 | + id="position_account_non_eu_sales_production_other" |
2554 | + model="account.fiscal.position.account.template"> |
2555 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2556 | + <field name="account_src_id" ref="l10n_nl.a_8003" /> |
2557 | + <field name="account_dest_id" ref="l10n_nl.a_8020" /> |
2558 | + </record> |
2559 | + <!-- verkopen handel --> |
2560 | + <!-- verkopen laag --> |
2561 | + <record |
2562 | + id="position_account_non_eu_sales_trade_low" |
2563 | + model="account.fiscal.position.account.template"> |
2564 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2565 | + <field name="account_src_id" ref="l10n_nl.a_8011" /> |
2566 | + <field name="account_dest_id" ref="l10n_nl.a_8021" /> |
2567 | + </record> |
2568 | + <!-- verkopen hoog --> |
2569 | + <record |
2570 | + id="position_account_non_eu_sales_trade_high" |
2571 | + model="account.fiscal.position.account.template"> |
2572 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2573 | + <field name="account_src_id" ref="l10n_nl.a_sale" /> |
2574 | + <field name="account_dest_id" ref="l10n_nl.a_8021" /> |
2575 | + </record> |
2576 | + <!-- verkopen overig --> |
2577 | + <record |
2578 | + id="position_account_non_eu_sales_trade_other" |
2579 | + model="account.fiscal.position.account.template"> |
2580 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2581 | + <field name="account_src_id" ref="l10n_nl.a_8013" /> |
2582 | + <field name="account_dest_id" ref="l10n_nl.a_8021" /> |
2583 | + </record> |
2584 | + <!-- verkopen diensten fabricage --> |
2585 | + <!-- verkopen laag --> |
2586 | + <record |
2587 | + id="position_account_non_eu_sales_service_production_low" |
2588 | + model="account.fiscal.position.account.template"> |
2589 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2590 | + <field name="account_src_id" ref="l10n_nl.a_8041" /> |
2591 | + <field name="account_dest_id" ref="l10n_nl.a_8060" /> |
2592 | + </record> |
2593 | + <!-- verkopen hoog --> |
2594 | + <record |
2595 | + id="position_account_non_eu_sales_service_production_high" |
2596 | + model="account.fiscal.position.account.template"> |
2597 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2598 | + <field name="account_src_id" ref="l10n_nl.a_8042" /> |
2599 | + <field name="account_dest_id" ref="l10n_nl.a_8060" /> |
2600 | + </record> |
2601 | + <!-- verkopen overig --> |
2602 | + <record |
2603 | + id="position_account_non_eu_sales_service_production_other" |
2604 | + model="account.fiscal.position.account.template"> |
2605 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2606 | + <field name="account_src_id" ref="l10n_nl.a_8043" /> |
2607 | + <field name="account_dest_id" ref="l10n_nl.a_8060" /> |
2608 | + </record> |
2609 | + <!-- verkopen diensten handel --> |
2610 | + <!-- verkopen laag --> |
2611 | + <record |
2612 | + id="position_account_non_eu_sales_service_trade_low" |
2613 | + model="account.fiscal.position.account.template"> |
2614 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2615 | + <field name="account_src_id" ref="l10n_nl.a_8051" /> |
2616 | + <field name="account_dest_id" ref="l10n_nl.a_8061" /> |
2617 | + </record> |
2618 | + <!-- verkopen hoog --> |
2619 | + <record |
2620 | + id="position_account_non_eu_sales_service_trade_high" |
2621 | + model="account.fiscal.position.account.template"> |
2622 | + <field name="position_id" ref="fiscal_position_template_non_eu" /> |
2623 | + <field name="account_src_id" ref="l10n_nl.a_8052" /> |
2624 | + <field name="account_dest_id" ref="l10n_nl.a_8061" /> |
2625 | + </record> |
2626 | + <!-- verkopen overig: is er niet?? --> |
2627 | + |
2628 | + <!-- Position 3 - EU Countries --> |
2629 | + <!-- inkopen laag --> |
2630 | + <record |
2631 | + id="position_account_eu_purchase_low" |
2632 | + model="account.fiscal.position.account.template"> |
2633 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2634 | + <field name="account_src_id" ref="l10n_nl.a_7001" /> |
2635 | + <field name="account_dest_id" ref="l10n_nl.a_7014" /> |
2636 | + </record> |
2637 | + <!-- inkopen hoog --> |
2638 | + <record |
2639 | + id="position_account_eu_purchase_high" |
2640 | + model="account.fiscal.position.account.template"> |
2641 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2642 | + <field name="account_src_id" ref="l10n_nl.a_expense" /> |
2643 | + <field name="account_dest_id" ref="l10n_nl.a_7015" /> |
2644 | + </record> |
2645 | + <!-- inkopen overig --> |
2646 | + <record |
2647 | + id="position_account_eu_purchase_other" |
2648 | + model="account.fiscal.position.account.template"> |
2649 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2650 | + <field name="account_src_id" ref="l10n_nl.a_7003" /> |
2651 | + <field name="account_dest_id" ref="l10n_nl.a_7016" /> |
2652 | + </record> |
2653 | + <!-- verkopen fabricage --> |
2654 | + <!-- verkopen laag --> |
2655 | + <record |
2656 | + id="position_account_eu_sales_production_low" |
2657 | + model="account.fiscal.position.account.template"> |
2658 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2659 | + <field name="account_src_id" ref="l10n_nl.a_8001" /> |
2660 | + <field name="account_dest_id" ref="l10n_nl.a_8000" /> |
2661 | + </record> |
2662 | + <!-- verkopen hoog --> |
2663 | + <record |
2664 | + id="position_account_eu_sales_production_high" |
2665 | + model="account.fiscal.position.account.template"> |
2666 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2667 | + <field name="account_src_id" ref="l10n_nl.a_8002" /> |
2668 | + <field name="account_dest_id" ref="l10n_nl.a_8000" /> |
2669 | + </record> |
2670 | + <!-- verkopen overig --> |
2671 | + <record |
2672 | + id="position_account_eu_sales_production_other" |
2673 | + model="account.fiscal.position.account.template"> |
2674 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2675 | + <field name="account_src_id" ref="l10n_nl.a_8003" /> |
2676 | + <field name="account_dest_id" ref="l10n_nl.a_8000" /> |
2677 | + </record> |
2678 | + <!-- verkopen handel --> |
2679 | + <!-- verkopen laag --> |
2680 | + <record |
2681 | + id="position_account_eu_sales_trade_low" |
2682 | + model="account.fiscal.position.account.template"> |
2683 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2684 | + <field name="account_src_id" ref="l10n_nl.a_8011" /> |
2685 | + <field name="account_dest_id" ref="l10n_nl.a_8010" /> |
2686 | + </record> |
2687 | + <!-- verkopen hoog --> |
2688 | + <record |
2689 | + id="position_account_eu_sales_trade_high" |
2690 | + model="account.fiscal.position.account.template"> |
2691 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2692 | + <field name="account_src_id" ref="l10n_nl.a_sale" /> |
2693 | + <field name="account_dest_id" ref="l10n_nl.a_8010" /> |
2694 | + </record> |
2695 | + <!-- verkopen overig --> |
2696 | + <record |
2697 | + id="position_account_eu_sales_trade_other" |
2698 | + model="account.fiscal.position.account.template"> |
2699 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2700 | + <field name="account_src_id" ref="l10n_nl.a_8013" /> |
2701 | + <field name="account_dest_id" ref="l10n_nl.a_8010" /> |
2702 | + </record> |
2703 | + <!-- verkopen diensten fabricage --> |
2704 | + <!-- verkopen laag --> |
2705 | + <record |
2706 | + id="position_account_eu_sales_service_production_low" |
2707 | + model="account.fiscal.position.account.template"> |
2708 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2709 | + <field name="account_src_id" ref="l10n_nl.a_8041" /> |
2710 | + <field name="account_dest_id" ref="l10n_nl.a_8040" /> |
2711 | + </record> |
2712 | + <!-- verkopen hoog --> |
2713 | + <record |
2714 | + id="position_account_eu_sales_service_production_high" |
2715 | + model="account.fiscal.position.account.template"> |
2716 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2717 | + <field name="account_src_id" ref="l10n_nl.a_8042" /> |
2718 | + <field name="account_dest_id" ref="l10n_nl.a_8040" /> |
2719 | + </record> |
2720 | + <!-- verkopen overig --> |
2721 | + <record |
2722 | + id="position_account_eu_sales_service_production_other" |
2723 | + model="account.fiscal.position.account.template"> |
2724 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2725 | + <field name="account_src_id" ref="l10n_nl.a_8043" /> |
2726 | + <field name="account_dest_id" ref="l10n_nl.a_8040" /> |
2727 | + </record> |
2728 | + <!-- verkopen diensten handel --> |
2729 | + <!-- verkopen laag --> |
2730 | + <record |
2731 | + id="position_account_eu_sales_service_trade_low" |
2732 | + model="account.fiscal.position.account.template"> |
2733 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2734 | + <field name="account_src_id" ref="l10n_nl.a_8051" /> |
2735 | + <field name="account_dest_id" ref="l10n_nl.a_8050" /> |
2736 | + </record> |
2737 | + <!-- verkopen hoog --> |
2738 | + <record |
2739 | + id="position_account_eu_sales_service_trade_high" |
2740 | + model="account.fiscal.position.account.template"> |
2741 | + <field name="position_id" ref="fiscal_position_template_eu" /> |
2742 | + <field name="account_src_id" ref="l10n_nl.a_8052" /> |
2743 | + <field name="account_dest_id" ref="l10n_nl.a_8050" /> |
2744 | + </record> |
2745 | + <!-- verkopen overig: is er niet?? --> |
2746 | + |
2747 | + </data> |
2748 | +</openerp> |
2749 | \ No newline at end of file |
2750 | |
2751 | === added file 'l10n_nl/account_fiscal_position_tax_template.xml' |
2752 | --- l10n_nl/account_fiscal_position_tax_template.xml 1970-01-01 00:00:00 +0000 |
2753 | +++ l10n_nl/account_fiscal_position_tax_template.xml 2014-04-22 12:10:57 +0000 |
2754 | @@ -0,0 +1,97 @@ |
2755 | +<?xml version="1.0" encoding="UTF-8"?> |
2756 | +<openerp> |
2757 | + <data> |
2758 | + |
2759 | + <!-- account.fiscal.position.tax.template --> |
2760 | + |
2761 | + <!-- Position 2 - NON-EU Countries --> |
2762 | + <!-- All sales tax will become 0 --> |
2763 | + <record id="position_tax_extracom_1" model="account.fiscal.position.tax.template"> |
2764 | + <field name="position_id" ref="fiscal_position_template_non_eu"/> |
2765 | + <field name="tax_src_id" ref="l10n_nl.btw_0"/> |
2766 | + <field name="tax_dest_id" ref="l10n_nl.btw_X1"/> |
2767 | + </record> |
2768 | + <record id="position_tax_extracom_2" model="account.fiscal.position.tax.template"> |
2769 | + <field name="position_id" ref="fiscal_position_template_non_eu"/> |
2770 | + <field name="tax_src_id" ref="l10n_nl.btw_6"/> |
2771 | + <field name="tax_dest_id" ref="l10n_nl.btw_X1"/> |
2772 | + </record> |
2773 | + <record id="position_tax_extracom_3" model="account.fiscal.position.tax.template"> |
2774 | + <field name="position_id" ref="fiscal_position_template_non_eu"/> |
2775 | + <field name="tax_src_id" ref="l10n_nl.btw_21"/> |
2776 | + <field name="tax_dest_id" ref="l10n_nl.btw_X1"/> |
2777 | + </record> |
2778 | + <record id="position_tax_extracom_4" model="account.fiscal.position.tax.template"> |
2779 | + <field name="position_id" ref="fiscal_position_template_non_eu"/> |
2780 | + <field name="tax_src_id" ref="l10n_nl.btw_overig"/> |
2781 | + <field name="tax_dest_id" ref="l10n_nl.btw_X1"/> |
2782 | + </record> |
2783 | + |
2784 | + <!-- VAT on buying from outside the EU --> |
2785 | + <!-- VAT low --> |
2786 | + <record id="position_tax_extracom_5" model="account.fiscal.position.tax.template"> |
2787 | + <field name="position_id" ref="fiscal_position_template_non_eu"/> |
2788 | + <field name="tax_src_id" ref="l10n_nl.btw_6_buy"/> |
2789 | + <field name="tax_dest_id" ref="l10n_nl.btw_E1"/> |
2790 | + </record> |
2791 | + <!-- VAT high --> |
2792 | + <record id="position_tax_extracom_6" model="account.fiscal.position.tax.template"> |
2793 | + <field name="position_id" ref="fiscal_position_template_non_eu"/> |
2794 | + <field name="tax_src_id" ref="l10n_nl.btw_21_buy"/> |
2795 | + <field name="tax_dest_id" ref="l10n_nl.btw_E2"/> |
2796 | + </record> |
2797 | + <!-- VAT other --> |
2798 | + <record id="position_tax_extracom_7" model="account.fiscal.position.tax.template"> |
2799 | + <field name="position_id" ref="fiscal_position_template_non_eu"/> |
2800 | + <field name="tax_src_id" ref="l10n_nl.btw_overig_buy"/> |
2801 | + <field name="tax_dest_id" ref="l10n_nl.btw_E_overig"/> |
2802 | + </record> |
2803 | + <!-- Belgian schema has many more lines here.... --> |
2804 | + |
2805 | + <!-- Position 3 - EU Countries --> |
2806 | + <record id="position_tax_intracom_1" model="account.fiscal.position.tax.template"> |
2807 | + <field name="position_id" ref="fiscal_position_template_eu"/> |
2808 | + <field name="tax_src_id" ref="l10n_nl.btw_0"/> |
2809 | + <field name="tax_dest_id" ref="l10n_nl.btw_X0"/> |
2810 | + </record> |
2811 | + <record id="position_tax_intracom_2" model="account.fiscal.position.tax.template"> |
2812 | + <field name="position_id" ref="fiscal_position_template_eu"/> |
2813 | + <field name="tax_src_id" ref="l10n_nl.btw_6"/> |
2814 | + <field name="tax_dest_id" ref="l10n_nl.btw_X0"/> |
2815 | + </record> |
2816 | + <record id="position_tax_intracom_3" model="account.fiscal.position.tax.template"> |
2817 | + <field name="position_id" ref="fiscal_position_template_eu"/> |
2818 | + <field name="tax_src_id" ref="l10n_nl.btw_21"/> |
2819 | + <field name="tax_dest_id" ref="l10n_nl.btw_X0"/> |
2820 | + </record> |
2821 | + <record id="position_tax_intracom_4" model="account.fiscal.position.tax.template"> |
2822 | + <field name="position_id" ref="fiscal_position_template_eu"/> |
2823 | + <field name="tax_src_id" ref="l10n_nl.btw_overig"/> |
2824 | + <field name="tax_dest_id" ref="l10n_nl.btw_X0"/> |
2825 | + </record> |
2826 | + |
2827 | + <!-- In source-tax we lack the separation of goods and services, |
2828 | + therefore no lines now for "Installatie/Afstandsverkopen. --> |
2829 | + |
2830 | + <!-- Buying from other EU countries (only goods = VAT 0 --> |
2831 | + <record id="position_tax_intracom_5" model="account.fiscal.position.tax.template"> |
2832 | + <field name="position_id" ref="fiscal_position_template_eu"/> |
2833 | + <field name="tax_src_id" ref="l10n_nl.btw_6_buy"/> |
2834 | + <field name="tax_dest_id" ref="l10n_nl.btw_I_6"/> |
2835 | + </record> |
2836 | + <record id="position_tax_intracom_6" model="account.fiscal.position.tax.template"> |
2837 | + <field name="position_id" ref="fiscal_position_template_eu"/> |
2838 | + <field name="tax_src_id" ref="l10n_nl.btw_21_buy"/> |
2839 | + <field name="tax_dest_id" ref="l10n_nl.btw_I_21"/> |
2840 | + </record> |
2841 | + <record id="position_tax_intracom_7" model="account.fiscal.position.tax.template"> |
2842 | + <field name="position_id" ref="fiscal_position_template_eu"/> |
2843 | + <field name="tax_src_id" ref="l10n_nl.btw_overig_buy"/> |
2844 | + <field name="tax_dest_id" ref="l10n_nl.btw_I_overig"/> |
2845 | + </record> |
2846 | + |
2847 | + <!-- Again, Belgian schema has 17 (!) more records. Missing VAT 0 |
2848 | + and separation of goods and services .. --> |
2849 | + |
2850 | + </data> |
2851 | +</openerp> |
2852 | |
2853 | === added file 'l10n_nl/account_fiscal_position_template.xml' |
2854 | --- l10n_nl/account_fiscal_position_template.xml 1970-01-01 00:00:00 +0000 |
2855 | +++ l10n_nl/account_fiscal_position_template.xml 2014-04-22 12:10:57 +0000 |
2856 | @@ -0,0 +1,33 @@ |
2857 | +<?xml version="1.0" encoding="utf-8"?> |
2858 | +<openerp> |
2859 | + <data> |
2860 | + <!-- Fiscal Position Templates --> |
2861 | + |
2862 | + <!-- for the moment no use for this |
2863 | + <record |
2864 | + id="fiscal_position_template_domestic" |
2865 | + model="account.fiscal.position.template"> |
2866 | + <field name="name">Binnenland</field> |
2867 | + <field |
2868 | + name="chart_template_id" |
2869 | + ref="l10nnl_chart_template" /> |
2870 | + </record> |
2871 | + --> |
2872 | + <record |
2873 | + id="fiscal_position_template_eu" |
2874 | + model="account.fiscal.position.template"> |
2875 | + <field name="name">EU landen</field> |
2876 | + <field |
2877 | + name="chart_template_id" |
2878 | + ref="l10nnl_chart_template" /> |
2879 | + </record> |
2880 | + <record |
2881 | + id="fiscal_position_template_non_eu" |
2882 | + model="account.fiscal.position.template"> |
2883 | + <field name="name">Niet-EU landen</field> |
2884 | + <field |
2885 | + name="chart_template_id" |
2886 | + ref="l10nnl_chart_template" /> |
2887 | + </record> |
2888 | + </data> |
2889 | +</openerp> |
2890 | |
2891 | === modified file 'mail/mail_message.py' |
2892 | --- mail/mail_message.py 2012-09-24 14:02:33 +0000 |
2893 | +++ mail/mail_message.py 2014-04-22 12:10:57 +0000 |
2894 | @@ -26,10 +26,10 @@ |
2895 | import email |
2896 | import logging |
2897 | import pytz |
2898 | -import re |
2899 | import time |
2900 | from email.header import decode_header |
2901 | from email.message import Message |
2902 | +from email.utils import getaddresses |
2903 | |
2904 | import tools |
2905 | from osv import osv |
2906 | @@ -60,9 +60,15 @@ |
2907 | return ''.join([tools.ustr(x[0], x[1]) for x in text]) |
2908 | |
2909 | def to_email(text): |
2910 | - """Return a list of the email addresses found in ``text``""" |
2911 | + """Returns a list of the email addresses found in ``text`` |
2912 | + """ |
2913 | if not text: return [] |
2914 | - return re.findall(r'([^ ,<@]+@[^> ,]+)', text) |
2915 | + |
2916 | + people = getaddresses([text]) |
2917 | + addresses = [person[1] for person in people] |
2918 | + |
2919 | + return addresses |
2920 | + |
2921 | |
2922 | class mail_message_common(osv.osv_memory): |
2923 | """Common abstract class for holding the main attributes of a |
2924 | @@ -534,7 +540,14 @@ |
2925 | mail_server_id=message.mail_server_id.id, |
2926 | context=context) |
2927 | if res: |
2928 | - message.write({'state':'sent', 'message_id': res}) |
2929 | + message.write( |
2930 | + { |
2931 | + 'state':'sent', |
2932 | + 'message_id': res, |
2933 | + 'user_id': message.user_id.id or uid, |
2934 | + 'date': message.date |
2935 | + or datetime.datetime.now(), |
2936 | + }) |
2937 | message_sent = True |
2938 | else: |
2939 | message.write({'state':'exception'}) |
2940 | |
2941 | === modified file 'mail/mail_thread.py' |
2942 | --- mail/mail_thread.py 2012-08-10 11:48:38 +0000 |
2943 | +++ mail/mail_thread.py 2014-04-22 12:10:57 +0000 |
2944 | @@ -358,7 +358,7 @@ |
2945 | match = tools.reference_re.search(references) |
2946 | if match: res_id = match.group(1) |
2947 | if not res_id: |
2948 | - match = tools.res_re.search(msg['subject']) |
2949 | + match = tools.res_re.search(msg.get('subject') or '') |
2950 | if match: res_id = match.group(1) |
2951 | if res_id: |
2952 | res_id = int(res_id) |
2953 | |
2954 | === modified file 'mrp/mrp.py' |
2955 | --- mrp/mrp.py 2012-10-05 10:44:47 +0000 |
2956 | +++ mrp/mrp.py 2014-04-22 12:10:57 +0000 |
2957 | @@ -20,9 +20,10 @@ |
2958 | ############################################################################## |
2959 | |
2960 | from datetime import datetime |
2961 | -from osv import osv, fields |
2962 | +from osv import osv, fields, orm |
2963 | import decimal_precision as dp |
2964 | from tools import float_compare |
2965 | +from tools import DEFAULT_SERVER_DATETIME_FORMAT |
2966 | from tools.translate import _ |
2967 | import netsvc |
2968 | import time |
2969 | @@ -280,8 +281,10 @@ |
2970 | @param properties: List of related properties. |
2971 | @return: False or BoM id. |
2972 | """ |
2973 | - cr.execute('select id from mrp_bom where product_id=%s and bom_id is null order by sequence', (product_id,)) |
2974 | - ids = map(lambda x: x[0], cr.fetchall()) |
2975 | + domain = [('product_id', '=', product_id), ('bom_id', '=', False), |
2976 | + '|', ('date_start', '=', False), ('date_start', '<=', time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)), |
2977 | + '|', ('date_stop', '=', False), ('date_stop', '>=', time.strftime(DEFAULT_SERVER_DATETIME_FORMAT))] |
2978 | + ids = self.search(cr, uid, domain, order='sequence') |
2979 | max_prop = 0 |
2980 | result = False |
2981 | for bom in self.pool.get('mrp.bom').browse(cr, uid, ids): |
2982 | @@ -434,6 +437,22 @@ |
2983 | for prod in self.browse(cr, uid, ids, context=context): |
2984 | result[prod.id] = prod.date_planned[:10] |
2985 | return result |
2986 | + |
2987 | + def _src_id_default(self, cr, uid, ids, context=None): |
2988 | + try: |
2989 | + location_model, location_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_stock') |
2990 | + self.pool.get('stock.location').check_access_rule(cr, uid, [location_id], 'read', context=context) |
2991 | + except (orm.except_orm, ValueError): |
2992 | + location_id = False |
2993 | + return location_id |
2994 | + |
2995 | + def _dest_id_default(self, cr, uid, ids, context=None): |
2996 | + try: |
2997 | + location_model, location_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_stock') |
2998 | + self.pool.get('stock.location').check_access_rule(cr, uid, [location_id], 'read', context=context) |
2999 | + except (orm.except_orm, ValueError): |
3000 | + location_id = False |
3001 | + return location_id |
3002 | |
3003 | _columns = { |
3004 | 'name': fields.char('Reference', size=64, required=True), |
3005 | @@ -481,6 +500,8 @@ |
3006 | 'state': lambda *a: 'draft', |
3007 | 'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), |
3008 | 'product_qty': lambda *a: 1.0, |
3009 | + 'location_src_id': _src_id_default, |
3010 | + 'location_dest_id': _dest_id_default, |
3011 | 'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'mrp.production') or '/', |
3012 | 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c), |
3013 | } |
3014 | |
3015 | === modified file 'mrp/security/mrp_security.xml' |
3016 | --- mrp/security/mrp_security.xml 2011-12-19 16:54:40 +0000 |
3017 | +++ mrp/security/mrp_security.xml 2014-04-22 12:10:57 +0000 |
3018 | @@ -36,7 +36,7 @@ |
3019 | <field name="name">mrp_bom multi-company</field> |
3020 | <field name="model_id" search="[('model','=','mrp.bom')]" model="ir.model"/> |
3021 | <field name="global" eval="True"/> |
3022 | - <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field> |
3023 | + <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> |
3024 | </record> |
3025 | |
3026 | <record model="ir.rule" id="mrp_routing_rule"> |
3027 | |
3028 | === modified file 'mrp_repair/mrp_repair.py' |
3029 | --- mrp_repair/mrp_repair.py 2012-01-31 13:36:57 +0000 |
3030 | +++ mrp_repair/mrp_repair.py 2014-04-22 12:10:57 +0000 |
3031 | @@ -349,7 +349,8 @@ |
3032 | return True |
3033 | |
3034 | def wkf_invoice_create(self, cr, uid, ids, *args): |
3035 | - return self.action_invoice_create(cr, uid, ids) |
3036 | + self.action_invoice_create(cr, uid, ids) |
3037 | + return True |
3038 | |
3039 | def action_invoice_create(self, cr, uid, ids, group=False, context=None): |
3040 | """ Creates invoice(s) for repair order. |
3041 | |
3042 | === modified file 'procurement/procurement.py' |
3043 | --- procurement/procurement.py 2013-02-27 11:25:39 +0000 |
3044 | +++ procurement/procurement.py 2014-04-22 12:10:57 +0000 |
3045 | @@ -81,7 +81,7 @@ |
3046 | """ |
3047 | _name = "procurement.order" |
3048 | _description = "Procurement" |
3049 | - _order = 'priority,date_planned desc' |
3050 | + _order = 'priority desc,date_planned' |
3051 | _log_create = False |
3052 | _columns = { |
3053 | 'name': fields.char('Reason', size=64, required=True, help='Procurement name.'), |
3054 | |
3055 | === modified file 'product/pricelist.py' |
3056 | --- product/pricelist.py 2012-01-31 13:36:57 +0000 |
3057 | +++ product/pricelist.py 2014-04-22 12:10:57 +0000 |
3058 | @@ -199,29 +199,52 @@ |
3059 | categ_ids = _create_parent_category_list(categ_id, [categ_id]) |
3060 | if categ_ids: |
3061 | categ_where = '(categ_id IN (' + ','.join(map(str, categ_ids)) + '))' |
3062 | + categ_where_i = '(i.categ_id IN (' + ','.join(map(str, categ_ids)) + '))' |
3063 | else: |
3064 | categ_where = '(categ_id IS NULL)' |
3065 | + categ_where_i = '(i.categ_id IS NULL)' |
3066 | |
3067 | if partner: |
3068 | partner_where = 'base <> -2 OR %s IN (SELECT name FROM product_supplierinfo WHERE product_id = %s) ' |
3069 | - partner_args = (partner, product_id) |
3070 | + partner_args = (partner, tmpl_id) |
3071 | else: |
3072 | partner_where = 'base <> -2 ' |
3073 | partner_args = () |
3074 | - |
3075 | - cr.execute( |
3076 | - 'SELECT i.*, pl.currency_id ' |
3077 | - 'FROM product_pricelist_item AS i, ' |
3078 | - 'product_pricelist_version AS v, product_pricelist AS pl ' |
3079 | - 'WHERE (product_tmpl_id IS NULL OR product_tmpl_id = %s) ' |
3080 | - 'AND (product_id IS NULL OR product_id = %s) ' |
3081 | - 'AND (' + categ_where + ' OR (categ_id IS NULL)) ' |
3082 | - 'AND (' + partner_where + ') ' |
3083 | - 'AND price_version_id = %s ' |
3084 | - 'AND (min_quantity IS NULL OR min_quantity <= %s) ' |
3085 | - 'AND i.price_version_id = v.id AND v.pricelist_id = pl.id ' |
3086 | - 'ORDER BY sequence', |
3087 | - (tmpl_id, product_id) + partner_args + (pricelist_version_ids[0], qty)) |
3088 | + |
3089 | + query = ( |
3090 | + 'SELECT ' |
3091 | + 'i.*, pl.currency_id , p.* ' |
3092 | + 'FROM ' |
3093 | + 'product_pricelist_item AS i ' |
3094 | + 'JOIN product_pricelist_version AS v ' |
3095 | + 'ON i.price_version_id = v.id ' |
3096 | + 'JOIN product_pricelist AS pl ' |
3097 | + 'ON v.pricelist_id = pl.id ' |
3098 | + 'LEFT OUTER JOIN ( ' |
3099 | + 'WITH RECURSIVE subtree(depth, categ_id, parent_id, name) AS ( ' |
3100 | + 'SELECT 0, id, parent_id, name FROM product_category WHERE parent_id is NULL ' |
3101 | + 'UNION ' |
3102 | + 'SELECT depth+1, m.id, m.parent_id, m.name ' |
3103 | + 'FROM subtree t, product_category m ' |
3104 | + 'WHERE m.parent_id = t.categ_id ' |
3105 | + ') ' |
3106 | + 'SELECT * ' |
3107 | + 'FROM subtree ' |
3108 | + 'WHERE (' + categ_where + ' OR (categ_id IS NULL)) ' |
3109 | + ') AS p ' |
3110 | + 'on i.categ_id = p.categ_id ' |
3111 | + 'WHERE ' |
3112 | + '(product_tmpl_id IS NULL OR product_tmpl_id = %s) ' |
3113 | + 'AND (product_id IS NULL OR product_id = %s) ' |
3114 | + 'AND (' + categ_where_i + ' OR (i.categ_id IS NULL)) ' |
3115 | + 'AND (' + partner_where + ') ' |
3116 | + 'AND price_version_id = %s ' |
3117 | + 'AND (min_quantity IS NULL OR min_quantity <= %s) ' |
3118 | + 'ORDER BY ' |
3119 | + 'sequence, depth desc ' |
3120 | + ) % ((tmpl_id, product_id) + partner_args + (pricelist_version_ids[0], qty)) |
3121 | + |
3122 | + cr.execute(query) |
3123 | res1 = cr.dictfetchall() |
3124 | uom_price_already_computed = False |
3125 | for res in res1: |
3126 | @@ -232,7 +255,7 @@ |
3127 | else: |
3128 | price_tmp = self.price_get(cr, uid, |
3129 | [res['base_pricelist_id']], product_id, |
3130 | - qty, context=context)[res['base_pricelist_id']] |
3131 | + qty, partner=partner, context=context)[res['base_pricelist_id']] |
3132 | ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id |
3133 | uom_price_already_computed = True |
3134 | price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False) |
3135 | @@ -269,10 +292,17 @@ |
3136 | price_type.field, context=context)[product_id], round=False, context=context) |
3137 | |
3138 | if price is not False: |
3139 | + surcharge = res['price_surcharge'] or 0.0 |
3140 | + if 'uom' in context: |
3141 | + product = products_dict[product_id] |
3142 | + uom = product.uos_id or product.uom_id |
3143 | + surcharge = product_uom_obj._compute_price(cr, uid, uom.id, surcharge, context['uom']) |
3144 | + |
3145 | price_limit = price |
3146 | price = price * (1.0+(res['price_discount'] or 0.0)) |
3147 | price = rounding(price, res['price_round']) #TOFIX: rounding with tools.float_rouding |
3148 | - price += (res['price_surcharge'] or 0.0) |
3149 | + price += surcharge |
3150 | + |
3151 | if res['price_min_margin']: |
3152 | price = max(price, price_limit+res['price_min_margin']) |
3153 | if res['price_max_margin']: |
3154 | @@ -304,6 +334,7 @@ |
3155 | res.update({'item_id': {ids[-1]: res_multi.get('item_id', ids[-1])}}) |
3156 | return res |
3157 | |
3158 | + |
3159 | product_pricelist() |
3160 | |
3161 | |
3162 | |
3163 | === modified file 'product/product.py' |
3164 | --- product/product.py 2012-04-03 13:05:28 +0000 |
3165 | +++ product/product.py 2014-04-22 12:10:57 +0000 |
3166 | @@ -611,9 +611,9 @@ |
3167 | # Performing a quick memory merge of ids in Python will give much better performance |
3168 | ids = set() |
3169 | ids.update(self.search(cr, user, args + [('default_code',operator,name)], limit=limit, context=context)) |
3170 | - if len(ids) < limit: |
3171 | + if not limit or len(ids) < limit: |
3172 | # we may underrun the limit because of dupes in the results, that's fine |
3173 | - ids.update(self.search(cr, user, args + [('name',operator,name)], limit=(limit-len(ids)), context=context)) |
3174 | + ids.update(self.search(cr, user, args + [('name',operator,name)], limit=(limit-len(ids) if limit else limit) , context=context)) |
3175 | ids = list(ids) |
3176 | if not ids: |
3177 | ptrn = re.compile('(\[(.*?)\])') |
3178 | |
3179 | === modified file 'product/report/product_label.xsl' |
3180 | --- product/report/product_label.xsl 2011-01-14 00:11:01 +0000 |
3181 | +++ product/report/product_label.xsl 2014-04-22 12:10:57 +0000 |
3182 | @@ -70,7 +70,7 @@ |
3183 | </td> |
3184 | </tr><tr> |
3185 | <td> |
3186 | - <barCode><xsl:value-of select="code"/></barCode> |
3187 | + <barCode><xsl:value-of select="ean13"/></barCode> |
3188 | </td><td> |
3189 | <para style="nospace"><xsl:value-of select="product"/></para><xsl:text>, </xsl:text> |
3190 | <para style="nospace"><xsl:value-of select="variant"/></para> |
3191 | |
3192 | === modified file 'project/project_view.xml' |
3193 | --- project/project_view.xml 2012-03-12 10:20:01 +0000 |
3194 | +++ project/project_view.xml 2014-04-22 12:10:57 +0000 |
3195 | @@ -68,8 +68,8 @@ |
3196 | </field> |
3197 | </page> |
3198 | <page string="Billing" groups="account.group_account_invoice"> |
3199 | - <field colspan="4" name="partner_id" on_change="onchange_partner_id(partner_id)" select="1" string="Customer"/> |
3200 | - <field domain="[('partner_id','=',partner_id)]" name="contact_id" string="Contact Address"/> |
3201 | + <field name="partner_id" on_change="onchange_partner_id(partner_id)" select="1" string="Customer" colspan="4" /> |
3202 | + <field name="contact_id" string="Contact Address" domain="[('partner_id','=',partner_id)]" options='{"quick_create": false}' context="{'default_partner_id':partner_id}" /> |
3203 | <field name="warn_customer"/> |
3204 | <field name="currency_id" select="1" groups="base.group_multi_company" required="1"/> |
3205 | <newline/> |
3206 | |
3207 | === modified file 'project_issue/project_issue_view.xml' |
3208 | --- project_issue/project_issue_view.xml 2012-03-12 11:29:31 +0000 |
3209 | +++ project_issue/project_issue_view.xml 2014-04-22 12:10:57 +0000 |
3210 | @@ -68,7 +68,7 @@ |
3211 | <group col="2" colspan="2"> |
3212 | <separator colspan="2" string="Contact Information"/> |
3213 | <field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/> |
3214 | - <field name="partner_address_id" string="Contact" on_change="onchange_partner_address_id(partner_address_id, email_from)"/> |
3215 | + <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}" /> |
3216 | <field name="email_from"/> |
3217 | </group> |
3218 | <group col="3" colspan="2"> |
3219 | |
3220 | === modified file 'project_mrp/project_procurement.py' |
3221 | --- project_mrp/project_procurement.py 2011-12-19 16:54:40 +0000 |
3222 | +++ project_mrp/project_procurement.py 2014-04-22 12:10:57 +0000 |
3223 | @@ -20,6 +20,7 @@ |
3224 | ############################################################################## |
3225 | |
3226 | from osv import fields, osv |
3227 | +from openerp.tools.translate import _ |
3228 | |
3229 | class procurement_order(osv.osv): |
3230 | _name = "procurement.order" |
3231 | @@ -37,8 +38,10 @@ |
3232 | """ Checks if task is done or not. |
3233 | @return: True or False. |
3234 | """ |
3235 | - return all(proc.product_id.type != 'service' or (proc.task_id and proc.task_id.state in ('done', 'cancelled')) \ |
3236 | - for proc in self.browse(cr, uid, ids, context=context)) |
3237 | + for p in self.browse(cr, uid, ids, context=context): |
3238 | + 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')): |
3239 | + return False |
3240 | + return True |
3241 | |
3242 | def check_produce_service(self, cr, uid, procurement, context=None): |
3243 | return True |
3244 | @@ -79,8 +82,9 @@ |
3245 | 'description': procurement.note, |
3246 | 'project_id': project and project.id or False, |
3247 | 'company_id': procurement.company_id.id, |
3248 | + 'partner_id': procurement.sale_line_id and procurement.sale_line_id.order_id.partner_id.id, |
3249 | },context=context) |
3250 | - self.write(cr, uid, [procurement.id], {'task_id': task_id, 'state': 'running'}, context=context) |
3251 | + self.write(cr, uid, [procurement.id], {'task_id': task_id, 'state': 'running', 'message':_('Task created.')}, context=context) |
3252 | return task_id |
3253 | |
3254 | procurement_order() |
3255 | |
3256 | === modified file 'project_timesheet/project_timesheet.py' |
3257 | --- project_timesheet/project_timesheet.py 2012-01-31 13:36:57 +0000 |
3258 | +++ project_timesheet/project_timesheet.py 2014-04-22 12:10:57 +0000 |
3259 | @@ -142,10 +142,6 @@ |
3260 | vals_line['name'] = '%s: %s' % (tools.ustr(task.task_id.name), tools.ustr(vals['name']) or '/') |
3261 | if 'user_id' in vals: |
3262 | vals_line['user_id'] = vals['user_id'] |
3263 | - result = self.get_user_related_details(cr, uid, vals['user_id']) |
3264 | - for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'): |
3265 | - if result.get(fld, False): |
3266 | - vals_line[fld] = result[fld] |
3267 | |
3268 | if 'date' in vals: |
3269 | vals_line['date'] = vals['date'][:10] |
3270 | @@ -153,6 +149,10 @@ |
3271 | default_uom = self.pool.get('res.users').browse(cr, uid, uid).company_id.project_time_mode_id.id |
3272 | vals_line['unit_amount'] = vals['hours'] |
3273 | prod_id = vals_line.get('product_id', line_id.product_id.id) # False may be set |
3274 | + result = self.get_user_related_details(cr, uid, vals.get('user_id', task.user_id.id)) |
3275 | + for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'): |
3276 | + if result.get(fld, False): |
3277 | + vals_line[fld] = result[fld] |
3278 | |
3279 | if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom): |
3280 | vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id']) |
3281 | @@ -165,7 +165,9 @@ |
3282 | if amount_unit and 'amount' in amount_unit.get('value',{}): |
3283 | vals_line['amount'] = amount_unit['value']['amount'] |
3284 | |
3285 | - self.pool.get('hr.analytic.timesheet').write(cr, uid, [line_id.id], vals_line, context=context) |
3286 | + #workaround for lp:1023047 |
3287 | + if vals_line: |
3288 | + self.pool.get('hr.analytic.timesheet').write(cr, uid, [line_id.id], vals_line, context=context) |
3289 | |
3290 | return super(project_work,self).write(cr, uid, ids, vals, context) |
3291 | |
3292 | |
3293 | === modified file 'purchase/purchase.py' (properties changed: -x to +x) |
3294 | --- purchase/purchase.py 2012-10-09 12:16:14 +0000 |
3295 | +++ purchase/purchase.py 2014-04-22 12:10:57 +0000 |
3296 | @@ -294,6 +294,20 @@ |
3297 | self.write(cr, uid, [id], {'state' : 'confirmed', 'validator' : uid}) |
3298 | return True |
3299 | |
3300 | + def _choose_account_from_po_line(self, cr, uid, po_line, context=None): |
3301 | + fiscal_obj = self.pool.get('account.fiscal.position') |
3302 | + property_obj = self.pool.get('ir.property') |
3303 | + if po_line.product_id: |
3304 | + acc_id = po_line.product_id.property_account_expense.id |
3305 | + if not acc_id: |
3306 | + acc_id = po_line.product_id.categ_id.property_account_expense_categ.id |
3307 | + if not acc_id: |
3308 | + raise osv.except_osv(_('Error!'), _('Define expense account for this company: "%s" (id:%d).') % (po_line.product_id.name, po_line.product_id.id,)) |
3309 | + else: |
3310 | + acc_id = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category').id |
3311 | + fpos = po_line.order_id.fiscal_position or False |
3312 | + return fiscal_obj.map_account(cr, uid, fpos, acc_id) |
3313 | + |
3314 | def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None): |
3315 | """Collects require data from purchase order line that is used to create invoice line |
3316 | for that purchase order line |
3317 | @@ -338,8 +352,6 @@ |
3318 | journal_obj = self.pool.get('account.journal') |
3319 | inv_obj = self.pool.get('account.invoice') |
3320 | inv_line_obj = self.pool.get('account.invoice.line') |
3321 | - fiscal_obj = self.pool.get('account.fiscal.position') |
3322 | - property_obj = self.pool.get('ir.property') |
3323 | |
3324 | for order in self.browse(cr, uid, ids, context=context): |
3325 | pay_acc_id = order.partner_id.property_account_payable.id |
3326 | @@ -351,16 +363,7 @@ |
3327 | # generate invoice line correspond to PO line and link that to created invoice (inv_id) and PO line |
3328 | inv_lines = [] |
3329 | for po_line in order.order_line: |
3330 | - if po_line.product_id: |
3331 | - acc_id = po_line.product_id.product_tmpl_id.property_account_expense.id |
3332 | - if not acc_id: |
3333 | - acc_id = po_line.product_id.categ_id.property_account_expense_categ.id |
3334 | - if not acc_id: |
3335 | - 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,)) |
3336 | - else: |
3337 | - acc_id = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category').id |
3338 | - fpos = order.fiscal_position or False |
3339 | - acc_id = fiscal_obj.map_account(cr, uid, fpos, acc_id) |
3340 | + acc_id = self._choose_account_from_po_line(cr, uid, po_line, context=context) |
3341 | |
3342 | inv_line_data = self._prepare_inv_line(cr, uid, acc_id, po_line, context=context) |
3343 | inv_line_id = inv_line_obj.create(cr, uid, inv_line_data, context=context) |
3344 | @@ -539,7 +542,6 @@ |
3345 | @param context: A standard dictionary |
3346 | |
3347 | @return: new purchase order id |
3348 | - |
3349 | """ |
3350 | #TOFIX: merged order line should be unlink |
3351 | wf_service = netsvc.LocalService("workflow") |
3352 | @@ -590,7 +592,8 @@ |
3353 | if porder.notes: |
3354 | order_infos['notes'] = (order_infos['notes'] or '') + ('\n%s' % (porder.notes,)) |
3355 | if porder.origin: |
3356 | - order_infos['origin'] = (order_infos['origin'] or '') + ' ' + porder.origin |
3357 | + if not porder.origin in order_infos['origin'] and not order_infos['origin'] in porder.origin: |
3358 | + order_infos['origin'] = (order_infos['origin'] or '') + ' ' + porder.origin |
3359 | |
3360 | for order_line in porder.order_line: |
3361 | line_key = make_key(order_line, ('name', 'date_planned', 'taxes_id', 'price_unit', 'notes', 'product_id', 'move_dest_id', 'account_analytic_id')) |
3362 | @@ -781,7 +784,7 @@ |
3363 | |
3364 | qty = qty or 1.0 |
3365 | supplierinfo = False |
3366 | - supplierinfo_ids = product_supplierinfo.search(cr, uid, [('name','=',partner_id),('product_id','=',product.id)]) |
3367 | + supplierinfo_ids = product_supplierinfo.search(cr, uid, [('name', '=', partner_id),('product_id', '=', product.product_tmpl_id.id)]) |
3368 | if supplierinfo_ids: |
3369 | supplierinfo = product_supplierinfo.browse(cr, uid, supplierinfo_ids[0], context=context) |
3370 | if supplierinfo.product_uom.id != uom_id: |
3371 | @@ -799,8 +802,12 @@ |
3372 | price = product_pricelist.price_get(cr, uid, [pricelist_id], |
3373 | product.id, qty or 1.0, partner_id, {'uom': uom_id, 'date': date_order})[pricelist_id] |
3374 | |
3375 | - taxes = account_tax.browse(cr, uid, map(lambda x: x.id, product.supplier_taxes_id)) |
3376 | fpos = fiscal_position_id and account_fiscal_position.browse(cr, uid, fiscal_position_id, context=context) or False |
3377 | + a = product.product_tmpl_id.property_account_expense.id |
3378 | + if not a: |
3379 | + a = product.categ_id.property_account_expense_categ.id |
3380 | + a = account_fiscal_position.map_account(cr, uid, fpos, a) |
3381 | + taxes = product.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids) |
3382 | taxes_ids = account_fiscal_position.map_tax(cr, uid, fpos, taxes) |
3383 | res['value'].update({'price_unit': price, 'taxes_id': taxes_ids}) |
3384 | |
3385 | |
3386 | === modified file 'purchase/purchase_view.xml' |
3387 | --- purchase/purchase_view.xml 2012-10-23 07:56:26 +0000 |
3388 | +++ purchase/purchase_view.xml 2014-04-22 12:10:57 +0000 |
3389 | @@ -173,7 +173,7 @@ |
3390 | <notebook colspan="4"> |
3391 | <page string="Purchase Order"> |
3392 | <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}'/> |
3393 | - <field name="partner_address_id" options='{"quick_create": false}'/> |
3394 | + <field name="partner_address_id" options='{"quick_create": false}' context="{'default_partner_id':partner_id}"/> |
3395 | <field domain="[('type','=','purchase')]" name="pricelist_id" groups="base.group_extended"/> |
3396 | <field name="origin" groups="base.group_extended"/> |
3397 | <newline/> |
3398 | |
3399 | === modified file 'purchase/wizard/purchase_line_invoice.py' (properties changed: -x to +x) |
3400 | --- purchase/wizard/purchase_line_invoice.py 2011-09-08 09:27:55 +0000 |
3401 | +++ purchase/wizard/purchase_line_invoice.py 2014-04-22 12:10:57 +0000 |
3402 | @@ -48,12 +48,11 @@ |
3403 | if record_ids: |
3404 | res = False |
3405 | invoices = {} |
3406 | - invoice_obj=self.pool.get('account.invoice') |
3407 | - purchase_line_obj=self.pool.get('purchase.order.line') |
3408 | - property_obj=self.pool.get('ir.property') |
3409 | - account_fiscal_obj=self.pool.get('account.fiscal.position') |
3410 | - invoice_line_obj=self.pool.get('account.invoice.line') |
3411 | - account_jrnl_obj=self.pool.get('account.journal') |
3412 | + invoice_obj = self.pool.get('account.invoice') |
3413 | + purchase_obj = self.pool.get('purchase.order') |
3414 | + purchase_line_obj = self.pool.get('purchase.order.line') |
3415 | + invoice_line_obj = self.pool.get('account.invoice.line') |
3416 | + account_jrnl_obj = self.pool.get('account.journal') |
3417 | |
3418 | def multiple_order_invoice_notes(orders): |
3419 | notes = "" |
3420 | @@ -62,7 +61,6 @@ |
3421 | return notes |
3422 | |
3423 | |
3424 | - |
3425 | def make_invoice_by_partner(partner, orders, lines_ids): |
3426 | """ |
3427 | create a new invoice for one supplier |
3428 | @@ -99,37 +97,16 @@ |
3429 | order.write({'invoice_ids': [(4, inv_id)]}) |
3430 | return inv_id |
3431 | |
3432 | - for line in purchase_line_obj.browse(cr,uid,record_ids): |
3433 | - if (not line.invoiced) and (line.state not in ('draft','cancel')): |
3434 | + for line in purchase_line_obj.browse(cr, uid, record_ids, context=context): |
3435 | + if (not line.invoiced) and (line.state not in ('draft', 'cancel')): |
3436 | if not line.partner_id.id in invoices: |
3437 | invoices[line.partner_id.id] = [] |
3438 | - if line.product_id: |
3439 | - a = line.product_id.product_tmpl_id.property_account_expense.id |
3440 | - if not a: |
3441 | - a = line.product_id.categ_id.property_account_expense_categ.id |
3442 | - if not a: |
3443 | - raise osv.except_osv(_('Error !'), |
3444 | - _('There is no expense account defined ' \ |
3445 | - 'for this product: "%s" (id:%d)') % \ |
3446 | - (line.product_id.name, line.product_id.id,)) |
3447 | - else: |
3448 | - a = property_obj.get(cr, uid, |
3449 | - 'property_account_expense_categ', 'product.category', |
3450 | - context=context).id |
3451 | - fpos = line.order_id.fiscal_position or False |
3452 | - a = account_fiscal_obj.map_account(cr, uid, fpos, a) |
3453 | - inv_id = invoice_line_obj.create(cr, uid, { |
3454 | - 'name': line.name, |
3455 | - 'origin': line.order_id.name, |
3456 | - 'account_id': a, |
3457 | - 'price_unit': line.price_unit, |
3458 | - 'quantity': line.product_qty, |
3459 | - 'uos_id': line.product_uom.id, |
3460 | - 'product_id': line.product_id.id or False, |
3461 | - 'invoice_line_tax_id': [(6, 0, [x.id for x in line.taxes_id])], |
3462 | - 'note': line.notes, |
3463 | - 'account_analytic_id': line.account_analytic_id and line.account_analytic_id.id or False, |
3464 | - }) |
3465 | + |
3466 | + acc_id = purchase_obj._choose_account_from_po_line(cr, uid, line, context=context) |
3467 | + inv_line_data = purchase_obj._prepare_inv_line(cr, uid, acc_id, line, context=context) |
3468 | + inv_line_data.update({'origin': line.order_id.name}) |
3469 | + inv_id = invoice_line_obj.create(cr, uid, inv_line_data, context=context) |
3470 | + |
3471 | purchase_line_obj.write(cr, uid, [line.id], {'invoiced': True, 'invoice_lines': [(4, inv_id)]}) |
3472 | invoices[line.partner_id.id].append((line,inv_id)) |
3473 | |
3474 | |
3475 | === modified file 'purchase_requisition/wizard/purchase_requisition_partner_view.xml' |
3476 | --- purchase_requisition/wizard/purchase_requisition_partner_view.xml 2011-01-14 00:11:01 +0000 |
3477 | +++ purchase_requisition/wizard/purchase_requisition_partner_view.xml 2014-04-22 12:10:57 +0000 |
3478 | @@ -9,7 +9,7 @@ |
3479 | <form string="Purchase Requisition"> |
3480 | <group colspan="2" col="2"> |
3481 | <field name="partner_id" on_change="onchange_partner_id(partner_id)"/> |
3482 | - <field domain="[('partner_id','=',partner_id)]" name="partner_address_id"/> |
3483 | + <field name="partner_address_id" domain="[('partner_id','=',partner_id)]" options='{"quick_create": false}' context="{'default_partner_id':partner_id}" /> |
3484 | <separator string="" colspan="4" /> |
3485 | <button icon="gtk-cancel" special="cancel" string="_Cancel"/> |
3486 | <button icon="gtk-ok" name="create_order" string="Create Quotation" type="object"/> |
3487 | |
3488 | === modified file 'sale/report/sale_order.rml' |
3489 | --- sale/report/sale_order.rml 2012-12-17 09:49:00 +0000 |
3490 | +++ sale/report/sale_order.rml 2014-04-22 12:10:57 +0000 |
3491 | @@ -126,33 +126,8 @@ |
3492 | <images/> |
3493 | </stylesheet> |
3494 | <story> |
3495 | - <pto> |
3496 | <para style="terp_default_8">[[repeatIn(objects,'o')]]</para> |
3497 | <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para> |
3498 | - <pto_header> |
3499 | - <blockTable colWidths="181.0,70.0,80.0,70.0,50.0,85.0" repeatRows="1" style="Table4"> |
3500 | - <tr> |
3501 | - <td> |
3502 | - <para style="terp_tblheader_Details">Description</para> |
3503 | - </td> |
3504 | - <td> |
3505 | - <para style="terp_tblheader_Details_Centre">VAT</para> |
3506 | - </td> |
3507 | - <td> |
3508 | - <para style="terp_tblheader_Details_Right">Quantity</para> |
3509 | - </td> |
3510 | - <td> |
3511 | - <para style="terp_tblheader_Details_Right">Unit Price</para> |
3512 | - </td> |
3513 | - <td> |
3514 | - <para style="terp_tblheader_Details_Centre">Disc.(%)</para> |
3515 | - </td> |
3516 | - <td> |
3517 | - <para style="terp_tblheader_Details_Right">Price</para> |
3518 | - </td> |
3519 | - </tr> |
3520 | - </blockTable> |
3521 | - </pto_header> |
3522 | <para style="terp_default_9"> |
3523 | <font color="white"> </font> |
3524 | </para> |
3525 | @@ -233,6 +208,31 @@ |
3526 | <para style="terp_default_8"> |
3527 | <font color="white"> </font> |
3528 | </para> |
3529 | + <pto> |
3530 | + <pto_header> |
3531 | + <blockTable colWidths="181.0,70.0,80.0,70.0,50.0,85.0" repeatRows="1" style="Table4"> |
3532 | + <tr> |
3533 | + <td> |
3534 | + <para style="terp_tblheader_Details">Description</para> |
3535 | + </td> |
3536 | + <td> |
3537 | + <para style="terp_tblheader_Details_Centre">VAT</para> |
3538 | + </td> |
3539 | + <td> |
3540 | + <para style="terp_tblheader_Details_Right">Quantity</para> |
3541 | + </td> |
3542 | + <td> |
3543 | + <para style="terp_tblheader_Details_Right">Unit Price</para> |
3544 | + </td> |
3545 | + <td> |
3546 | + <para style="terp_tblheader_Details_Centre">Disc.(%)</para> |
3547 | + </td> |
3548 | + <td> |
3549 | + <para style="terp_tblheader_Details_Right">Price</para> |
3550 | + </td> |
3551 | + </tr> |
3552 | + </blockTable> |
3553 | + </pto_header> |
3554 | <blockTable colWidths="181.0,70.0,80.0,70.0,50.0,85.0" repeatRows="1" style="Table4"> |
3555 | <tr> |
3556 | <td> |
3557 | @@ -310,6 +310,7 @@ |
3558 | </tr> |
3559 | </blockTable> |
3560 | </section> |
3561 | + </pto> |
3562 | <blockTable colWidths="381.0,60.0,93.0" style="Table6"> |
3563 | <tr> |
3564 | <td> |
3565 | @@ -365,6 +366,5 @@ |
3566 | <para style="terp_default_8"> |
3567 | <font color="white"> </font> |
3568 | </para> |
3569 | - </pto> |
3570 | </story> |
3571 | </document> |
3572 | |
3573 | === modified file 'sale/report/sale_report_view.xml' |
3574 | --- sale/report/sale_report_view.xml 2011-12-19 16:54:40 +0000 |
3575 | +++ sale/report/sale_report_view.xml 2014-04-22 12:10:57 +0000 |
3576 | @@ -52,7 +52,7 @@ |
3577 | <search string="Sales Analysis"> |
3578 | <group> |
3579 | <filter icon="terp-go-year" string="Year" name="year" |
3580 | - domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-01-01'))]" |
3581 | + domain="[('date','<=', time.strftime('%%Y-12-31')),('date','>=',time.strftime('%%Y-01-01'))]" |
3582 | help="Sales order created in current year"/> |
3583 | <separator orientation="vertical"/> |
3584 | <filter icon="terp-go-month" string="Month" |
3585 | |
3586 | === modified file 'sale/sale.py' |
3587 | --- sale/sale.py 2012-10-09 12:16:14 +0000 |
3588 | +++ sale/sale.py 2014-04-22 12:10:57 +0000 |
3589 | @@ -756,7 +756,7 @@ |
3590 | return { |
3591 | 'name': pick_name, |
3592 | 'origin': order.name, |
3593 | - 'date': order.date_order, |
3594 | + 'date': order.date_confirm, |
3595 | 'type': 'out', |
3596 | 'state': 'auto', |
3597 | 'move_type': order.picking_policy, |
3598 | @@ -822,7 +822,7 @@ |
3599 | if line.state == 'done': |
3600 | continue |
3601 | |
3602 | - date_planned = self._get_date_planned(cr, uid, order, line, order.date_order, context=context) |
3603 | + date_planned = self._get_date_planned(cr, uid, order, line, order.date_confirm, context=context) |
3604 | |
3605 | if line.product_id: |
3606 | if line.product_id.product_tmpl_id.type in ('product', 'consu'): |
3607 | @@ -1206,6 +1206,7 @@ |
3608 | product_uom_obj = self.pool.get('product.uom') |
3609 | partner_obj = self.pool.get('res.partner') |
3610 | product_obj = self.pool.get('product.product') |
3611 | + fpos_obj = self.pool.get('account.fiscal.position') |
3612 | context = dict(context, lang=lang, partner_id=partner_id) |
3613 | if partner_id: |
3614 | lang = partner_obj.browse(cr, uid, partner_id, context=context).lang |
3615 | @@ -1241,7 +1242,12 @@ |
3616 | fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position, context=context) or False |
3617 | if update_tax: #The quantity only have changed |
3618 | result['delay'] = (product_obj.sale_delay or 0.0) |
3619 | - result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id) |
3620 | + a = product_obj.product_tmpl_id.property_account_income.id |
3621 | + if not a: |
3622 | + a = product_obj.categ_id.property_account_income_categ.id |
3623 | + a = fpos_obj.map_account(cr, uid, fpos, a) |
3624 | + taxes = product_obj.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids) |
3625 | + result['tax_id'] = fpos_obj.map_tax(cr, uid, fpos, taxes) |
3626 | result.update({'type': product_obj.procure_method}) |
3627 | |
3628 | if not flag: |
3629 | |
3630 | === modified file 'sale/sale_view.xml' |
3631 | --- sale/sale_view.xml 2013-01-02 11:50:01 +0000 |
3632 | +++ sale/sale_view.xml 2014-04-22 12:10:57 +0000 |
3633 | @@ -116,9 +116,9 @@ |
3634 | <notebook colspan="5"> |
3635 | <page string="Sales Order"> |
3636 | <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"/> |
3637 | - <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}'/> |
3638 | - <field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id" groups="base.group_extended" options='{"quick_create": false}'/> |
3639 | - <field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id" groups="base.group_extended" options='{"quick_create": false}'/> |
3640 | + <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}"/> |
3641 | + <field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id" groups="base.group_extended" options='{"quick_create": false}' context="{'default_partner_id':partner_id}"/> |
3642 | + <field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id" groups="base.group_extended" options='{"quick_create": false}' context="{'default_partner_id':partner_id}"/> |
3643 | <field domain="[('type','=','sale')]" name="pricelist_id" groups="base.group_extended" on_change="onchange_pricelist_id(pricelist_id,order_line)"/> |
3644 | <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','<>','view'), ('company_id', '=', company_id), ('parent_id', '!=', False)]"/> |
3645 | <newline/> |
3646 | |
3647 | === modified file 'stock/report/report_stock_move.py' |
3648 | --- stock/report/report_stock_move.py 2013-04-04 12:46:09 +0000 |
3649 | +++ stock/report/report_stock_move.py 2014-04-22 12:10:57 +0000 |
3650 | @@ -153,7 +153,8 @@ |
3651 | 'date': fields.datetime('Date', readonly=True), |
3652 | 'year': fields.char('Year', size=4, readonly=True), |
3653 | 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), |
3654 | - ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September')]), |
3655 | + ('05', 'May'), ('06', 'June'), ('07', 'July'), ('08', 'August'), ('09', 'September'), |
3656 | + ('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly = True), |
3657 | 'partner_id':fields.many2one('res.partner.address', 'Partner', readonly=True), |
3658 | 'product_id':fields.many2one('product.product', 'Product', readonly=True), |
3659 | 'product_categ_id':fields.many2one('product.category', 'Product Category', readonly=True), |
3660 | @@ -173,6 +174,8 @@ |
3661 | CREATE OR REPLACE view report_stock_inventory AS ( |
3662 | (SELECT |
3663 | min(m.id) as id, m.date as date, |
3664 | + to_char(m.date, 'YYYY') as year, |
3665 | + to_char(m.date, 'MM') as month, |
3666 | m.address_id as partner_id, m.location_id as location_id, |
3667 | m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, |
3668 | m.company_id, |
3669 | @@ -196,6 +199,8 @@ |
3670 | ) UNION ALL ( |
3671 | SELECT |
3672 | -m.id as id, m.date as date, |
3673 | + to_char(m.date, 'YYYY') as year, |
3674 | + to_char(m.date, 'MM') as month, |
3675 | m.address_id as partner_id, m.location_dest_id as location_id, |
3676 | m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, |
3677 | m.company_id, |
3678 | |
3679 | === modified file 'stock/stock.py' |
3680 | --- stock/stock.py 2013-10-02 13:19:11 +0000 |
3681 | +++ stock/stock.py 2014-04-22 12:10:57 +0000 |
3682 | @@ -1268,7 +1268,7 @@ |
3683 | 'product_uos_qty': product_qty, #TODO: put correct uos_qty |
3684 | 'picking_id' : new_picking, |
3685 | 'state': 'assigned', |
3686 | - 'move_dest_id': False, |
3687 | + 'move_dest_id': move.move_dest_id.id, |
3688 | 'price_unit': move.price_unit, |
3689 | 'product_uom': product_uoms[move.id] |
3690 | } |
3691 | @@ -2572,7 +2572,7 @@ |
3692 | 'product_uos_qty': product_qty, |
3693 | 'picking_id' : move.picking_id.id, |
3694 | 'state': 'assigned', |
3695 | - 'move_dest_id': False, |
3696 | + 'move_dest_id': move.move_dest_id.id, |
3697 | 'price_unit': move.price_unit, |
3698 | } |
3699 | prodlot_id = prodlot_ids[move.id] |
3700 | |
3701 | === modified file 'stock/wizard/stock_return_picking.py' |
3702 | --- stock/wizard/stock_return_picking.py 2013-10-01 14:45:37 +0000 |
3703 | +++ stock/wizard/stock_return_picking.py 2014-04-22 12:10:57 +0000 |
3704 | @@ -72,9 +72,10 @@ |
3705 | res.update({'invoice_state': 'none'}) |
3706 | return_history = self.get_return_history(cr, uid, record_id, context) |
3707 | for line in pick.move_lines: |
3708 | - qty = line.product_qty - return_history[line.id] |
3709 | - if qty > 0: |
3710 | - result1.append({'product_id': line.product_id.id, 'quantity': qty,'move_id':line.id}) |
3711 | + if line.state <> 'cancel': |
3712 | + qty = line.product_qty - return_history[line.id] |
3713 | + if qty > 0: |
3714 | + result1.append({'product_id': line.product_id.id, 'quantity': qty,'move_id':line.id}) |
3715 | if 'product_return_moves' in fields: |
3716 | res.update({'product_return_moves': result1}) |
3717 | return res |
3718 | @@ -128,7 +129,7 @@ |
3719 | # a valid return move will be the exact opposite of ours: |
3720 | # (src location, dest location) <=> (dest location, src location)) |
3721 | if rec.location_dest_id.id == m.location_id.id \ |
3722 | - and rec.location_id.id == m.location_dest_id.id: |
3723 | + and rec.location_id.id == m.location_dest_id.id and rec.state != 'cancel': |
3724 | return_history[m.id] += (rec.product_qty * rec.product_uom.factor) |
3725 | return return_history |
3726 | |
3727 | @@ -166,9 +167,14 @@ |
3728 | new_type = 'internal' |
3729 | seq_obj_name = 'stock.picking.' + new_type |
3730 | new_pick_name = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name) |
3731 | - new_picking = pick_obj.copy(cr, uid, pick.id, {'name':'%s-%s-return' % (new_pick_name, pick.name), |
3732 | - 'move_lines':[], 'state':'draft', 'type':new_type, |
3733 | - 'date':date_cur, 'invoice_state':data['invoice_state'],}) |
3734 | + new_picking = pick_obj.copy(cr, uid, pick.id, { |
3735 | + 'name':'%s-%s-return' % (new_pick_name, pick.name), |
3736 | + 'move_lines':[], |
3737 | + 'state':'draft', |
3738 | + 'backorder_id': False, |
3739 | + 'type':new_type, |
3740 | + 'date':date_cur, |
3741 | + 'invoice_state':data['invoice_state'],}) |
3742 | |
3743 | val_id = data['product_return_moves'] |
3744 | for v in val_id: |
3745 | |
3746 | === modified file 'users_ldap/users_ldap.py' |
3747 | --- users_ldap/users_ldap.py 2014-01-27 13:36:44 +0000 |
3748 | +++ users_ldap/users_ldap.py 2014-04-22 12:10:57 +0000 |
3749 | @@ -184,7 +184,7 @@ |
3750 | """ |
3751 | |
3752 | user_id = False |
3753 | - login = tools.ustr(login) |
3754 | + login = tools.ustr(login.lower()) |
3755 | cr.execute("SELECT id, active FROM res_users WHERE login=%s", (login,)) |
3756 | res = cr.fetchone() |
3757 | if res: |
3758 | |
3759 | === modified file 'warning/warning.py' |
3760 | --- warning/warning.py 2012-09-06 10:32:09 +0000 |
3761 | +++ warning/warning.py 2014-04-22 12:10:57 +0000 |
3762 | @@ -231,7 +231,7 @@ |
3763 | class purchase_order_line(osv.osv): |
3764 | _inherit = 'purchase.order.line' |
3765 | def onchange_product_id(self,cr, uid, ids, pricelist, product, qty, uom, |
3766 | - partner_id, date_order=False, fiscal_position=False, date_planned=False, |
3767 | + partner_id, date_order=False, fiscal_position_id=False, date_planned=False, |
3768 | name=False, price_unit=False, notes=False, context=None): |
3769 | warning = {} |
3770 | if not product: |
3771 | @@ -250,7 +250,7 @@ |
3772 | warning['message'] = message |
3773 | |
3774 | result = super(purchase_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, uom, |
3775 | - partner_id, date_order, fiscal_position) |
3776 | + partner_id, date_order, fiscal_position_id) |
3777 | |
3778 | if result.get('warning',False): |
3779 | warning['title'] = title and title +' & '+result['warning']['title'] or result['warning']['title'] |
3780 | |
3781 | === modified file 'wiki/wiki.py' |
3782 | --- wiki/wiki.py 2012-03-28 06:02:25 +0000 |
3783 | +++ wiki/wiki.py 2014-04-22 12:10:57 +0000 |
3784 | @@ -81,6 +81,7 @@ |
3785 | } |
3786 | group = self.browse(cr, uid, group_id, context=context) |
3787 | value['domain'] = "[('group_id','=',%d)]" % (group.id) |
3788 | + value['context'] = "{'default_group_id': %d}" % (group.id) |
3789 | if group.method == 'page': |
3790 | value['res_id'] = group.home.id |
3791 | elif group.method == 'list': |
3792 | |
3793 | === modified file 'wiki/wizard/wiki_create_menu.py' |
3794 | --- wiki/wizard/wiki_create_menu.py 2011-01-14 00:11:01 +0000 |
3795 | +++ wiki/wizard/wiki_create_menu.py 2014-04-22 12:10:57 +0000 |
3796 | @@ -66,6 +66,7 @@ |
3797 | } |
3798 | group = obj_wiki_group.browse(cr, uid, group_id, context=context) |
3799 | value['domain'] = "[('group_id','=',%d)]" % (group.id) |
3800 | + value['context'] = "{'default_group_id': %d}" % (group.id) |
3801 | if group.method == 'page': |
3802 | value['res_id'] = group.home.id |
3803 | elif group.method == 'list': |
3804 | |
3805 | === modified file 'wiki/wizard/wiki_wiki_page_open.py' |
3806 | --- wiki/wizard/wiki_wiki_page_open.py 2011-01-14 00:11:01 +0000 |
3807 | +++ wiki/wizard/wiki_wiki_page_open.py 2014-04-22 12:10:57 +0000 |
3808 | @@ -41,6 +41,7 @@ |
3809 | for group in self.pool.get('wiki.groups').browse(cr, uid, group_ids, context=context): |
3810 | value = { |
3811 | 'domain': "[('group_id','=',%d)]" % (group.id), |
3812 | + 'context': "{'default_group_id': %d}" % (group.id), |
3813 | 'name': 'Wiki Page', |
3814 | 'view_type': 'form', |
3815 | 'view_mode': 'form,tree', |
LGTM