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 | 23 | import installer | 23 | import installer |
6 | 24 | import project | 24 | import project |
7 | 25 | import partner | 25 | import partner |
8 | 26 | import company | ||
9 | 26 | import account_invoice | 27 | import account_invoice |
10 | 27 | import account_bank_statement | 28 | import account_bank_statement |
11 | 28 | import account_bank | 29 | import account_bank |
12 | @@ -34,7 +35,6 @@ | |||
13 | 34 | import report | 35 | import report |
14 | 35 | import product | 36 | import product |
15 | 36 | import ir_sequence | 37 | import ir_sequence |
16 | 37 | import company | ||
17 | 38 | import res_currency | 38 | import res_currency |
18 | 39 | import edi | 39 | import edi |
19 | 40 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 40 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
20 | 41 | 41 | ||
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 | 29 | from osv import fields, osv | 29 | from osv import fields, osv |
26 | 30 | import decimal_precision as dp | 30 | import decimal_precision as dp |
27 | 31 | from tools.translate import _ | 31 | from tools.translate import _ |
28 | 32 | from openerp.tools.float_utils import float_round | ||
29 | 32 | 33 | ||
30 | 33 | def check_cycle(self, cr, uid, ids, context=None): | 34 | def check_cycle(self, cr, uid, ids, context=None): |
31 | 34 | """ climbs the ``self._table.parent_id`` chains for 100 levels or | 35 | """ climbs the ``self._table.parent_id`` chains for 100 levels or |
32 | @@ -106,7 +107,7 @@ | |||
33 | 106 | 'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \ | 107 | 'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \ |
34 | 107 | "If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."), | 108 | "If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."), |
35 | 108 | 'days2': fields.integer('Day of the Month', required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."), | 109 | 'days2': fields.integer('Day of the Month', required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."), |
37 | 109 | 'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True), | 110 | 'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True, ondelete='cascade'), |
38 | 110 | } | 111 | } |
39 | 111 | _defaults = { | 112 | _defaults = { |
40 | 112 | 'value': 'balance', | 113 | 'value': 'balance', |
41 | @@ -1396,7 +1397,7 @@ | |||
42 | 1396 | if not l[0]: | 1397 | if not l[0]: |
43 | 1397 | l[2].update({ | 1398 | l[2].update({ |
44 | 1398 | 'reconcile_id':False, | 1399 | 'reconcile_id':False, |
46 | 1399 | 'reconcil_partial_id':False, | 1400 | 'reconcile_partial_id':False, |
47 | 1400 | 'analytic_lines':False, | 1401 | 'analytic_lines':False, |
48 | 1401 | 'invoice':False, | 1402 | 'invoice':False, |
49 | 1402 | 'ref':False, | 1403 | 'ref':False, |
50 | @@ -1523,7 +1524,13 @@ | |||
51 | 1523 | cr.execute('update account_move_line set '+mode2+'=%s where id=%s', (result, line_id)) | 1524 | cr.execute('update account_move_line set '+mode2+'=%s where id=%s', (result, line_id)) |
52 | 1524 | 1525 | ||
53 | 1525 | #adjust also the amount in currency if needed | 1526 | #adjust also the amount in currency if needed |
55 | 1526 | cr.execute("select currency_id, sum(amount_currency) as amount_currency from account_move_line where move_id = %s and currency_id is not null group by currency_id", (move.id,)) | 1527 | cr.execute( |
56 | 1528 | '''select currency_id, sum(amount_currency) as amount_currency | ||
57 | 1529 | from account_move_line | ||
58 | 1530 | where move_id = %s | ||
59 | 1531 | and currency_id is not null | ||
60 | 1532 | and amount_currency is not null | ||
61 | 1533 | group by currency_id''', (move.id,)) | ||
62 | 1527 | for row in cr.dictfetchall(): | 1534 | for row in cr.dictfetchall(): |
63 | 1528 | currency_id = currency_obj.browse(cr, uid, row['currency_id'], context=context) | 1535 | currency_id = currency_obj.browse(cr, uid, row['currency_id'], context=context) |
64 | 1529 | if not currency_obj.is_zero(cr, uid, currency_id, row['amount_currency']): | 1536 | if not currency_obj.is_zero(cr, uid, currency_id, row['amount_currency']): |
65 | @@ -1855,6 +1862,14 @@ | |||
66 | 1855 | return result in the context | 1862 | return result in the context |
67 | 1856 | Ex: result=round(price_unit*0.21,4) | 1863 | Ex: result=round(price_unit*0.21,4) |
68 | 1857 | """ | 1864 | """ |
69 | 1865 | |||
70 | 1866 | def copy_data(self, cr, uid, id, default=None, context=None): | ||
71 | 1867 | if default is None: | ||
72 | 1868 | default = {} | ||
73 | 1869 | name = self.read(cr, uid, id, ['name'], context=context)['name'] | ||
74 | 1870 | default = default.copy() | ||
75 | 1871 | default.update({'name': name + _(' (Copy)')}) | ||
76 | 1872 | return super(account_tax, self).copy_data(cr, uid, id, default=default, context=context) | ||
77 | 1858 | 1873 | ||
78 | 1859 | def get_precision_tax(): | 1874 | def get_precision_tax(): |
79 | 1860 | def change_digit_tax(cr): | 1875 | def change_digit_tax(cr): |
80 | @@ -2070,7 +2085,9 @@ | |||
81 | 2070 | cur_price_unit+=amount2 | 2085 | cur_price_unit+=amount2 |
82 | 2071 | return res | 2086 | return res |
83 | 2072 | 2087 | ||
85 | 2073 | def compute_all(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None, force_excluded=False): | 2088 | def compute_all(self, cr, uid, taxes, price_unit, quantity, |
86 | 2089 | address_id=None, product=None, partner=None, force_excluded=False, | ||
87 | 2090 | context=None): | ||
88 | 2074 | """ | 2091 | """ |
89 | 2075 | :param force_excluded: boolean used to say that we don't want to consider the value of field price_include of | 2092 | :param force_excluded: boolean used to say that we don't want to consider the value of field price_include of |
90 | 2076 | tax. It's used in encoding by line where you don't matter if you encoded a tax with that boolean to True or | 2093 | 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 | 2081 | 'taxes': [] # List of taxes, see compute for the format | 2098 | 'taxes': [] # List of taxes, see compute for the format |
93 | 2082 | } | 2099 | } |
94 | 2083 | """ | 2100 | """ |
95 | 2101 | |||
96 | 2102 | # By default, for each tax, tax amount will first be computed | ||
97 | 2103 | # and rounded at the 'Account' decimal precision for each | ||
98 | 2104 | # PO/SO/invoice line and then these rounded amounts will be | ||
99 | 2105 | # summed, leading to the total amount for that tax. But, if the | ||
100 | 2106 | # company has tax_calculation_rounding_method = round_globally, | ||
101 | 2107 | # we still follow the same method, but we use a much larger | ||
102 | 2108 | # precision when we round the tax amount for each line (we use | ||
103 | 2109 | # the 'Account' decimal precision + 5), and that way it's like | ||
104 | 2110 | # rounding after the sum of the tax amounts of each line | ||
105 | 2084 | precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account') | 2111 | precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account') |
107 | 2085 | totalin = totalex = round(price_unit * quantity, precision) | 2112 | tax_compute_precision = precision |
108 | 2113 | rounding_method = ( | ||
109 | 2114 | (context and context.get('tax_calculation_rounding_method')) | ||
110 | 2115 | or (taxes and taxes[0].company_id.tax_calculation_rounding_method) | ||
111 | 2116 | or 'round_per_line') | ||
112 | 2117 | if rounding_method == 'round_globally': | ||
113 | 2118 | tax_compute_precision += 5 | ||
114 | 2119 | totalin = totalex = float_round(price_unit * quantity, precision) | ||
115 | 2086 | tin = [] | 2120 | tin = [] |
116 | 2087 | tex = [] | 2121 | tex = [] |
117 | 2088 | for tax in taxes: | 2122 | for tax in taxes: |
118 | @@ -2090,7 +2124,7 @@ | |||
119 | 2090 | tex.append(tax) | 2124 | tex.append(tax) |
120 | 2091 | else: | 2125 | else: |
121 | 2092 | tin.append(tax) | 2126 | tin.append(tax) |
123 | 2093 | tin = self.compute_inv(cr, uid, tin, price_unit, quantity, address_id=address_id, product=product, partner=partner) | 2127 | tin = self.compute_inv(cr, uid, tin, price_unit, quantity, address_id=address_id, product=product, partner=partner, precision=tax_compute_precision) |
124 | 2094 | for r in tin: | 2128 | for r in tin: |
125 | 2095 | totalex -= r.get('amount', 0.0) | 2129 | totalex -= r.get('amount', 0.0) |
126 | 2096 | totlex_qty = 0.0 | 2130 | totlex_qty = 0.0 |
127 | @@ -2098,7 +2132,7 @@ | |||
128 | 2098 | totlex_qty = totalex/quantity | 2132 | totlex_qty = totalex/quantity |
129 | 2099 | except: | 2133 | except: |
130 | 2100 | pass | 2134 | pass |
132 | 2101 | tex = self._compute(cr, uid, tex, totlex_qty, quantity, address_id=address_id, product=product, partner=partner) | 2135 | tex = self._compute(cr, uid, tex, totlex_qty, quantity, address_id=address_id, product=product, partner=partner, precision=tax_compute_precision) |
133 | 2102 | for r in tex: | 2136 | for r in tex: |
134 | 2103 | totalin += r.get('amount', 0.0) | 2137 | totalin += r.get('amount', 0.0) |
135 | 2104 | return { | 2138 | return { |
136 | @@ -2113,7 +2147,7 @@ | |||
137 | 2113 | "Deprecated, use compute_all(...)['taxes'] instead of compute(...) to manage prices with tax included") | 2147 | "Deprecated, use compute_all(...)['taxes'] instead of compute(...) to manage prices with tax included") |
138 | 2114 | return self._compute(cr, uid, taxes, price_unit, quantity, address_id, product, partner) | 2148 | return self._compute(cr, uid, taxes, price_unit, quantity, address_id, product, partner) |
139 | 2115 | 2149 | ||
141 | 2116 | def _compute(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None): | 2150 | def _compute(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None, precision=None): |
142 | 2117 | """ | 2151 | """ |
143 | 2118 | Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID. | 2152 | Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID. |
144 | 2119 | 2153 | ||
145 | @@ -2122,14 +2156,15 @@ | |||
146 | 2122 | tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2} | 2156 | tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2} |
147 | 2123 | one tax for each tax id in IDS and their children | 2157 | one tax for each tax id in IDS and their children |
148 | 2124 | """ | 2158 | """ |
149 | 2159 | if not precision: | ||
150 | 2160 | precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account') | ||
151 | 2125 | res = self._unit_compute(cr, uid, taxes, price_unit, address_id, product, partner, quantity) | 2161 | res = self._unit_compute(cr, uid, taxes, price_unit, address_id, product, partner, quantity) |
152 | 2126 | total = 0.0 | 2162 | total = 0.0 |
153 | 2127 | precision_pool = self.pool.get('decimal.precision') | ||
154 | 2128 | for r in res: | 2163 | for r in res: |
155 | 2129 | if r.get('balance',False): | 2164 | if r.get('balance',False): |
157 | 2130 | r['amount'] = round(r.get('balance', 0.0) * quantity, precision_pool.precision_get(cr, uid, 'Account')) - total | 2165 | r['amount'] = round(r.get('balance', 0.0) * quantity, precision) - total |
158 | 2131 | else: | 2166 | else: |
160 | 2132 | r['amount'] = round(r.get('amount', 0.0) * quantity, precision_pool.precision_get(cr, uid, 'Account')) | 2167 | r['amount'] = round(r.get('amount', 0.0) * quantity, precision) |
161 | 2133 | total += r['amount'] | 2168 | total += r['amount'] |
162 | 2134 | return res | 2169 | return res |
163 | 2135 | 2170 | ||
164 | @@ -2207,7 +2242,7 @@ | |||
165 | 2207 | r['todo'] = 0 | 2242 | r['todo'] = 0 |
166 | 2208 | return res | 2243 | return res |
167 | 2209 | 2244 | ||
169 | 2210 | def compute_inv(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None): | 2245 | def compute_inv(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None, precision=None): |
170 | 2211 | """ | 2246 | """ |
171 | 2212 | Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID. | 2247 | Compute tax values for given PRICE_UNIT, QUANTITY and a buyer/seller ADDRESS_ID. |
172 | 2213 | Price Unit is a VAT included price | 2248 | Price Unit is a VAT included price |
173 | @@ -2217,15 +2252,15 @@ | |||
174 | 2217 | tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2} | 2252 | tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2} |
175 | 2218 | one tax for each tax id in IDS and their children | 2253 | one tax for each tax id in IDS and their children |
176 | 2219 | """ | 2254 | """ |
177 | 2255 | if not precision: | ||
178 | 2256 | precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account') | ||
179 | 2220 | res = self._unit_compute_inv(cr, uid, taxes, price_unit, address_id, product, partner=None) | 2257 | res = self._unit_compute_inv(cr, uid, taxes, price_unit, address_id, product, partner=None) |
180 | 2221 | total = 0.0 | 2258 | total = 0.0 |
181 | 2222 | obj_precision = self.pool.get('decimal.precision') | ||
182 | 2223 | for r in res: | 2259 | for r in res: |
183 | 2224 | prec = obj_precision.precision_get(cr, uid, 'Account') | ||
184 | 2225 | if r.get('balance',False): | 2260 | if r.get('balance',False): |
186 | 2226 | r['amount'] = round(r['balance'] * quantity, prec) - total | 2261 | r['amount'] = round(r['balance'] * quantity, precision) - total |
187 | 2227 | else: | 2262 | else: |
189 | 2228 | r['amount'] = round(r['amount'] * quantity, prec) | 2263 | r['amount'] = round(r['amount'] * quantity, precision) |
190 | 2229 | total += r['amount'] | 2264 | total += r['amount'] |
191 | 2230 | return res | 2265 | return res |
192 | 2231 | 2266 | ||
193 | @@ -2323,6 +2358,14 @@ | |||
194 | 2323 | 2358 | ||
195 | 2324 | return move_ids | 2359 | return move_ids |
196 | 2325 | 2360 | ||
197 | 2361 | def onchange_journal_id(self, cr, uid, ids, journal_id, context=None): | ||
198 | 2362 | company_id = False | ||
199 | 2363 | if journal_id: | ||
200 | 2364 | journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context) | ||
201 | 2365 | if journal.company_id.id: | ||
202 | 2366 | company_id = journal.company_id.id | ||
203 | 2367 | return {'value': {'company_id': company_id}} | ||
204 | 2368 | |||
205 | 2326 | account_model() | 2369 | account_model() |
206 | 2327 | 2370 | ||
207 | 2328 | class account_model_line(osv.osv): | 2371 | class account_model_line(osv.osv): |
208 | 2329 | 2372 | ||
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 | 91 | return [('none', _('Free Reference'))] | 91 | return [('none', _('Free Reference'))] |
214 | 92 | 92 | ||
215 | 93 | def _amount_residual(self, cr, uid, ids, name, args, context=None): | 93 | def _amount_residual(self, cr, uid, ids, name, args, context=None): |
216 | 94 | if context is None: | ||
217 | 95 | context = {} | ||
218 | 96 | ctx = context.copy() | ||
219 | 94 | result = {} | 97 | result = {} |
220 | 98 | currency_obj = self.pool.get('res.currency') | ||
221 | 95 | for invoice in self.browse(cr, uid, ids, context=context): | 99 | for invoice in self.browse(cr, uid, ids, context=context): |
223 | 96 | checked_partial_rec_ids = [] | 100 | nb_inv_in_partial_rec = max_invoice_id = 0 |
224 | 97 | result[invoice.id] = 0.0 | 101 | result[invoice.id] = 0.0 |
225 | 98 | if invoice.move_id: | 102 | if invoice.move_id: |
234 | 99 | for move_line in invoice.move_id.line_id: | 103 | for aml in invoice.move_id.line_id: |
235 | 100 | if move_line.account_id.type in ('receivable','payable'): | 104 | if aml.account_id.type in ('receivable','payable'): |
236 | 101 | if move_line.reconcile_partial_id: | 105 | if aml.currency_id and aml.currency_id.id == invoice.currency_id.id: |
237 | 102 | partial_reconcile_id = move_line.reconcile_partial_id.id | 106 | result[invoice.id] += aml.amount_residual_currency |
238 | 103 | if partial_reconcile_id in checked_partial_rec_ids: | 107 | else: |
239 | 104 | continue | 108 | ctx['date'] = aml.date |
240 | 105 | checked_partial_rec_ids.append(partial_reconcile_id) | 109 | result[invoice.id] += currency_obj.compute(cr, uid, aml.company_id.currency_id.id, invoice.currency_id.id, aml.amount_residual, context=ctx) |
241 | 106 | result[invoice.id] += move_line.amount_residual_currency | 110 | |
242 | 111 | if aml.reconcile_partial_id.line_partial_ids: | ||
243 | 112 | #we check if the invoice is partially reconciled and if there are other invoices | ||
244 | 113 | #involved in this partial reconciliation (and we sum these invoices) | ||
245 | 114 | for line in aml.reconcile_partial_id.line_partial_ids: | ||
246 | 115 | if line.invoice: | ||
247 | 116 | nb_inv_in_partial_rec += 1 | ||
248 | 117 | #store the max invoice id as for this invoice we will make a balance instead of a simple division | ||
249 | 118 | max_invoice_id = max(max_invoice_id, line.invoice.id) | ||
250 | 119 | if nb_inv_in_partial_rec: | ||
251 | 120 | #if there are several invoices in a partial reconciliation, we split the residual by the number | ||
252 | 121 | #of invoice to have a sum of residual amounts that matches the partner balance | ||
253 | 122 | new_value = currency_obj.round(cr, uid, invoice.currency_id, result[invoice.id] / nb_inv_in_partial_rec) | ||
254 | 123 | if invoice.id == max_invoice_id: | ||
255 | 124 | #if it's the last the invoice of the bunch of invoices partially reconciled together, we make a | ||
256 | 125 | #balance to avoid rounding errors | ||
257 | 126 | result[invoice.id] = result[invoice.id] - ((nb_inv_in_partial_rec - 1) * new_value) | ||
258 | 127 | else: | ||
259 | 128 | result[invoice.id] = new_value | ||
260 | 129 | |||
261 | 130 | #prevent the residual amount on the invoice to be less than 0 | ||
262 | 131 | result[invoice.id] = max(result[invoice.id], 0.0) | ||
263 | 107 | return result | 132 | return result |
264 | 108 | 133 | ||
265 | 109 | # Give Journal Items related to the payment reconciled to this invoice | 134 | # Give Journal Items related to the payment reconciled to this invoice |
266 | @@ -284,8 +309,40 @@ | |||
267 | 284 | 'payment_ids': fields.function(_compute_lines, relation='account.move.line', type="many2many", string='Payments'), | 309 | 'payment_ids': fields.function(_compute_lines, relation='account.move.line', type="many2many", string='Payments'), |
268 | 285 | 'move_name': fields.char('Journal Entry', size=64, readonly=True, states={'draft':[('readonly',False)]}), | 310 | 'move_name': fields.char('Journal Entry', size=64, readonly=True, states={'draft':[('readonly',False)]}), |
269 | 286 | 'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}), | 311 | 'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}), |
271 | 287 | 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True, states={'draft':[('readonly',False)]}) | 312 | 'fiscal_position': fields.many2one('account.fiscal.position', |
272 | 313 | 'Fiscal Position', readonly=True, | ||
273 | 314 | states={'draft':[('readonly',False)]}), | ||
274 | 315 | 'tax_calculation_rounding_method': fields.selection([ | ||
275 | 316 | ('round_per_line', 'Round per line'), | ||
276 | 317 | ('round_globally', 'Round globally'), | ||
277 | 318 | ], 'Tax calculation rounding method', | ||
278 | 319 | help='''If you select 'Round per line' : for each tax, the tax | ||
279 | 320 | amount will first be computed and rounded for each PO/SO/invoice line and then | ||
280 | 321 | these rounded amounts will be summed, leading to the total amount for that tax. | ||
281 | 322 | If you select 'Round globally': for each tax, the tax amount will be computed | ||
282 | 323 | for each PO/SO/invoice line, then these amounts will be summed and eventually | ||
283 | 324 | this total tax amount will be rounded. If you sell with tax included, you | ||
284 | 325 | should choose 'Round per line' because you certainly want the sum of your | ||
285 | 326 | tax-included line subtotals to be equal to the total amount with taxes.'''), | ||
286 | 288 | } | 327 | } |
287 | 328 | |||
288 | 329 | def _get_company_rounding(self, cr, uid, company_id, context=None): | ||
289 | 330 | res = 'round_per_line' | ||
290 | 331 | if company_id: | ||
291 | 332 | company_model = self.pool.get('res.company') | ||
292 | 333 | company_obj = company_model.browse( | ||
293 | 334 | cr, uid, company_id, context=context) | ||
294 | 335 | if company_obj and company_obj['tax_calculation_rounding_method']: | ||
295 | 336 | res = company_obj['tax_calculation_rounding_method'] | ||
296 | 337 | return res | ||
297 | 338 | |||
298 | 339 | def _get_default_rounding_method(self, cr, uid, context=None): | ||
299 | 340 | # default rounding depends on company. We start with default company | ||
300 | 341 | company_model = self.pool.get('res.company') | ||
301 | 342 | company_id = company_model._company_default_get( | ||
302 | 343 | cr, uid, 'account.invoice', context=context) | ||
303 | 344 | return self._get_company_rounding(cr, uid, company_id, context) | ||
304 | 345 | |||
305 | 289 | _defaults = { | 346 | _defaults = { |
306 | 290 | 'type': _get_type, | 347 | 'type': _get_type, |
307 | 291 | 'state': 'draft', | 348 | 'state': 'draft', |
308 | @@ -296,6 +353,7 @@ | |||
309 | 296 | 'check_total': 0.0, | 353 | 'check_total': 0.0, |
310 | 297 | 'internal_number': False, | 354 | 'internal_number': False, |
311 | 298 | 'user_id': lambda s, cr, u, c: u, | 355 | 'user_id': lambda s, cr, u, c: u, |
312 | 356 | 'tax_calculation_rounding_method': _get_default_rounding_method, | ||
313 | 299 | } | 357 | } |
314 | 300 | _sql_constraints = [ | 358 | _sql_constraints = [ |
315 | 301 | ('number_uniq', 'unique(number, company_id, journal_id, type)', 'Invoice Number must be unique per Company!'), | 359 | ('number_uniq', 'unique(number, company_id, journal_id, type)', 'Invoice Number must be unique per Company!'), |
316 | @@ -516,6 +574,9 @@ | |||
317 | 516 | obj_journal = self.pool.get('account.journal') | 574 | obj_journal = self.pool.get('account.journal') |
318 | 517 | account_obj = self.pool.get('account.account') | 575 | account_obj = self.pool.get('account.account') |
319 | 518 | inv_line_obj = self.pool.get('account.invoice.line') | 576 | inv_line_obj = self.pool.get('account.invoice.line') |
320 | 577 | if company_id: | ||
321 | 578 | val['tax_calculation_rounding_method'] = ( | ||
322 | 579 | self._get_company_rounding(cr, uid, company_id)) | ||
323 | 519 | if company_id and part_id and type: | 580 | if company_id and part_id and type: |
324 | 520 | acc_id = False | 581 | acc_id = False |
325 | 521 | partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id) | 582 | partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id) |
326 | @@ -1026,6 +1087,23 @@ | |||
327 | 1026 | self.log(cr, uid, inv_id, message, context=ctx) | 1087 | self.log(cr, uid, inv_id, message, context=ctx) |
328 | 1027 | return True | 1088 | return True |
329 | 1028 | 1089 | ||
330 | 1090 | def action_proforma(self, cr, uid, ids, context=None): | ||
331 | 1091 | """ | ||
332 | 1092 | Check if all taxes are present with the correct base amount | ||
333 | 1093 | on creating a proforma invoice. This leaves room for manual | ||
334 | 1094 | corrections of the tax amount. | ||
335 | 1095 | """ | ||
336 | 1096 | if not ids: | ||
337 | 1097 | return True | ||
338 | 1098 | if isinstance(ids, (int, long)): | ||
339 | 1099 | ids = [ids] | ||
340 | 1100 | ait_obj = self.pool.get('account.invoice.tax') | ||
341 | 1101 | for inv in self.browse(cr, uid, ids, context=context): | ||
342 | 1102 | compute_taxes = ait_obj.compute(cr, uid, inv.id, context=context) | ||
343 | 1103 | self.check_tax_lines(cr, uid, inv, compute_taxes, ait_obj) | ||
344 | 1104 | return self.write( | ||
345 | 1105 | cr, uid, ids, {'state': 'proforma2'}, context=context) | ||
346 | 1106 | |||
347 | 1029 | def action_cancel(self, cr, uid, ids, *args): | 1107 | def action_cancel(self, cr, uid, ids, *args): |
348 | 1030 | context = {} # TODO: Use context from arguments | 1108 | context = {} # TODO: Use context from arguments |
349 | 1031 | account_move_obj = self.pool.get('account.move') | 1109 | account_move_obj = self.pool.get('account.move') |
350 | @@ -1268,9 +1346,17 @@ | |||
351 | 1268 | res = {} | 1346 | res = {} |
352 | 1269 | tax_obj = self.pool.get('account.tax') | 1347 | tax_obj = self.pool.get('account.tax') |
353 | 1270 | cur_obj = self.pool.get('res.currency') | 1348 | cur_obj = self.pool.get('res.currency') |
354 | 1349 | local_context = {} | ||
355 | 1271 | for line in self.browse(cr, uid, ids): | 1350 | for line in self.browse(cr, uid, ids): |
356 | 1272 | price = line.price_unit * (1-(line.discount or 0.0)/100.0) | 1351 | price = line.price_unit * (1-(line.discount or 0.0)/100.0) |
358 | 1273 | taxes = tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, price, line.quantity, product=line.product_id, address_id=line.invoice_id.address_invoice_id, partner=line.invoice_id.partner_id) | 1352 | local_context['tax_calculation_rounding_method'] = ( |
359 | 1353 | line.invoice_id.tax_calculation_rounding_method) | ||
360 | 1354 | taxes = tax_obj.compute_all( | ||
361 | 1355 | cr, uid, line.invoice_line_tax_id, price, line.quantity, | ||
362 | 1356 | product=line.product_id, | ||
363 | 1357 | address_id=line.invoice_id.address_invoice_id, | ||
364 | 1358 | partner=line.invoice_id.partner_id, | ||
365 | 1359 | context=local_context) | ||
366 | 1274 | res[line.id] = taxes['total'] | 1360 | res[line.id] = taxes['total'] |
367 | 1275 | if line.invoice_id: | 1361 | if line.invoice_id: |
368 | 1276 | cur = line.invoice_id.currency_id | 1362 | cur = line.invoice_id.currency_id |
369 | @@ -1380,11 +1466,19 @@ | |||
370 | 1380 | else: | 1466 | else: |
371 | 1381 | taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False) | 1467 | taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False) |
372 | 1382 | tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes) | 1468 | tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes) |
378 | 1383 | 1469 | result['invoice_line_tax_id'] = tax_id | |
379 | 1384 | if type in ('in_invoice', 'in_refund'): | 1470 | |
380 | 1385 | result.update( {'price_unit': price_unit or res.standard_price,'invoice_line_tax_id': tax_id} ) | 1471 | warning = {} |
381 | 1386 | else: | 1472 | # When product changes, price ALWAYS need to be reset. If not price |
382 | 1387 | result.update({'price_unit': res.list_price, 'invoice_line_tax_id': tax_id}) | 1473 | # found in product, or pricelist, it should become False. Only if |
383 | 1474 | # product_id has been cleared by user, we will leave price_unit as is. | ||
384 | 1475 | if product: | ||
385 | 1476 | price_unit, pu_warning = self._price_unit_get( | ||
386 | 1477 | cr, uid, product, uom, qty, type, partner_id, | ||
387 | 1478 | currency_id, context=context) | ||
388 | 1479 | result['price_unit'] = price_unit # might be False | ||
389 | 1480 | warning.update(pu_warning) | ||
390 | 1481 | |||
391 | 1388 | result['name'] = res.partner_ref | 1482 | result['name'] = res.partner_ref |
392 | 1389 | 1483 | ||
393 | 1390 | domain = {} | 1484 | domain = {} |
394 | @@ -1395,27 +1489,88 @@ | |||
395 | 1395 | if res2: | 1489 | if res2: |
396 | 1396 | domain = {'uos_id':[('category_id','=',res2 )]} | 1490 | domain = {'uos_id':[('category_id','=',res2 )]} |
397 | 1397 | 1491 | ||
417 | 1398 | res_final = {'value':result, 'domain':domain} | 1492 | res_final = {'value': result, 'domain': domain, 'warning': warning} |
399 | 1399 | |||
400 | 1400 | if not company_id or not currency_id: | ||
401 | 1401 | return res_final | ||
402 | 1402 | |||
403 | 1403 | company = self.pool.get('res.company').browse(cr, uid, company_id, context=context) | ||
404 | 1404 | currency = self.pool.get('res.currency').browse(cr, uid, currency_id, context=context) | ||
405 | 1405 | |||
406 | 1406 | if company.currency_id.id != currency.id: | ||
407 | 1407 | if type in ('in_invoice', 'in_refund'): | ||
408 | 1408 | res_final['value']['price_unit'] = res.standard_price | ||
409 | 1409 | new_price = res_final['value']['price_unit'] * currency.rate | ||
410 | 1410 | res_final['value']['price_unit'] = new_price | ||
411 | 1411 | |||
412 | 1412 | if uom: | ||
413 | 1413 | uom = self.pool.get('product.uom').browse(cr, uid, uom, context=context) | ||
414 | 1414 | if res.uom_id.category_id.id == uom.category_id.id: | ||
415 | 1415 | new_price = res_final['value']['price_unit'] * uom.factor_inv | ||
416 | 1416 | res_final['value']['price_unit'] = new_price | ||
418 | 1417 | return res_final | 1493 | return res_final |
419 | 1418 | 1494 | ||
420 | 1495 | def _price_unit_get( | ||
421 | 1496 | self, cr, uid, product_id, uom_id, qty, invoice_type, partner_id, | ||
422 | 1497 | currency_id, context=None): | ||
423 | 1498 | price_unit = False | ||
424 | 1499 | warning = {} | ||
425 | 1500 | standard_currency_id = currency_id | ||
426 | 1501 | partner_model = self.pool.get('res.partner') | ||
427 | 1502 | partner_obj = partner_model.browse( | ||
428 | 1503 | cr, uid, partner_id, context=context) | ||
429 | 1504 | assert partner_obj, _('No partner found for id %d') % partner_id | ||
430 | 1505 | if invoice_type in ('in_invoice', 'in_refund'): | ||
431 | 1506 | field = 'list_price' | ||
432 | 1507 | pricelist_property = 'property_product_pricelist_purchase' | ||
433 | 1508 | else: | ||
434 | 1509 | field = 'standard_price' | ||
435 | 1510 | pricelist_property = 'property_product_pricelist' | ||
436 | 1511 | if pricelist_property in partner_obj: | ||
437 | 1512 | pricelist_id = partner_obj[pricelist_property].id | ||
438 | 1513 | else: | ||
439 | 1514 | pricelist_id = False | ||
440 | 1515 | # Check whether standard price p.u. modified by pricelist | ||
441 | 1516 | if pricelist_id: | ||
442 | 1517 | pricelist_model = self.pool.get('product.pricelist') | ||
443 | 1518 | price_unit = pricelist_model.price_get( | ||
444 | 1519 | cr, uid, [pricelist_id], product_id, qty or 1.0, partner_id, | ||
445 | 1520 | {'uom': uom_id})[pricelist_id] | ||
446 | 1521 | if price_unit is False: # 0.0 is OK, we night have free products | ||
447 | 1522 | warning = { | ||
448 | 1523 | 'title': _('No valid pricelist line found!'), | ||
449 | 1524 | 'message': | ||
450 | 1525 | _("Couldn't find a pricelist line matching this product" | ||
451 | 1526 | " and quantity.\n" | ||
452 | 1527 | "You have to change either the product, the quantity or" | ||
453 | 1528 | " the pricelist.") | ||
454 | 1529 | } | ||
455 | 1530 | # Pricelist converts price from standard currency to pricelist | ||
456 | 1531 | # currency. We have to convert this to the invoice currency. | ||
457 | 1532 | # In practice that will often mean undoing the conversion | ||
458 | 1533 | # done by the pricelist object | ||
459 | 1534 | pricelist_obj = pricelist_model.browse(cr, uid, pricelist_id) | ||
460 | 1535 | if (pricelist_obj and pricelist_obj.currency_id and | ||
461 | 1536 | pricelist_obj.currency_id.id): | ||
462 | 1537 | standard_currency_id = pricelist_obj.currency_id.id | ||
463 | 1538 | else: | ||
464 | 1539 | # Take standard price per unit directly from product | ||
465 | 1540 | product_model = self.pool.get('product.product') | ||
466 | 1541 | product_obj = product_model.browse( | ||
467 | 1542 | cr, uid, product_id, context=context) | ||
468 | 1543 | assert product_obj, _('No product found for id %d') % product_id | ||
469 | 1544 | assert field in product_obj, _( | ||
470 | 1545 | 'Field %s not found in product') % field | ||
471 | 1546 | price_unit = product_obj[field] | ||
472 | 1547 | # If price_unit not taken from price-list, we still have to | ||
473 | 1548 | # take unit of measurement into account | ||
474 | 1549 | if uom_id: | ||
475 | 1550 | uom_model = self.pool.get('product.uom') | ||
476 | 1551 | uom_obj = uom_model.browse(cr, uid, uom_id) | ||
477 | 1552 | p_uom_category_id = product_obj.uom_id.category_id.id | ||
478 | 1553 | if p_uom_category_id == uom_obj.category_id.id: | ||
479 | 1554 | price_unit = price_unit * uom_obj.factor_inv | ||
480 | 1555 | # When price not taken from pricelist, the currency is | ||
481 | 1556 | # determined by the price_type: | ||
482 | 1557 | price_type_model = self.pool.get('product.price.type') | ||
483 | 1558 | price_type_ids = price_type_model.search( | ||
484 | 1559 | cr, uid, [('field', '=', field)]) | ||
485 | 1560 | if price_type_ids: | ||
486 | 1561 | price_type_obj = price_type_model.browse( | ||
487 | 1562 | cr, uid, price_type_ids[0]) | ||
488 | 1563 | if (price_type_obj and price_type_obj.currency_id and | ||
489 | 1564 | price_type_obj.currency_id.id): | ||
490 | 1565 | standard_currency_id = price_type_obj.currency_id.id | ||
491 | 1566 | # convert price_unit to currency of invoice | ||
492 | 1567 | if standard_currency_id != currency_id: | ||
493 | 1568 | currency_model = self.pool.get('res.currency') | ||
494 | 1569 | price_unit = currency_model.compute( | ||
495 | 1570 | cr, uid, standard_currency_id, currency_id, | ||
496 | 1571 | price_unit, round=True, context=context) | ||
497 | 1572 | return price_unit, warning | ||
498 | 1573 | |||
499 | 1419 | def uos_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None, company_id=None): | 1574 | def uos_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None, company_id=None): |
500 | 1420 | if context is None: | 1575 | if context is None: |
501 | 1421 | context = {} | 1576 | context = {} |
502 | @@ -1448,6 +1603,10 @@ | |||
503 | 1448 | inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context) | 1603 | inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context) |
504 | 1449 | company_currency = inv.company_id.currency_id.id | 1604 | company_currency = inv.company_id.currency_id.id |
505 | 1450 | 1605 | ||
506 | 1606 | local_context = { | ||
507 | 1607 | 'tax_calculation_rounding_method': | ||
508 | 1608 | inv.tax_calculation_rounding_method | ||
509 | 1609 | } | ||
510 | 1451 | for line in inv.invoice_line: | 1610 | for line in inv.invoice_line: |
511 | 1452 | mres = self.move_line_get_item(cr, uid, line, context) | 1611 | mres = self.move_line_get_item(cr, uid, line, context) |
512 | 1453 | if not mres: | 1612 | if not mres: |
513 | @@ -1457,7 +1616,7 @@ | |||
514 | 1457 | for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, | 1616 | for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, |
515 | 1458 | (line.price_unit * (1.0 - (line['discount'] or 0.0) / 100.0)), | 1617 | (line.price_unit * (1.0 - (line['discount'] or 0.0) / 100.0)), |
516 | 1459 | line.quantity, inv.address_invoice_id.id, line.product_id, | 1618 | line.quantity, inv.address_invoice_id.id, line.product_id, |
518 | 1460 | inv.partner_id)['taxes']: | 1619 | inv.partner_id, context=local_context)['taxes']: |
519 | 1461 | 1620 | ||
520 | 1462 | if inv.type in ('out_invoice', 'in_invoice'): | 1621 | if inv.type in ('out_invoice', 'in_invoice'): |
521 | 1463 | tax_code_id = tax['base_code_id'] | 1622 | tax_code_id = tax['base_code_id'] |
522 | @@ -1596,16 +1755,23 @@ | |||
523 | 1596 | cur = inv.currency_id | 1755 | cur = inv.currency_id |
524 | 1597 | company_currency = inv.company_id.currency_id.id | 1756 | company_currency = inv.company_id.currency_id.id |
525 | 1598 | 1757 | ||
526 | 1758 | local_context = { | ||
527 | 1759 | 'tax_calculation_rounding_method': | ||
528 | 1760 | inv.tax_calculation_rounding_method | ||
529 | 1761 | } | ||
530 | 1599 | for line in inv.invoice_line: | 1762 | for line in inv.invoice_line: |
533 | 1600 | for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, (line.price_unit* (1-(line.discount or 0.0)/100.0)), line.quantity, inv.address_invoice_id.id, line.product_id, inv.partner_id)['taxes']: | 1763 | for tax in tax_obj.compute_all( |
534 | 1601 | tax['price_unit'] = cur_obj.round(cr, uid, cur, tax['price_unit']) | 1764 | cr, uid, line.invoice_line_tax_id, |
535 | 1765 | (line.price_unit * (1 - (line.discount or 0.0) / 100.0)), | ||
536 | 1766 | line.quantity, inv.address_invoice_id.id, line.product_id, | ||
537 | 1767 | inv.partner_id, context=local_context)['taxes']: | ||
538 | 1602 | val={} | 1768 | val={} |
539 | 1603 | val['invoice_id'] = inv.id | 1769 | val['invoice_id'] = inv.id |
540 | 1604 | val['name'] = tax['name'] | 1770 | val['name'] = tax['name'] |
541 | 1605 | val['amount'] = tax['amount'] | 1771 | val['amount'] = tax['amount'] |
542 | 1606 | val['manual'] = False | 1772 | val['manual'] = False |
543 | 1607 | val['sequence'] = tax['sequence'] | 1773 | val['sequence'] = tax['sequence'] |
545 | 1608 | val['base'] = tax['price_unit'] * line['quantity'] | 1774 | val['base'] = cur_obj.round(cr, uid, cur, tax['price_unit'] * line['quantity']) |
546 | 1609 | 1775 | ||
547 | 1610 | if inv.type in ('out_invoice','in_invoice'): | 1776 | if inv.type in ('out_invoice','in_invoice'): |
548 | 1611 | val['base_code_id'] = tax['base_code_id'] | 1777 | val['base_code_id'] = tax['base_code_id'] |
549 | 1612 | 1778 | ||
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 | 168 | <field name="reference_type" nolabel="1" size="0"/> | 168 | <field name="reference_type" nolabel="1" size="0"/> |
555 | 169 | <field name="reference" nolabel="1"/> | 169 | <field name="reference" nolabel="1"/> |
556 | 170 | <field name="date_due"/> | 170 | <field name="date_due"/> |
557 | 171 | <field name="tax_calculation_rounding_method"/> | ||
558 | 171 | <field colspan="4" context="{'address_invoice_id': address_invoice_id, 'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False, 'type': type}" name="invoice_line" nolabel="1"> | 172 | <field colspan="4" context="{'address_invoice_id': address_invoice_id, 'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False, 'type': type}" name="invoice_line" nolabel="1"> |
559 | 172 | <tree string="Invoice lines"> | 173 | <tree string="Invoice lines"> |
560 | 173 | <field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, context, parent.company_id)"/> | 174 | <field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, context, parent.company_id)"/> |
561 | @@ -259,6 +260,9 @@ | |||
562 | 259 | <field name="journal_id" groups="base.group_user" on_change="onchange_journal_id(journal_id, context)" widget="selection"/> | 260 | <field name="journal_id" groups="base.group_user" on_change="onchange_journal_id(journal_id, context)" widget="selection"/> |
563 | 260 | <field name="number"/> | 261 | <field name="number"/> |
564 | 261 | <field name="type" invisible="1"/> | 262 | <field name="type" invisible="1"/> |
565 | 263 | <field | ||
566 | 264 | name="tax_calculation_rounding_method" | ||
567 | 265 | invisible="1" /> | ||
568 | 262 | <field name="currency_id" width="50"/> | 266 | <field name="currency_id" width="50"/> |
569 | 263 | <button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" groups="account.group_account_user"/> | 267 | <button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" groups="account.group_account_user"/> |
570 | 264 | <newline/> | 268 | <newline/> |
571 | @@ -292,7 +296,7 @@ | |||
572 | 292 | </group> | 296 | </group> |
573 | 293 | <group col="4" colspan="2"> | 297 | <group col="4" colspan="2"> |
574 | 294 | <group colspan="2" col="1"> | 298 | <group colspan="2" col="1"> |
576 | 295 | <button name="button_reset_taxes" states="draft,proforma2" string="Compute Taxes" type="object" groups="base.group_user" icon="terp-stock_format-scientific" help="This action will erase taxes"/> | 299 | <button name="button_reset_taxes" states="draft" string="Compute Taxes" type="object" groups="base.group_user" icon="terp-stock_format-scientific" help="This action will erase taxes"/> |
577 | 296 | </group> | 300 | </group> |
578 | 297 | <field name="amount_untaxed"/> | 301 | <field name="amount_untaxed"/> |
579 | 298 | <label string="" colspan="2"/> | 302 | <label string="" colspan="2"/> |
580 | 299 | 303 | ||
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 | 17 | <record id="act_proforma2" model="workflow.activity"> | 17 | <record id="act_proforma2" model="workflow.activity"> |
586 | 18 | <field name="wkf_id" ref="wkf"/> | 18 | <field name="wkf_id" ref="wkf"/> |
587 | 19 | <field name="name">proforma2</field> | 19 | <field name="name">proforma2</field> |
589 | 20 | <field name="action">write({'state':'proforma2'})</field> | 20 | <field name="action">action_proforma()</field> |
590 | 21 | <field name="kind">function</field> | 21 | <field name="kind">function</field> |
591 | 22 | </record> | 22 | </record> |
592 | 23 | 23 | ||
593 | 24 | 24 | ||
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 | 567 | cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'') | 567 | cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'') |
599 | 568 | if not cr.fetchone(): | 568 | if not cr.fetchone(): |
600 | 569 | cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)') | 569 | cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)') |
601 | 570 | cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('account_move_line_date_id_index',)) | ||
602 | 571 | if not cr.fetchone(): | ||
603 | 572 | cr.execute('CREATE INDEX account_move_line_date_id_index ON account_move_line (date DESC, id desc)') | ||
604 | 570 | 573 | ||
605 | 571 | def _check_no_view(self, cr, uid, ids, context=None): | 574 | def _check_no_view(self, cr, uid, ids, context=None): |
606 | 572 | lines = self.browse(cr, uid, ids, context=context) | 575 | lines = self.browse(cr, uid, ids, context=context) |
607 | 573 | 576 | ||
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 | 1703 | <filter string="Purchase" icon="terp-purchase" domain="[('journal_id.type', '=', 'purchase')]"/> | 1703 | <filter string="Purchase" icon="terp-purchase" domain="[('journal_id.type', '=', 'purchase')]"/> |
613 | 1704 | <separator orientation="vertical"/> | 1704 | <separator orientation="vertical"/> |
614 | 1705 | <field name="name"/> | 1705 | <field name="name"/> |
616 | 1706 | <field name="journal_id" widget="selection"/> | 1706 | <field name="journal_id" on_change="onchange_journal_id(journal_id)"/> |
617 | 1707 | <field name="company_id" widget="selection" groups="base.group_multi_company"/> | 1707 | <field name="company_id" widget="selection" groups="base.group_multi_company"/> |
618 | 1708 | </group> | 1708 | </group> |
619 | 1709 | <newline/> | 1709 | <newline/> |
620 | 1710 | 1710 | ||
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 | 24 | class res_company(osv.osv): | 24 | class res_company(osv.osv): |
626 | 25 | _inherit = "res.company" | 25 | _inherit = "res.company" |
627 | 26 | _columns = { | 26 | _columns = { |
628 | 27 | 'tax_calculation_rounding_method': fields.selection([ | ||
629 | 28 | ('round_per_line', 'Round per line'), | ||
630 | 29 | ('round_globally', 'Round globally'), | ||
631 | 30 | ], 'Tax calculation rounding method', | ||
632 | 31 | help="If you select 'Round per line' : for each tax, the tax amount will first be computed and rounded for each PO/SO/invoice line and then these rounded amounts will be summed, leading to the total amount for that tax. If you select 'Round globally': for each tax, the tax amount will be computed for each PO/SO/invoice line, then these amounts will be summed and eventually this total tax amount will be rounded. If you sell with tax included, you should choose 'Round per line' because you certainly want the sum of your tax-included line subtotals to be equal to the total amount with taxes."), | ||
633 | 27 | 'paypal_account': fields.char("Paypal Account", size=128, help="Paypal username (usually email) for receiving online payments."), | 32 | 'paypal_account': fields.char("Paypal Account", size=128, help="Paypal username (usually email) for receiving online payments."), |
634 | 28 | 'overdue_msg': fields.text('Overdue Payments Message', translate=True), | 33 | 'overdue_msg': fields.text('Overdue Payments Message', translate=True), |
635 | 29 | 'property_reserve_and_surplus_account': fields.property( | 34 | 'property_reserve_and_surplus_account': fields.property( |
636 | @@ -41,7 +46,8 @@ | |||
637 | 41 | has already been paid, please disregard this notice. However, if you have any | 46 | has already been paid, please disregard this notice. However, if you have any |
638 | 42 | queries regarding your account, please contact us. | 47 | queries regarding your account, please contact us. |
639 | 43 | Thank you in advance. | 48 | Thank you in advance. |
641 | 44 | ''' | 49 | ''', |
642 | 50 | 'tax_calculation_rounding_method': 'round_per_line', | ||
643 | 45 | } | 51 | } |
644 | 46 | 52 | ||
645 | 47 | res_company() | 53 | res_company() |
646 | 48 | 54 | ||
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 | 25 | <field name="currency_id" position="after"> | 25 | <field name="currency_id" position="after"> |
652 | 26 | <field name="property_reserve_and_surplus_account" colspan="2"/> | 26 | <field name="property_reserve_and_surplus_account" colspan="2"/> |
653 | 27 | <field name="paypal_account" /> | 27 | <field name="paypal_account" /> |
654 | 28 | <field name="tax_calculation_rounding_method" /> | ||
655 | 28 | </field> | 29 | </field> |
656 | 29 | </field> | 30 | </field> |
657 | 30 | </record> | 31 | </record> |
658 | 31 | 32 | ||
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 | 22 | <field name="name">Bank</field> | 22 | <field name="name">Bank</field> |
664 | 23 | <field name="code">bank</field> | 23 | <field name="code">bank</field> |
665 | 24 | <field name="close_method">balance</field> | 24 | <field name="close_method">balance</field> |
666 | 25 | <field name="report_type">asset</field> | ||
667 | 25 | </record> | 26 | </record> |
668 | 26 | <record model="account.account.type" id="data_account_type_cash"> | 27 | <record model="account.account.type" id="data_account_type_cash"> |
669 | 27 | <field name="name">Cash</field> | 28 | <field name="name">Cash</field> |
670 | 28 | 29 | ||
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 | 96 | <separator string="Supplier Debit" colspan="2"/> | 96 | <separator string="Supplier Debit" colspan="2"/> |
676 | 97 | <field name="debit"/> | 97 | <field name="debit"/> |
677 | 98 | </group> | 98 | </group> |
679 | 99 | <field colspan="4" context="{'address': address}" name="bank_ids" nolabel="1"> | 99 | <field colspan="4" context="{'address': address, 'default_partner_id': active_id}" name="bank_ids" nolabel="1"> |
680 | 100 | <form string="Bank account"> | 100 | <form string="Bank account"> |
681 | 101 | <field name="state"/> | 101 | <field name="state"/> |
682 | 102 | <newline/> | 102 | <newline/> |
683 | 103 | 103 | ||
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 | 75 | AND (account_account.type IN %s)\ | 75 | AND (account_account.type IN %s)\ |
689 | 76 | AND account_account.active\ | 76 | AND account_account.active\ |
690 | 77 | AND ((reconcile_id IS NULL)\ | 77 | AND ((reconcile_id IS NULL)\ |
692 | 78 | OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | 78 | OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
693 | 79 | AND (l.partner_id=res_partner.id)\ | 79 | AND (l.partner_id=res_partner.id)\ |
694 | 80 | AND (l.date <= %s)\ | 80 | AND (l.date <= %s)\ |
695 | 81 | AND ' + self.query + ' \ | 81 | AND ' + self.query + ' \ |
696 | @@ -99,7 +99,7 @@ | |||
697 | 99 | AND (account_account.type IN %s)\ | 99 | AND (account_account.type IN %s)\ |
698 | 100 | AND (l.partner_id IN %s)\ | 100 | AND (l.partner_id IN %s)\ |
699 | 101 | AND ((l.reconcile_id IS NULL)\ | 101 | AND ((l.reconcile_id IS NULL)\ |
701 | 102 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | 102 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
702 | 103 | AND ' + self.query + '\ | 103 | AND ' + self.query + '\ |
703 | 104 | AND account_account.active\ | 104 | AND account_account.active\ |
704 | 105 | AND (l.date <= %s)\ | 105 | AND (l.date <= %s)\ |
705 | @@ -119,7 +119,7 @@ | |||
706 | 119 | AND (COALESCE(l.date_maturity, l.date) < %s)\ | 119 | AND (COALESCE(l.date_maturity, l.date) < %s)\ |
707 | 120 | AND (l.partner_id IN %s)\ | 120 | AND (l.partner_id IN %s)\ |
708 | 121 | AND ((l.reconcile_id IS NULL)\ | 121 | AND ((l.reconcile_id IS NULL)\ |
710 | 122 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | 122 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
711 | 123 | AND '+ self.query + '\ | 123 | AND '+ self.query + '\ |
712 | 124 | AND account_account.active\ | 124 | AND account_account.active\ |
713 | 125 | AND (l.date <= %s)\ | 125 | AND (l.date <= %s)\ |
714 | @@ -136,7 +136,7 @@ | |||
715 | 136 | AND (COALESCE(l.date_maturity,l.date) > %s)\ | 136 | AND (COALESCE(l.date_maturity,l.date) > %s)\ |
716 | 137 | AND (l.partner_id IN %s)\ | 137 | AND (l.partner_id IN %s)\ |
717 | 138 | AND ((l.reconcile_id IS NULL)\ | 138 | AND ((l.reconcile_id IS NULL)\ |
719 | 139 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | 139 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
720 | 140 | AND '+ self.query + '\ | 140 | AND '+ self.query + '\ |
721 | 141 | AND account_account.active\ | 141 | AND account_account.active\ |
722 | 142 | AND (l.date <= %s)\ | 142 | AND (l.date <= %s)\ |
723 | @@ -168,7 +168,7 @@ | |||
724 | 168 | AND (account_account.type IN %s) | 168 | AND (account_account.type IN %s) |
725 | 169 | AND (l.partner_id IN %s) | 169 | AND (l.partner_id IN %s) |
726 | 170 | AND ((l.reconcile_id IS NULL) | 170 | AND ((l.reconcile_id IS NULL) |
728 | 171 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s ))) | 171 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval ))) |
729 | 172 | AND ''' + self.query + ''' | 172 | AND ''' + self.query + ''' |
730 | 173 | AND account_account.active | 173 | AND account_account.active |
731 | 174 | AND ''' + dates_query + ''' | 174 | AND ''' + dates_query + ''' |
732 | @@ -242,7 +242,7 @@ | |||
733 | 242 | AND (l.partner_id IS NULL)\ | 242 | AND (l.partner_id IS NULL)\ |
734 | 243 | AND (account_account.type IN %s)\ | 243 | AND (account_account.type IN %s)\ |
735 | 244 | AND ((l.reconcile_id IS NULL) \ | 244 | AND ((l.reconcile_id IS NULL) \ |
737 | 245 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | 245 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
738 | 246 | AND ' + self.query + '\ | 246 | AND ' + self.query + '\ |
739 | 247 | AND (l.date <= %s)\ | 247 | AND (l.date <= %s)\ |
740 | 248 | AND account_account.active ',(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,)) | 248 | AND account_account.active ',(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,)) |
741 | @@ -259,7 +259,7 @@ | |||
742 | 259 | AND (account_account.type IN %s)\ | 259 | AND (account_account.type IN %s)\ |
743 | 260 | AND (COALESCE(l.date_maturity, l.date) < %s)\ | 260 | AND (COALESCE(l.date_maturity, l.date) < %s)\ |
744 | 261 | AND ((l.reconcile_id IS NULL)\ | 261 | AND ((l.reconcile_id IS NULL)\ |
746 | 262 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | 262 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
747 | 263 | AND '+ self.query + '\ | 263 | AND '+ self.query + '\ |
748 | 264 | AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from)) | 264 | AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from)) |
749 | 265 | t = self.cr.fetchall() | 265 | t = self.cr.fetchall() |
750 | @@ -274,7 +274,7 @@ | |||
751 | 274 | AND (account_account.type IN %s)\ | 274 | AND (account_account.type IN %s)\ |
752 | 275 | AND (COALESCE(l.date_maturity,l.date) > %s)\ | 275 | AND (COALESCE(l.date_maturity,l.date) > %s)\ |
753 | 276 | AND ((l.reconcile_id IS NULL)\ | 276 | AND ((l.reconcile_id IS NULL)\ |
755 | 277 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | 277 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
756 | 278 | AND '+ self.query + '\ | 278 | AND '+ self.query + '\ |
757 | 279 | AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from)) | 279 | AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from)) |
758 | 280 | t = self.cr.fetchall() | 280 | t = self.cr.fetchall() |
759 | @@ -302,7 +302,7 @@ | |||
760 | 302 | AND (account_account.type IN %s)\ | 302 | AND (account_account.type IN %s)\ |
761 | 303 | AND (l.partner_id IS NULL)\ | 303 | AND (l.partner_id IS NULL)\ |
762 | 304 | AND ((l.reconcile_id IS NULL)\ | 304 | AND ((l.reconcile_id IS NULL)\ |
764 | 305 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | 305 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date >= %s::timestamp + \'1day\'::interval )))\ |
765 | 306 | AND '+ self.query + '\ | 306 | AND '+ self.query + '\ |
766 | 307 | AND account_account.active\ | 307 | AND account_account.active\ |
767 | 308 | AND ' + dates_query + '\ | 308 | AND ' + dates_query + '\ |
768 | 309 | 309 | ||
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 | 138 | <images/> | 138 | <images/> |
774 | 139 | </stylesheet> | 139 | </stylesheet> |
775 | 140 | <story> | 140 | <story> |
776 | 141 | <pto> | ||
777 | 142 | <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para> | 141 | <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para> |
778 | 143 | <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para> | 142 | <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para> |
779 | 144 | <pto_header><!-- Must be after setLang() --> | ||
780 | 145 | <blockTable colWidths="202.0,87.0,71.0,57.0,42.0,71.0" style="Table7"> | ||
781 | 146 | <tr> | ||
782 | 147 | <td> <para style="terp_tblheader_Details">Description</para> </td> | ||
783 | 148 | <td> <para style="terp_tblheader_Details_Centre">Taxes</para> </td> | ||
784 | 149 | <td> <para style="terp_tblheader_Details_Centre">Quantity</para> </td> | ||
785 | 150 | <td> <para style="terp_tblheader_Details_Right">Unit Price </para> </td> | ||
786 | 151 | <td> <para style="terp_tblheader_Details_Right">Disc.(%)</para> </td> | ||
787 | 152 | <td> <para style="terp_tblheader_Details_Right">Price</para> </td> | ||
788 | 153 | </tr> | ||
789 | 154 | </blockTable> | ||
790 | 155 | </pto_header> | ||
791 | 156 | <blockTable colWidths="297.0,233.0" style="Table_Partner_Address"> | 143 | <blockTable colWidths="297.0,233.0" style="Table_Partner_Address"> |
792 | 157 | <tr> | 144 | <tr> |
793 | 158 | <td> | 145 | <td> |
794 | @@ -217,6 +204,19 @@ | |||
795 | 217 | <para style="terp_default_8"> | 204 | <para style="terp_default_8"> |
796 | 218 | <font color="white"> </font> | 205 | <font color="white"> </font> |
797 | 219 | </para> | 206 | </para> |
798 | 207 | <pto> | ||
799 | 208 | <pto_header> | ||
800 | 209 | <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7"> | ||
801 | 210 | <tr> | ||
802 | 211 | <td> <para style="terp_tblheader_Details">Description</para> </td> | ||
803 | 212 | <td> <para style="terp_tblheader_Details_Centre">Taxes</para> </td> | ||
804 | 213 | <td> <para style="terp_tblheader_Details_Centre">Quantity</para> </td> | ||
805 | 214 | <td> <para style="terp_tblheader_Details_Right">Unit Price </para> </td> | ||
806 | 215 | <td> <para style="terp_tblheader_Details_Right">Disc.(%)</para> </td> | ||
807 | 216 | <td> <para style="terp_tblheader_Details_Right">Price</para> </td> | ||
808 | 217 | </tr> | ||
809 | 218 | </blockTable> | ||
810 | 219 | </pto_header> | ||
811 | 220 | <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7"> | 220 | <blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7"> |
812 | 221 | <tr> | 221 | <tr> |
813 | 222 | <td> | 222 | <td> |
814 | @@ -294,6 +294,7 @@ | |||
815 | 294 | </tr> | 294 | </tr> |
816 | 295 | </blockTable> | 295 | </blockTable> |
817 | 296 | </section> | 296 | </section> |
818 | 297 | </pto> | ||
819 | 297 | <blockTable colWidths="385.0,60.0,85.0" style="Table10"> | 298 | <blockTable colWidths="385.0,60.0,85.0" style="Table10"> |
820 | 298 | <tr> | 299 | <tr> |
821 | 299 | <td> | 300 | <td> |
822 | @@ -401,6 +402,5 @@ | |||
823 | 401 | <para style="terp_default_2"> | 402 | <para style="terp_default_2"> |
824 | 402 | <font color="white"> </font> | 403 | <font color="white"> </font> |
825 | 403 | </para> | 404 | </para> |
826 | 404 | </pto> | ||
827 | 405 | </story> | 405 | </story> |
828 | 406 | </document> | 406 | </document> |
829 | 407 | 407 | ||
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 | 419 | 419 | ||
835 | 420 | def init(self, cr): | 420 | def init(self, cr): |
836 | 421 | tools.sql.drop_view_if_exists(cr, 'account_analytic_analysis_summary_user') | 421 | tools.sql.drop_view_if_exists(cr, 'account_analytic_analysis_summary_user') |
870 | 422 | cr.execute('CREATE OR REPLACE VIEW account_analytic_analysis_summary_user AS (' \ | 422 | cr.execute('''CREATE OR REPLACE VIEW account_analytic_analysis_summary_user AS ( |
871 | 423 | 'SELECT ' \ | 423 | with mu as |
872 | 424 | '(u.account_id * u.max_user) + u."user" AS id, ' \ | 424 | (select max(id) as max_user from res_users) |
873 | 425 | 'u.account_id AS account_id, ' \ | 425 | , lu AS |
874 | 426 | 'u."user" AS "user", ' \ | 426 | (SELECT |
875 | 427 | 'COALESCE(SUM(l.unit_amount), 0.0) AS unit_amount ' \ | 427 | l.account_id AS account_id, |
876 | 428 | 'FROM ' \ | 428 | coalesce(l.user_id, 0) AS user_id, |
877 | 429 | '(SELECT ' \ | 429 | SUM(l.unit_amount) AS unit_amount |
878 | 430 | 'a.id AS account_id, ' \ | 430 | FROM account_analytic_line AS l, |
879 | 431 | 'u1.id AS "user", ' \ | 431 | account_analytic_journal AS j |
880 | 432 | 'MAX(u2.id) AS max_user ' \ | 432 | WHERE (j.type = 'general' ) and (j.id=l.journal_id) |
881 | 433 | 'FROM ' \ | 433 | GROUP BY l.account_id, l.user_id |
882 | 434 | 'res_users AS u1, ' \ | 434 | ) |
883 | 435 | 'res_users AS u2, ' \ | 435 | select (lu.account_id * mu.max_user) + lu.user_id as id, |
884 | 436 | 'account_analytic_account AS a ' \ | 436 | lu.account_id as account_id, |
885 | 437 | 'GROUP BY u1.id, a.id ' \ | 437 | lu.user_id as "user", |
886 | 438 | ') AS u ' \ | 438 | unit_amount |
887 | 439 | 'LEFT JOIN ' \ | 439 | from lu, mu)''') |
855 | 440 | '(SELECT ' \ | ||
856 | 441 | 'l.account_id AS account_id, ' \ | ||
857 | 442 | 'l.user_id AS "user", ' \ | ||
858 | 443 | 'SUM(l.unit_amount) AS unit_amount ' \ | ||
859 | 444 | 'FROM account_analytic_line AS l, ' \ | ||
860 | 445 | 'account_analytic_journal AS j ' \ | ||
861 | 446 | 'WHERE (j.type = \'general\') and (j.id=l.journal_id) ' \ | ||
862 | 447 | 'GROUP BY l.account_id, l.user_id ' \ | ||
863 | 448 | ') AS l ' | ||
864 | 449 | 'ON (' \ | ||
865 | 450 | 'u.account_id = l.account_id ' \ | ||
866 | 451 | 'AND u."user" = l."user"' \ | ||
867 | 452 | ') ' \ | ||
868 | 453 | 'GROUP BY u."user", u.account_id, u.max_user' \ | ||
869 | 454 | ')') | ||
888 | 455 | 440 | ||
889 | 456 | account_analytic_account_summary_user() | 441 | account_analytic_account_summary_user() |
890 | 457 | 442 | ||
891 | 458 | 443 | ||
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 | 23 | <field name="inherit_id" ref="account.view_move_form"/> | 23 | <field name="inherit_id" ref="account.view_move_form"/> |
897 | 24 | <field name="arch" type="xml"> | 24 | <field name="arch" type="xml"> |
898 | 25 | <xpath expr="/form/notebook/page/field[@name='line_id']/tree/field[@name='analytic_account_id']" position="replace"> | 25 | <xpath expr="/form/notebook/page/field[@name='line_id']/tree/field[@name='analytic_account_id']" position="replace"> |
900 | 26 | <field name="analytics_id" context="{'journal_id':journal_id}" groups="analytic.group_analytic_accounting"/> | 26 | <field name="analytics_id" context="{'journal_id':parent.journal_id}" groups="analytic.group_analytic_accounting"/> |
901 | 27 | </xpath> | 27 | </xpath> |
902 | 28 | <xpath expr="/form/notebook/page/field[@name='line_id']/form/notebook/page/group/field[@name='analytic_account_id']" position="replace"> | 28 | <xpath expr="/form/notebook/page/field[@name='line_id']/form/notebook/page/group/field[@name='analytic_account_id']" position="replace"> |
904 | 29 | <field name="analytics_id" context="{'journal_id':journal_id}" groups="analytic.group_analytic_accounting"/> | 29 | <field name="analytics_id" context="{'journal_id':parent.journal_id}" groups="analytic.group_analytic_accounting"/> |
905 | 30 | </xpath> | 30 | </xpath> |
906 | 31 | </field> | 31 | </field> |
907 | 32 | </record> | 32 | </record> |
908 | 33 | 33 | ||
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 | 38 | "depends": ["product", "purchase"], | 38 | "depends": ["product", "purchase"], |
914 | 39 | "category": "Hidden/Dependency", | 39 | "category": "Hidden/Dependency", |
915 | 40 | "init_xml": [], | 40 | "init_xml": [], |
917 | 41 | "demo_xml": [], | 41 | "demo_xml": ['account_anglo_saxon_demo.xml'], |
918 | 42 | "update_xml": ["product_view.xml",], | 42 | "update_xml": ["product_view.xml",], |
919 | 43 | "auto_install": False, | 43 | "auto_install": False, |
920 | 44 | "installable": True, | 44 | "installable": True, |
921 | 45 | 45 | ||
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 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
927 | 2 | <openerp> | ||
928 | 3 | <data> | ||
929 | 4 | |||
930 | 5 | <!-- | ||
931 | 6 | Create a stock input account in the minimal | ||
932 | 7 | chart of accounts | ||
933 | 8 | --> | ||
934 | 9 | |||
935 | 10 | <record id="stk_in" model="account.account"> | ||
936 | 11 | <field name="code">X12000</field> | ||
937 | 12 | <field name="name">Incoming Stocks - (test)</field> | ||
938 | 13 | <field ref="account.cas" name="parent_id"/> | ||
939 | 14 | <field name="type">other</field> | ||
940 | 15 | <field name="user_type" ref="account.data_account_type_asset"/> | ||
941 | 16 | </record> | ||
942 | 17 | |||
943 | 18 | <!-- | ||
944 | 19 | Set the input account to these products, purchased in | ||
945 | 20 | the tests in purchase_double_validation | ||
946 | 21 | --> | ||
947 | 22 | |||
948 | 23 | <record id="product.product_product_pc4" model="product.product"> | ||
949 | 24 | <field name="property_stock_account_input" | ||
950 | 25 | ref="stk_in" /> | ||
951 | 26 | </record> | ||
952 | 27 | |||
953 | 28 | <record id="product.product_product_hdd2" model="product.product"> | ||
954 | 29 | <field name="property_stock_account_input" | ||
955 | 30 | ref="stk_in" /> | ||
956 | 31 | </record> | ||
957 | 32 | |||
958 | 33 | </data> | ||
959 | 34 | </openerp> | ||
960 | 0 | 35 | ||
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 | 26 | _inherit = "purchase.order" | 26 | _inherit = "purchase.order" |
966 | 27 | _description = "Purchase Order" | 27 | _description = "Purchase Order" |
967 | 28 | 28 | ||
970 | 29 | def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None): | 29 | def _choose_account_from_po_line(self, cr, uid, order_line, context=None): |
971 | 30 | line = super(purchase_order, self)._prepare_inv_line(cr, uid, account_id, order_line, context=context) | 30 | account_id = super(purchase_order, self)._choose_account_from_po_line(cr, uid, order_line, context=context) |
972 | 31 | if order_line.product_id and not order_line.product_id.type == 'service': | 31 | if order_line.product_id and not order_line.product_id.type == 'service': |
973 | 32 | acc_id = order_line.product_id.property_stock_account_input and order_line.product_id.property_stock_account_input.id | 32 | acc_id = order_line.product_id.property_stock_account_input and order_line.product_id.property_stock_account_input.id |
974 | 33 | if not acc_id: | 33 | if not acc_id: |
975 | 34 | acc_id = order_line.product_id.categ_id.property_stock_account_input_categ and order_line.product_id.categ_id.property_stock_account_input_categ.id | 34 | acc_id = order_line.product_id.categ_id.property_stock_account_input_categ and order_line.product_id.categ_id.property_stock_account_input_categ.id |
977 | 35 | if acc_id: | 35 | if not acc_id: |
978 | 36 | raise osv.except_osv(_('Error !'), _('There is no stock input account defined for this product or category: "%s" (id:%d)') % (order_line.product_id.name, order_line.product_id.id,)) | ||
979 | 37 | else: | ||
980 | 36 | fpos = order_line.order_id.fiscal_position or False | 38 | fpos = order_line.order_id.fiscal_position or False |
985 | 37 | new_account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, acc_id) | 39 | account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, acc_id) |
986 | 38 | line.update({'account_id': new_account_id}) | 40 | return account_id |
983 | 39 | return line | ||
984 | 40 | purchase_order() | ||
987 | 41 | 41 | ||
988 | 42 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 42 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
989 | 43 | 43 | ||
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 | 57 | 'partner_id': line.invoice_id.partner_id.id, | 57 | 'partner_id': line.invoice_id.partner_id.id, |
995 | 58 | 'company_id': line.invoice_id.company_id.id, | 58 | 'company_id': line.invoice_id.company_id.id, |
996 | 59 | 'currency_id': line.invoice_id.currency_id.id, | 59 | 'currency_id': line.invoice_id.currency_id.id, |
997 | 60 | 'purchase_date' : line.invoice_id.date_invoice, | ||
998 | 60 | } | 61 | } |
999 | 61 | changed_vals = asset_obj.onchange_category_id(cr, uid, [], vals['category_id'], context=context) | 62 | changed_vals = asset_obj.onchange_category_id(cr, uid, [], vals['category_id'], context=context) |
1000 | 62 | vals.update(changed_vals['value']) | 63 | vals.update(changed_vals['value']) |
1001 | 63 | 64 | ||
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 | 113 | result = 0.0 | 113 | result = 0.0 |
1007 | 114 | if context is None: | 114 | if context is None: |
1008 | 115 | context = {} | 115 | context = {} |
1009 | 116 | account_obj = self.pool.get('account.account') | ||
1010 | 116 | for line in self.browse(cr, uid, ids, context=context): | 117 | for line in self.browse(cr, uid, ids, context=context): |
1011 | 117 | acc_ids = [x.id for x in line.general_budget_id.account_ids] | 118 | acc_ids = [x.id for x in line.general_budget_id.account_ids] |
1012 | 119 | acc_ids = account_obj._get_children_and_consol(cr, uid, acc_ids, context=context) | ||
1013 | 118 | if not acc_ids: | 120 | if not acc_ids: |
1014 | 119 | raise osv.except_osv(_('Error!'),_("The Budget '%s' has no accounts!") % str(line.general_budget_id.name)) | 121 | raise osv.except_osv(_('Error!'),_("The Budget '%s' has no accounts!") % str(line.general_budget_id.name)) |
1015 | 120 | date_to = line.date_to | 122 | date_to = line.date_to |
1016 | @@ -124,7 +126,21 @@ | |||
1017 | 124 | if context.has_key('wizard_date_to'): | 126 | if context.has_key('wizard_date_to'): |
1018 | 125 | date_to = context['wizard_date_to'] | 127 | date_to = context['wizard_date_to'] |
1019 | 126 | if line.analytic_account_id.id: | 128 | if line.analytic_account_id.id: |
1021 | 127 | cr.execute("SELECT SUM(amount) FROM account_analytic_line WHERE account_id=%s AND (date " | 129 | cr.execute("SELECT SUM(amount) FROM account_analytic_line WHERE account_id in " |
1022 | 130 | """(with recursive account_analytic_account_hierarchy(id) | ||
1023 | 131 | as | ||
1024 | 132 | ( | ||
1025 | 133 | select id from account_analytic_account | ||
1026 | 134 | where id=%s | ||
1027 | 135 | union all | ||
1028 | 136 | select account_analytic_account.id from | ||
1029 | 137 | account_analytic_account | ||
1030 | 138 | join account_analytic_account_hierarchy | ||
1031 | 139 | on account_analytic_account.parent_id= | ||
1032 | 140 | account_analytic_account_hierarchy.id | ||
1033 | 141 | )""" | ||
1034 | 142 | "select id from account_analytic_account_hierarchy) " | ||
1035 | 143 | "AND (date " | ||
1036 | 128 | "between to_date(%s,'yyyy-mm-dd') AND to_date(%s,'yyyy-mm-dd')) AND " | 144 | "between to_date(%s,'yyyy-mm-dd') AND to_date(%s,'yyyy-mm-dd')) AND " |
1037 | 129 | "general_account_id=ANY(%s)", (line.analytic_account_id.id, date_from, date_to,acc_ids,)) | 145 | "general_account_id=ANY(%s)", (line.analytic_account_id.id, date_from, date_to,acc_ids,)) |
1038 | 130 | result = cr.fetchone()[0] | 146 | result = cr.fetchone()[0] |
1039 | 131 | 147 | ||
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 | 51 | if not args: | 51 | if not args: |
1045 | 52 | return [] | 52 | return [] |
1046 | 53 | line_obj = self.pool.get('account.move.line') | 53 | line_obj = self.pool.get('account.move.line') |
1048 | 54 | query = line_obj._query_get(cr, uid, context={}) | 54 | query = line_obj._query_get(cr, uid, context=context) |
1049 | 55 | where = ' and '.join(map(lambda x: '''(SELECT | 55 | where = ' and '.join(map(lambda x: '''(SELECT |
1050 | 56 | CASE WHEN l.amount_currency < 0 | 56 | CASE WHEN l.amount_currency < 0 |
1051 | 57 | THEN - l.amount_currency | 57 | THEN - l.amount_currency |
1052 | @@ -117,4 +117,4 @@ | |||
1053 | 117 | 117 | ||
1054 | 118 | account_move_line() | 118 | account_move_line() |
1055 | 119 | 119 | ||
1056 | 120 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
1057 | 121 | \ No newline at end of file | 120 | \ No newline at end of file |
1058 | 121 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
1059 | 122 | 122 | ||
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 | 107 | <field name="user_id"/> | 107 | <field name="user_id"/> |
1065 | 108 | <field name="date_prefered"/> | 108 | <field name="date_prefered"/> |
1066 | 109 | <field name="date_scheduled" select="1" attrs="{'readonly':[('date_prefered','!=','fixed')]}" /> | 109 | <field name="date_scheduled" select="1" attrs="{'readonly':[('date_prefered','!=','fixed')]}" /> |
1068 | 110 | <button colspan="2" name="%(action_create_payment_order)d" string="Select Invoices to Pay" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/> | 110 | <button colspan="2" name="%(action_create_payment_order)d" string="Select Invoices to Pay" type="action" attrs="{'invisible':[('state','=','done')]}" context="{'all_fiscalyear': True}" icon="gtk-find"/> |
1069 | 111 | <field name="company_id" widget='selection' groups="base.group_multi_company"/> | 111 | <field name="company_id" widget='selection' groups="base.group_multi_company"/> |
1070 | 112 | </group> | 112 | </group> |
1071 | 113 | <field name="line_ids" colspan="4" widget="one2many_list" nolabel="1" context="{'order_id': active_id or False}" > | 113 | <field name="line_ids" colspan="4" widget="one2many_list" nolabel="1" context="{'order_id': active_id or False}" > |
1072 | 114 | 114 | ||
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 | 263 | if name: | 263 | if name: |
1078 | 264 | account = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context) | 264 | account = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context) |
1079 | 265 | if not account: | 265 | if not account: |
1092 | 266 | names=map(lambda i : i.strip(),name.split('/')) | 266 | dom = [] |
1093 | 267 | for i in range(len(names)): | 267 | for name2 in map(lambda i : i.strip(),name.split('/')): |
1094 | 268 | dom=[('name', operator, names[i])] | 268 | account = self.search( |
1095 | 269 | if i>0: | 269 | cr, uid, |
1096 | 270 | dom+=[('id','child_of',account)] | 270 | dom + [('name', 'ilike', name2)] + args, |
1097 | 271 | account = self.search(cr, uid, dom, limit=limit, context=context) | 271 | limit=limit, context=context) |
1098 | 272 | newacc = account | 272 | if not account: |
1099 | 273 | while newacc: | 273 | break |
1100 | 274 | newacc = self.search(cr, uid, [('parent_id', 'in', newacc)], limit=limit, context=context) | 274 | dom = [('parent_id','in',account)] |
1089 | 275 | account += newacc | ||
1090 | 276 | if args: | ||
1091 | 277 | account = self.search(cr, uid, [('id', 'in', account)] + args, limit=limit, context=context) | ||
1101 | 278 | else: | 275 | else: |
1102 | 279 | account = self.search(cr, uid, args, limit=limit, context=context) | 276 | account = self.search(cr, uid, args, limit=limit, context=context) |
1103 | 280 | return self.name_get(cr, uid, account, context=context) | 277 | return self.name_get(cr, uid, account, context=context) |
1104 | 281 | 278 | ||
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 | 173 | class audittrail_objects_proxy(object_proxy): | 173 | class audittrail_objects_proxy(object_proxy): |
1110 | 174 | """ Uses Object proxy for auditing changes on object of subscribed Rules""" | 174 | """ Uses Object proxy for auditing changes on object of subscribed Rules""" |
1111 | 175 | 175 | ||
1112 | 176 | _default_recursive_level = 1 | ||
1113 | 177 | "Columns to be filtered from audited fields" | ||
1114 | 178 | __filtered_columns = ('__last_update', 'id') | ||
1115 | 179 | |||
1116 | 176 | def get_value_text(self, cr, uid, pool, resource_pool, method, field, value): | 180 | def get_value_text(self, cr, uid, pool, resource_pool, method, field, value): |
1117 | 177 | """ | 181 | """ |
1118 | 178 | Gets textual values for the fields. | 182 | Gets textual values for the fields. |
1119 | @@ -300,7 +304,7 @@ | |||
1120 | 300 | self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list) | 304 | self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list) |
1121 | 301 | return res | 305 | return res |
1122 | 302 | 306 | ||
1124 | 303 | def get_data(self, cr, uid, pool, res_ids, model, method): | 307 | def get_data(self, cr, uid, pool, res_ids, model, method, recursive_level=None): |
1125 | 304 | """ | 308 | """ |
1126 | 305 | This function simply read all the fields of the given res_ids, and also recurisvely on | 309 | This function simply read all the fields of the given res_ids, and also recurisvely on |
1127 | 306 | all records of a x2m fields read that need to be logged. Then it returns the result in | 310 | all records of a x2m fields read that need to be logged. Then it returns the result in |
1128 | @@ -319,6 +323,8 @@ | |||
1129 | 319 | }, | 323 | }, |
1130 | 320 | } | 324 | } |
1131 | 321 | """ | 325 | """ |
1132 | 326 | if recursive_level is None: | ||
1133 | 327 | recursive_level = self._default_recursive_level | ||
1134 | 322 | data = {} | 328 | data = {} |
1135 | 323 | resource_pool = pool.get(model.model) | 329 | resource_pool = pool.get(model.model) |
1136 | 324 | # read all the fields of the given resources in super admin mode | 330 | # read all the fields of the given resources in super admin mode |
1137 | @@ -328,14 +334,14 @@ | |||
1138 | 328 | resource_id = resource['id'] | 334 | resource_id = resource['id'] |
1139 | 329 | # loop on each field on the res_ids we just have read | 335 | # loop on each field on the res_ids we just have read |
1140 | 330 | for field in resource: | 336 | for field in resource: |
1142 | 331 | if field in ('__last_update', 'id'): | 337 | if field in self.__filtered_columns: |
1143 | 332 | continue | 338 | continue |
1144 | 333 | values[field] = resource[field] | 339 | values[field] = resource[field] |
1145 | 334 | # get the textual value of that field for this record | 340 | # get the textual value of that field for this record |
1146 | 335 | values_text[field] = self.get_value_text(cr, 1, pool, resource_pool, method, field, resource[field]) | 341 | values_text[field] = self.get_value_text(cr, 1, pool, resource_pool, method, field, resource[field]) |
1147 | 336 | 342 | ||
1148 | 337 | field_obj = resource_pool._all_columns.get(field).column | 343 | field_obj = resource_pool._all_columns.get(field).column |
1150 | 338 | if field_obj._type in ('one2many','many2many'): | 344 | if field_obj._type in ('one2many','many2many') and recursive_level: |
1151 | 339 | # check if an audittrail rule apply in super admin mode | 345 | # check if an audittrail rule apply in super admin mode |
1152 | 340 | if self.check_rules(cr, 1, field_obj._obj, method): | 346 | if self.check_rules(cr, 1, field_obj._obj, method): |
1153 | 341 | # check if the model associated to a *2m field exists, in super admin mode | 347 | # check if the model associated to a *2m field exists, in super admin mode |
1154 | @@ -344,11 +350,11 @@ | |||
1155 | 344 | assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj)) | 350 | assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj)) |
1156 | 345 | x2m_model = pool.get('ir.model').browse(cr, 1, x2m_model_id) | 351 | x2m_model = pool.get('ir.model').browse(cr, 1, x2m_model_id) |
1157 | 346 | #recursive call on x2m fields that need to be checked too | 352 | #recursive call on x2m fields that need to be checked too |
1159 | 347 | data.update(self.get_data(cr, 1, pool, resource[field], x2m_model, method)) | 353 | data.update(self.get_data(cr, 1, pool, resource[field], x2m_model, method, recursive_level - 1)) |
1160 | 348 | data[(model.id, resource_id)] = {'text':values_text, 'value': values} | 354 | data[(model.id, resource_id)] = {'text':values_text, 'value': values} |
1161 | 349 | return data | 355 | return data |
1162 | 350 | 356 | ||
1164 | 351 | def prepare_audittrail_log_line(self, cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=[]): | 357 | def prepare_audittrail_log_line(self, cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=[], recursive_level=None): |
1165 | 352 | """ | 358 | """ |
1166 | 353 | This function compares the old data (i.e before the method was executed) and the new data | 359 | This function compares the old data (i.e before the method was executed) and the new data |
1167 | 354 | (after the method was executed) and returns a structure with all the needed information to | 360 | (after the method was executed) and returns a structure with all the needed information to |
1168 | @@ -378,6 +384,8 @@ | |||
1169 | 378 | record (res.partner, for example), we may have to log a change done in a x2many field (on | 384 | record (res.partner, for example), we may have to log a change done in a x2many field (on |
1170 | 379 | res.partner.address, for example) | 385 | res.partner.address, for example) |
1171 | 380 | """ | 386 | """ |
1172 | 387 | if recursive_level is None: | ||
1173 | 388 | recursive_level = self._default_recursive_level | ||
1174 | 381 | key = (model.id, resource_id) | 389 | key = (model.id, resource_id) |
1175 | 382 | lines = { | 390 | lines = { |
1176 | 383 | key: [] | 391 | key: [] |
1177 | @@ -385,10 +393,10 @@ | |||
1178 | 385 | # loop on all the fields | 393 | # loop on all the fields |
1179 | 386 | for field_name, field_definition in pool.get(model.model)._all_columns.items(): | 394 | for field_name, field_definition in pool.get(model.model)._all_columns.items(): |
1180 | 387 | #if the field_list param is given, skip all the fields not in that list | 395 | #if the field_list param is given, skip all the fields not in that list |
1182 | 388 | if field_list and field_name not in field_list: | 396 | if field_list and field_name not in field_list or field_name in self.__filtered_columns: |
1183 | 389 | continue | 397 | continue |
1184 | 390 | field_obj = field_definition.column | 398 | field_obj = field_definition.column |
1186 | 391 | if field_obj._type in ('one2many','many2many'): | 399 | if field_obj._type in ('one2many','many2many') and recursive_level: |
1187 | 392 | # checking if an audittrail rule apply in super admin mode | 400 | # checking if an audittrail rule apply in super admin mode |
1188 | 393 | if self.check_rules(cr, 1, field_obj._obj, method): | 401 | if self.check_rules(cr, 1, field_obj._obj, method): |
1189 | 394 | # checking if the model associated to a *2m field exists, in super admin mode | 402 | # checking if the model associated to a *2m field exists, in super admin mode |
1190 | @@ -403,7 +411,7 @@ | |||
1191 | 403 | # We use list(set(...)) to remove duplicates. | 411 | # We use list(set(...)) to remove duplicates. |
1192 | 404 | res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids)) | 412 | res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids)) |
1193 | 405 | for res_id in res_ids: | 413 | for res_id in res_ids: |
1195 | 406 | lines.update(self.prepare_audittrail_log_line(cr, 1, pool, x2m_model, res_id, method, old_values, new_values, field_list)) | 414 | lines.update(self.prepare_audittrail_log_line(cr, 1, pool, x2m_model, res_id, method, old_values, new_values, field_list, recursive_level=recursive_level - 1)) |
1196 | 407 | # if the value value is different than the old value: record the change | 415 | # if the value value is different than the old value: record the change |
1197 | 408 | if key not in old_values or key not in new_values or old_values[key]['value'][field_name] != new_values[key]['value'][field_name]: | 416 | if key not in old_values or key not in new_values or old_values[key]['value'][field_name] != new_values[key]['value'][field_name]: |
1198 | 409 | data = { | 417 | data = { |
1199 | 410 | 418 | ||
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 | 20 | ############################################################################## | 20 | ############################################################################## |
1205 | 21 | 21 | ||
1206 | 22 | from osv import fields, osv, orm | 22 | from osv import fields, osv, orm |
1207 | 23 | from openerp import SUPERUSER_ID | ||
1208 | 23 | from tools.translate import _ | 24 | from tools.translate import _ |
1209 | 24 | from datetime import datetime | 25 | from datetime import datetime |
1210 | 25 | from datetime import timedelta | 26 | from datetime import timedelta |
1211 | @@ -202,11 +203,13 @@ | |||
1212 | 202 | return True | 203 | return True |
1213 | 203 | return wrapper | 204 | return wrapper |
1214 | 204 | 205 | ||
1216 | 205 | def _register_hook(self, cr, uid, ids, context=None): | 206 | def _register_hook(self, cr, uid=SUPERUSER_ID, ids=None, context=None): |
1217 | 206 | """ | 207 | """ |
1218 | 207 | Wrap every `create` and `write` methods of the models specified by | 208 | Wrap every `create` and `write` methods of the models specified by |
1219 | 208 | the rules (given by `ids`). | 209 | the rules (given by `ids`). |
1220 | 209 | """ | 210 | """ |
1221 | 211 | if ids == [] or ids is None: | ||
1222 | 212 | ids = self.search(cr, uid, []) | ||
1223 | 210 | for action_rule in self.browse(cr, uid, ids, context=context): | 213 | for action_rule in self.browse(cr, uid, ids, context=context): |
1224 | 211 | model = action_rule.model_id.model | 214 | model = action_rule.model_id.model |
1225 | 212 | obj_pool = self.pool.get(model) | 215 | obj_pool = self.pool.get(model) |
1226 | 213 | 216 | ||
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 | 30 | import re | 30 | import re |
1232 | 31 | import time | 31 | import time |
1233 | 32 | import tools | 32 | import tools |
1234 | 33 | from operator import itemgetter | ||
1235 | 33 | 34 | ||
1236 | 34 | months = { | 35 | months = { |
1237 | 35 | 1: "January", 2: "February", 3: "March", 4: "April", \ | 36 | 1: "January", 2: "February", 3: "March", 4: "April", \ |
1238 | @@ -85,7 +86,10 @@ | |||
1239 | 85 | return (int(real_id), real_date, end.strftime("%Y-%m-%d %H:%M:%S")) | 86 | return (int(real_id), real_date, end.strftime("%Y-%m-%d %H:%M:%S")) |
1240 | 86 | return int(real_id) | 87 | return int(real_id) |
1241 | 87 | 88 | ||
1243 | 88 | return base_calendar_id and int(base_calendar_id) or base_calendar_id | 89 | return int(base_calendar_id) |
1244 | 90 | |||
1245 | 91 | return base_calendar_id | ||
1246 | 92 | |||
1247 | 89 | 93 | ||
1248 | 90 | def real_id2base_calendar_id(real_id, recurrent_date): | 94 | def real_id2base_calendar_id(real_id, recurrent_date): |
1249 | 91 | """ | 95 | """ |
1250 | @@ -1303,6 +1307,18 @@ | |||
1251 | 1303 | res.append(base_calendar_id2real_id(id)) | 1307 | res.append(base_calendar_id2real_id(id)) |
1252 | 1304 | return res | 1308 | return res |
1253 | 1305 | 1309 | ||
1254 | 1310 | def _multikeysort(self, items, columns): | ||
1255 | 1311 | |||
1256 | 1312 | comparers = [ ((itemgetter(col[1:].strip()), -1) if col.startswith('-') else (itemgetter(col.strip()), 1)) for col in columns] | ||
1257 | 1313 | def comparer(left, right): | ||
1258 | 1314 | for fn, mult in comparers: | ||
1259 | 1315 | result = cmp(fn(left), fn(right)) | ||
1260 | 1316 | if result: | ||
1261 | 1317 | return mult * result | ||
1262 | 1318 | else: | ||
1263 | 1319 | return 0 | ||
1264 | 1320 | return sorted(items, cmp=comparer) | ||
1265 | 1321 | |||
1266 | 1306 | def search(self, cr, uid, args, offset=0, limit=0, order=None, context=None, count=False): | 1322 | def search(self, cr, uid, args, offset=0, limit=0, order=None, context=None, count=False): |
1267 | 1307 | context = context or {} | 1323 | context = context or {} |
1268 | 1308 | args_without_date = [] | 1324 | args_without_date = [] |
1269 | @@ -1327,6 +1343,16 @@ | |||
1270 | 1327 | 0, 0, order, context, count=False) | 1343 | 0, 0, order, context, count=False) |
1271 | 1328 | if context.get('virtual_id', True): | 1344 | if context.get('virtual_id', True): |
1272 | 1329 | res = self.get_recurrent_ids(cr, uid, res, args, limit, context=context) | 1345 | res = self.get_recurrent_ids(cr, uid, res, args, limit, context=context) |
1273 | 1346 | if order: | ||
1274 | 1347 | order = order.split(',') | ||
1275 | 1348 | sortby = {} | ||
1276 | 1349 | for o in order: | ||
1277 | 1350 | spl = o.split() | ||
1278 | 1351 | sortby[spl[0]] = spl[1] | ||
1279 | 1352 | fields = sortby.keys() | ||
1280 | 1353 | ordered = self.read(cr, uid, res, fields=fields, context=context) | ||
1281 | 1354 | res = self._multikeysort(ordered, [key.split()[0] if sortby[key.split()[0]] == 'ASC' else '-%s' % key.split()[0] for key in order]) | ||
1282 | 1355 | res = [x['id'] for x in res] | ||
1283 | 1330 | 1356 | ||
1284 | 1331 | if count: | 1357 | if count: |
1285 | 1332 | return len(res) | 1358 | return len(res) |
1286 | 1333 | 1359 | ||
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 | 93 | return bool(value == 1) | 93 | return bool(value == 1) |
1292 | 94 | 94 | ||
1293 | 95 | exists = table_exists(self._table) | 95 | exists = table_exists(self._table) |
1295 | 96 | super(res_partner_contact, self)._auto_init(cr, context) | 96 | result = super(res_partner_contact, self)._auto_init(cr, context) |
1296 | 97 | 97 | ||
1297 | 98 | if not exists: | 98 | if not exists: |
1298 | 99 | cr.execute(""" | 99 | cr.execute(""" |
1299 | @@ -108,6 +108,8 @@ | |||
1300 | 108 | cr.execute("update res_partner_address set contact_id=id") | 108 | cr.execute("update res_partner_address set contact_id=id") |
1301 | 109 | cr.execute("select setval('res_partner_contact_id_seq', (select max(id)+1 from res_partner_contact))") | 109 | cr.execute("select setval('res_partner_contact_id_seq', (select max(id)+1 from res_partner_contact))") |
1302 | 110 | 110 | ||
1303 | 111 | return result | ||
1304 | 112 | |||
1305 | 111 | res_partner_contact() | 113 | res_partner_contact() |
1306 | 112 | 114 | ||
1307 | 113 | class res_partner_location(osv.osv): | 115 | class res_partner_location(osv.osv): |
1308 | 114 | 116 | ||
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 | 483 | <field name="partner_address_id" | 483 | <field name="partner_address_id" |
1314 | 484 | string="Contact" | 484 | string="Contact" |
1315 | 485 | on_change="onchange_partner_address_id(partner_address_id, email_from)" | 485 | on_change="onchange_partner_address_id(partner_address_id, email_from)" |
1316 | 486 | options='{"quick_create": false}' | ||
1317 | 487 | context="{'default_partner_id':partner_id}" | ||
1318 | 486 | colspan="1" /> | 488 | colspan="1" /> |
1319 | 487 | <group col="3" colspan="2"> | 489 | <group col="3" colspan="2"> |
1320 | 488 | <field name="email_from" string="Email" /> | 490 | <field name="email_from" string="Email" /> |
1321 | 489 | 491 | ||
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 | 62 | on_change="onchange_partner_id(partner_id)" /> | 62 | on_change="onchange_partner_id(partner_id)" /> |
1327 | 63 | <field name="partner_address_id" | 63 | <field name="partner_address_id" |
1328 | 64 | string="Contact" | 64 | string="Contact" |
1330 | 65 | on_change="onchange_partner_address_id(partner_address_id, email_from)" /> | 65 | on_change="onchange_partner_address_id(partner_address_id, email_from)" |
1331 | 66 | options='{"quick_create": false}' | ||
1332 | 67 | context="{'default_partner_id':partner_id}" /> | ||
1333 | 66 | <field name="email_from"/> | 68 | <field name="email_from"/> |
1334 | 67 | </group><group col="2" colspan="2"> | 69 | </group><group col="2" colspan="2"> |
1335 | 68 | <separator colspan="2" string="Visibility"/> | 70 | <separator colspan="2" string="Visibility"/> |
1336 | 69 | 71 | ||
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 | 92 | groups="base.group_partner_manager"/> | 92 | groups="base.group_partner_manager"/> |
1342 | 93 | <newline/> | 93 | <newline/> |
1343 | 94 | <field name="partner_address_id" | 94 | <field name="partner_address_id" |
1345 | 95 | on_change="onchange_partner_address_id(partner_address_id)" /> | 95 | on_change="onchange_partner_address_id(partner_address_id)" |
1346 | 96 | options='{"quick_create": false}' | ||
1347 | 97 | context="{'default_partner_id':partner_id}" /> | ||
1348 | 96 | <newline/> | 98 | <newline/> |
1349 | 97 | <field name="partner_mobile" /> | 99 | <field name="partner_mobile" /> |
1350 | 98 | </group> | 100 | </group> |
1351 | 99 | 101 | ||
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 | 91 | <field name="partner_id" string="Partner" | 91 | <field name="partner_id" string="Partner" |
1357 | 92 | on_change="onchange_partner_id(partner_id)" /> | 92 | on_change="onchange_partner_id(partner_id)" /> |
1358 | 93 | <field name="partner_address_id" string="Contact" | 93 | <field name="partner_address_id" string="Contact" |
1360 | 94 | on_change="onchange_partner_address_id(partner_address_id, email_from)" /> | 94 | on_change="onchange_partner_address_id(partner_address_id, email_from)" |
1361 | 95 | options='{"quick_create": false}' | ||
1362 | 96 | context="{'default_partner_id':partner_id}" /> | ||
1363 | 95 | <field name="partner_phone"/> | 97 | <field name="partner_phone"/> |
1364 | 96 | <field name="email_from" widget="email"/> | 98 | <field name="email_from" widget="email"/> |
1365 | 97 | </group> | 99 | </group> |
1366 | 98 | 100 | ||
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 | 97 | <field name="partner_address_id" | 97 | <field name="partner_address_id" |
1372 | 98 | string="Contact" | 98 | string="Contact" |
1373 | 99 | on_change="onchange_partner_address_id(partner_address_id, email_from)" | 99 | on_change="onchange_partner_address_id(partner_address_id, email_from)" |
1374 | 100 | options='{"quick_create": false}' | ||
1375 | 101 | context="{'default_partner_id':partner_id}" | ||
1376 | 100 | colspan="1" /> | 102 | colspan="1" /> |
1377 | 101 | <field name="email_from" colspan="2"/> | 103 | <field name="email_from" colspan="2"/> |
1378 | 102 | </group> | 104 | </group> |
1379 | 103 | 105 | ||
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 | 49 | select="1" /> | 49 | select="1" /> |
1385 | 50 | <field name="partner_address_id" colspan="2" | 50 | <field name="partner_address_id" colspan="2" |
1386 | 51 | on_change="onchange_partner_address_id(partner_address_id, email_from)" | 51 | on_change="onchange_partner_address_id(partner_address_id, email_from)" |
1388 | 52 | /> | 52 | options='{"quick_create": false}' |
1389 | 53 | context="{'default_partner_id':partner_id}" /> | ||
1390 | 53 | <newline/> | 54 | <newline/> |
1391 | 54 | <field name="email_from" colspan="2"/> | 55 | <field name="email_from" colspan="2"/> |
1392 | 55 | <button name="remind_partner" | 56 | <button name="remind_partner" |
1393 | 56 | 57 | ||
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 | 46 | 'demo_xml': ['delivery_demo.xml'], | 46 | 'demo_xml': ['delivery_demo.xml'], |
1399 | 47 | 'test': [ | 47 | 'test': [ |
1400 | 48 | 'test/delivery_cost.yml', | 48 | 'test/delivery_cost.yml', |
1401 | 49 | 'test/delivery_chained_pickings.yml', | ||
1402 | 49 | ], | 50 | ], |
1403 | 50 | 'installable': True, | 51 | 'installable': True, |
1404 | 51 | 'auto_install': False, | 52 | 'auto_install': False, |
1405 | 52 | 53 | ||
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 | 75 | :param browse_record picking: the stock picking being invoiced | 75 | :param browse_record picking: the stock picking being invoiced |
1411 | 76 | :param browse_record invoice: the stock picking's invoice | 76 | :param browse_record invoice: the stock picking's invoice |
1412 | 77 | :return: dict containing the values to create the invoice line, | 77 | :return: dict containing the values to create the invoice line, |
1414 | 78 | or None to create nothing | 78 | or None to create nothing |
1415 | 79 | """ | 79 | """ |
1416 | 80 | carrier_obj = self.pool.get('delivery.carrier') | 80 | carrier_obj = self.pool.get('delivery.carrier') |
1417 | 81 | grid_obj = self.pool.get('delivery.grid') | 81 | grid_obj = self.pool.get('delivery.grid') |
1418 | @@ -160,6 +160,17 @@ | |||
1419 | 160 | } | 160 | } |
1420 | 161 | return res | 161 | return res |
1421 | 162 | 162 | ||
1422 | 163 | def _prepare_chained_picking(self, cr, uid, picking_name, picking, picking_type, moves_todo, context=None): | ||
1423 | 164 | values = super(stock_move, self)._prepare_chained_picking(cr, uid, picking_name, picking, picking_type, moves_todo, context=context) | ||
1424 | 165 | if picking.carrier_id: | ||
1425 | 166 | values['carrier_id'] = picking.carrier_id.id | ||
1426 | 167 | values['volume'] = picking.volume | ||
1427 | 168 | values['weight'] = picking.weight | ||
1428 | 169 | values['weight_net'] = picking.weight_net | ||
1429 | 170 | values['carrier_tracking_ref'] = picking.carrier_tracking_ref | ||
1430 | 171 | values['number_of_packages'] = picking.number_of_packages | ||
1431 | 172 | return values | ||
1432 | 173 | |||
1433 | 163 | _columns = { | 174 | _columns = { |
1434 | 164 | 'weight': fields.function(_cal_move_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight', | 175 | 'weight': fields.function(_cal_move_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight', |
1435 | 165 | store={ | 176 | store={ |
1436 | 166 | 177 | ||
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 | 1 | - | ||
1442 | 2 | I create a picking to stock.location_convenience_shop, which is chained with stock.location_refrigerator | ||
1443 | 3 | - | ||
1444 | 4 | !record {model: stock.picking, id: shipment_with_delivery}: | ||
1445 | 5 | type: internal | ||
1446 | 6 | carrier_id: delivery.delivery_carrier | ||
1447 | 7 | volume: 42 | ||
1448 | 8 | carrier_tracking_ref: FDX123 | ||
1449 | 9 | number_of_packages: 7 | ||
1450 | 10 | - | ||
1451 | 11 | I add a move in the picking | ||
1452 | 12 | - | ||
1453 | 13 | !record {model: stock.move, id: icecream_move}: | ||
1454 | 14 | picking_id: shipment_with_delivery | ||
1455 | 15 | product_id: stock.product_icecream | ||
1456 | 16 | product_uom: product.product_uom_kgm | ||
1457 | 17 | product_qty: 130.0 | ||
1458 | 18 | location_id: stock.stock_location_suppliers | ||
1459 | 19 | location_dest_id: stock.location_convenience_shop | ||
1460 | 20 | - | ||
1461 | 21 | I confirm the picking | ||
1462 | 22 | - | ||
1463 | 23 | !workflow {model: stock.picking, action: button_confirm, ref: shipment_with_delivery} | ||
1464 | 24 | - | ||
1465 | 25 | I check that the delivery fields have been propagated to the chained picking | ||
1466 | 26 | - | ||
1467 | 27 | !python {model: stock.move}: | | ||
1468 | 28 | original_move = self.browse(cr, uid, ref('icecream_move'), context=context) | ||
1469 | 29 | original_picking = original_move.picking_id | ||
1470 | 30 | chained_move = original_move.move_dest_id | ||
1471 | 31 | chained_picking = chained_move.picking_id | ||
1472 | 32 | assert chained_picking.carrier_tracking_ref == original_picking.carrier_tracking_ref, 'no propagation of carrier_tracking_ref' | ||
1473 | 33 | assert chained_picking.carrier_id == original_picking.carrier_id, 'no propagation of carrier_id' | ||
1474 | 34 | assert chained_picking.volume == original_picking.volume, 'no propagation of volume' | ||
1475 | 35 | assert chained_picking.weight == original_picking.weight, 'no propagation of weight' | ||
1476 | 36 | assert chained_picking.weight_net == original_picking.weight_net, 'no propagation of weight' | ||
1477 | 37 | |||
1478 | 0 | 38 | ||
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 | 147 | # filename_uniq is not possible in pure SQL | 147 | # filename_uniq is not possible in pure SQL |
1484 | 148 | ] | 148 | ] |
1485 | 149 | def _check_duplication(self, cr, uid, vals, ids=[], op='create'): | 149 | def _check_duplication(self, cr, uid, vals, ids=[], op='create'): |
1486 | 150 | """ | ||
1487 | 151 | Returns True if not same filename is attached already to an object (res_model, res_id) | ||
1488 | 152 | """ | ||
1489 | 150 | name = vals.get('name', False) | 153 | name = vals.get('name', False) |
1490 | 151 | parent_id = vals.get('parent_id', False) | 154 | parent_id = vals.get('parent_id', False) |
1491 | 152 | res_model = vals.get('res_model', False) | 155 | res_model = vals.get('res_model', False) |
1492 | @@ -340,14 +343,21 @@ | |||
1493 | 340 | storage_id = par.storage_id | 343 | storage_id = par.storage_id |
1494 | 341 | break | 344 | break |
1495 | 342 | par = par.parent_id | 345 | par = par.parent_id |
1504 | 343 | #assert storage_id, "Strange, found file #%s w/o storage!" % f.id #TOCHECK: after run yml, it's fail | 346 | #We get the ids of attachement that correspond to the document |
1505 | 344 | if storage_id: | 347 | attachment_ids = self.search(cr, uid, [('store_fname', '=', f.store_fname), ('parent_id.name', '=', f.parent_id.name)], context=context) |
1506 | 345 | r = stor.prepare_unlink(cr, uid, storage_id, f) | 348 | #If we have more than 1 attachment for a same file, we will not unlink it. |
1507 | 346 | if r: | 349 | canUnlink = len(attachment_ids) |
1508 | 347 | unres.append(r) | 350 | #If canUnlink is bigger than 1 it means that the document has more than 1 attachement. |
1509 | 348 | else: | 351 | #We therefore cannot unlink that document. |
1510 | 349 | logging.getLogger('document').warning("Unlinking attachment #%s %s that has no storage", | 352 | if canUnlink == 1: |
1511 | 350 | f.id, f.name) | 353 | #assert storage_id, "Strange, found file #%s w/o storage!" % f.id #TOCHECK: after run yml, it's fail |
1512 | 354 | if storage_id: | ||
1513 | 355 | r = stor.prepare_unlink(cr, uid, storage_id, f) | ||
1514 | 356 | if r: | ||
1515 | 357 | unres.append(r) | ||
1516 | 358 | else: | ||
1517 | 359 | logging.getLogger('document').warning("Unlinking attachment #%s %s that has no storage", | ||
1518 | 360 | f.id, f.name) | ||
1519 | 351 | res = super(document_file, self).unlink(cr, uid, ids, context) | 361 | res = super(document_file, self).unlink(cr, uid, ids, context) |
1520 | 352 | stor.do_unlink(cr, uid, unres) | 362 | stor.do_unlink(cr, uid, unres) |
1521 | 353 | return res | 363 | return res |
1522 | 354 | 364 | ||
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 | 255 | context={} | 255 | context={} |
1528 | 256 | fetchmail_server_id = context.get('fetchmail_server_id') | 256 | fetchmail_server_id = context.get('fetchmail_server_id') |
1529 | 257 | if fetchmail_server_id: | 257 | if fetchmail_server_id: |
1531 | 258 | values['fetchmail_server_id'] = server_id | 258 | values['fetchmail_server_id'] = fetchmail_server_id |
1532 | 259 | res = super(mail_message,self).write(cr, uid, ids, values, context=context) | 259 | res = super(mail_message,self).write(cr, uid, ids, values, context=context) |
1533 | 260 | return res | 260 | return res |
1534 | 261 | 261 | ||
1535 | 262 | 262 | ||
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 | 184 | resource = employee.resource_id | 184 | resource = employee.resource_id |
1541 | 185 | if resource: | 185 | if resource: |
1542 | 186 | resource_ids.append(resource.id) | 186 | resource_ids.append(resource.id) |
1543 | 187 | res = super(hr_employee, self).unlink(cr, uid, ids, context=context) | ||
1544 | 187 | if resource_ids: | 188 | if resource_ids: |
1545 | 188 | resource_obj.unlink(cr, uid, resource_ids, context=context) | 189 | resource_obj.unlink(cr, uid, resource_ids, context=context) |
1547 | 189 | return super(hr_employee, self).unlink(cr, uid, ids, context=context) | 190 | return res |
1548 | 190 | 191 | ||
1549 | 191 | def onchange_address_id(self, cr, uid, ids, address, context=None): | 192 | def onchange_address_id(self, cr, uid, ids, address, context=None): |
1550 | 192 | if address: | 193 | if address: |
1551 | 193 | 194 | ||
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 | 375 | #OR if it starts between the given dates | 375 | #OR if it starts between the given dates |
1557 | 376 | clause_2 = ['&',('date_start', '<=', date_to),('date_start','>=', date_from)] | 376 | clause_2 = ['&',('date_start', '<=', date_to),('date_start','>=', date_from)] |
1558 | 377 | #OR if it starts before the date_from and finish after the date_end (or never finish) | 377 | #OR if it starts before the date_from and finish after the date_end (or never finish) |
1560 | 378 | clause_3 = [('date_start','<=', date_from),'|',('date_end', '=', False),('date_end','>=', date_to)] | 378 | clause_3 = ['&',('date_start','<=', date_from),'|',('date_end', '=', False),('date_end','>=', date_to)] |
1561 | 379 | clause_final = [('employee_id', '=', employee.id),'|','|'] + clause_1 + clause_2 + clause_3 | 379 | clause_final = [('employee_id', '=', employee.id),'|','|'] + clause_1 + clause_2 + clause_3 |
1562 | 380 | contract_ids = contract_obj.search(cr, uid, clause_final, context=context) | 380 | contract_ids = contract_obj.search(cr, uid, clause_final, context=context) |
1563 | 381 | return contract_ids | 381 | return contract_ids |
1564 | 382 | 382 | ||
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 | 104 | name="%(action_hr_recruitment_partner_create)d" | 104 | name="%(action_hr_recruitment_partner_create)d" |
1570 | 105 | icon="gtk-index" type="action" attrs="{'readonly':[('partner_id','!=',False)]}" groups="base.group_partner_manager"/> | 105 | icon="gtk-index" type="action" attrs="{'readonly':[('partner_id','!=',False)]}" groups="base.group_partner_manager"/> |
1571 | 106 | <newline/> | 106 | <newline/> |
1573 | 107 | <field name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)" colspan="3"/> | 107 | <field name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)" options='{"quick_create": false}' context="{'default_partner_id':partner_id}" colspan="3"/> |
1574 | 108 | <field name="email_from" colspan="3"/> | 108 | <field name="email_from" colspan="3"/> |
1575 | 109 | <field name="partner_phone" colspan="3"/> | 109 | <field name="partner_phone" colspan="3"/> |
1576 | 110 | <field name="partner_mobile" colspan="3"/> | 110 | <field name="partner_mobile" colspan="3"/> |
1577 | 111 | 111 | ||
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 | 74 | toremove = {} | 74 | toremove = {} |
1583 | 75 | for obj in self.browse(cr, uid, ids, context=context): | 75 | for obj in self.browse(cr, uid, ids, context=context): |
1584 | 76 | toremove[obj.line_id.id] = True | 76 | toremove[obj.line_id.id] = True |
1587 | 77 | self.pool.get('account.analytic.line').unlink(cr, uid, toremove.keys(), context=context) | 77 | return self.pool.get('account.analytic.line').unlink(cr, uid, toremove.keys(), context=context) |
1586 | 78 | return super(hr_analytic_timesheet, self).unlink(cr, uid, ids, context=context) | ||
1588 | 79 | 78 | ||
1589 | 80 | 79 | ||
1590 | 81 | def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, company_id, unit=False, journal_id=False, context=None): | 80 | def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, company_id, unit=False, journal_id=False, context=None): |
1591 | 82 | 81 | ||
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 | 193 | res = super(account_move_line, self).create_analytic_lines(cr, uid, ids,context=context) | 193 | res = super(account_move_line, self).create_analytic_lines(cr, uid, ids,context=context) |
1597 | 194 | analytic_line_obj = self.pool.get('account.analytic.line') | 194 | analytic_line_obj = self.pool.get('account.analytic.line') |
1598 | 195 | for move_line in self.browse(cr, uid, ids, context=context): | 195 | for move_line in self.browse(cr, uid, ids, context=context): |
1599 | 196 | #For customer invoice, link analytic line to the invoice so it is not proposed for invoicing in Bill Tasks Work | ||
1600 | 197 | invoice_id = move_line.invoice and move_line.invoice.type in ('out_invoice','out_refund') and move_line.invoice.id or False | ||
1601 | 196 | for line in move_line.analytic_lines: | 198 | for line in move_line.analytic_lines: |
1605 | 197 | toinv = line.account_id.to_invoice.id | 199 | analytic_line_obj.write(cr, uid, line.id, { |
1606 | 198 | if toinv: | 200 | 'invoice_id': invoice_id, |
1607 | 199 | analytic_line_obj.write(cr, uid, line.id, {'to_invoice': toinv}) | 201 | 'to_invoice': line.account_id.to_invoice and line.account_id.to_invoice.id or False |
1608 | 202 | }, context=context) | ||
1609 | 200 | return res | 203 | return res |
1610 | 201 | 204 | ||
1611 | 202 | account_move_line() | 205 | account_move_line() |
1612 | 203 | 206 | ||
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 | 519 | store={ | 519 | store={ |
1618 | 520 | 'hr_timesheet_sheet.sheet': (_get_hr_timesheet_sheet, ['employee_id', 'date_from', 'date_to'], 10), | 520 | 'hr_timesheet_sheet.sheet': (_get_hr_timesheet_sheet, ['employee_id', 'date_from', 'date_to'], 10), |
1619 | 521 | 'account.analytic.line': (_get_account_analytic_line, ['user_id', 'date'], 10), | 521 | 'account.analytic.line': (_get_account_analytic_line, ['user_id', 'date'], 10), |
1621 | 522 | 'hr.analytic.timesheet': (lambda self,cr,uid,ids,context=None: ids, ['line_id'], 10), | 522 | 'hr.analytic.timesheet': (lambda self,cr,uid,ids,context=None: ids, None, 10), |
1622 | 523 | }, | 523 | }, |
1623 | 524 | ), | 524 | ), |
1624 | 525 | } | 525 | } |
1625 | 526 | 526 | ||
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 | 118 | ], | 118 | ], |
1631 | 119 | "init_xml" : [], | 119 | "init_xml" : [], |
1632 | 120 | "update_xml" : ["account_chart_netherlands.xml", | 120 | "update_xml" : ["account_chart_netherlands.xml", |
1633 | 121 | "account_fiscal_position_template.xml", | ||
1634 | 122 | "account_fiscal_position_tax_template.xml", | ||
1635 | 123 | "account_fiscal_position_account_template.xml", | ||
1636 | 121 | "l10n_nl_wizard.xml" | 124 | "l10n_nl_wizard.xml" |
1637 | 122 | ], | 125 | ], |
1638 | 123 | "demo_xml" : [ | 126 | "demo_xml" : [ |
1639 | 124 | 127 | ||
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 | 1424 | <field name="reconcile" eval="True"/> | 1424 | <field name="reconcile" eval="True"/> |
1645 | 1425 | <field ref="a_15" name="parent_id"/> | 1425 | <field ref="a_15" name="parent_id"/> |
1646 | 1426 | </record> | 1426 | </record> |
1648 | 1427 | <record id="vat_payable6" model="account.account.template"> | 1427 | <record id="vat_payable_low" model="account.account.template"> |
1649 | 1428 | <field name="name">Btw af te dragen laag</field> | 1428 | <field name="name">Btw af te dragen laag</field> |
1650 | 1429 | <field name="code">1601</field> | 1429 | <field name="code">1601</field> |
1651 | 1430 | <field name="type">other</field> | 1430 | <field name="type">other</field> |
1652 | @@ -1432,7 +1432,7 @@ | |||
1653 | 1432 | <field name="reconcile" eval="False"/> | 1432 | <field name="reconcile" eval="False"/> |
1654 | 1433 | <field ref="a_15" name="parent_id"/> | 1433 | <field ref="a_15" name="parent_id"/> |
1655 | 1434 | </record> | 1434 | </record> |
1657 | 1435 | <record id="vat_payable19" model="account.account.template"> | 1435 | <record id="vat_payable_high" model="account.account.template"> |
1658 | 1436 | <field name="name">Btw af te dragen hoog</field> | 1436 | <field name="name">Btw af te dragen hoog</field> |
1659 | 1437 | <field name="code">1602</field> | 1437 | <field name="code">1602</field> |
1660 | 1438 | <field name="type">other</field> | 1438 | <field name="type">other</field> |
1661 | @@ -1448,7 +1448,7 @@ | |||
1662 | 1448 | <field name="reconcile" eval="False"/> | 1448 | <field name="reconcile" eval="False"/> |
1663 | 1449 | <field ref="a_15" name="parent_id"/> | 1449 | <field ref="a_15" name="parent_id"/> |
1664 | 1450 | </record> | 1450 | </record> |
1666 | 1451 | <record id="vat_refund6" model="account.account.template"> | 1451 | <record id="vat_refund_low" model="account.account.template"> |
1667 | 1452 | <field name="name">Btw te vorderen laag</field> | 1452 | <field name="name">Btw te vorderen laag</field> |
1668 | 1453 | <field name="code">1611</field> | 1453 | <field name="code">1611</field> |
1669 | 1454 | <field name="type">other</field> | 1454 | <field name="type">other</field> |
1670 | @@ -1456,7 +1456,7 @@ | |||
1671 | 1456 | <field name="reconcile" eval="False"/> | 1456 | <field name="reconcile" eval="False"/> |
1672 | 1457 | <field ref="a_15" name="parent_id"/> | 1457 | <field ref="a_15" name="parent_id"/> |
1673 | 1458 | </record> | 1458 | </record> |
1675 | 1459 | <record id="vat_refund19" model="account.account.template"> | 1459 | <record id="vat_refund_high" model="account.account.template"> |
1676 | 1460 | <field name="name">Btw te vorderen hoog</field> | 1460 | <field name="name">Btw te vorderen hoog</field> |
1677 | 1461 | <field name="code">1612</field> | 1461 | <field name="code">1612</field> |
1678 | 1462 | <field name="type">other</field> | 1462 | <field name="type">other</field> |
1679 | @@ -3909,7 +3909,7 @@ | |||
1680 | 3909 | <record id="btw_code_1a" model="account.tax.code.template"> | 3909 | <record id="btw_code_1a" model="account.tax.code.template"> |
1681 | 3910 | <field name="code">1a</field> | 3910 | <field name="code">1a</field> |
1682 | 3911 | <field name="parent_id" ref="btw_code_binnenland"/> | 3911 | <field name="parent_id" ref="btw_code_binnenland"/> |
1684 | 3912 | <field name="name">Leveringen/diensten belast met 19% (BTW)</field> | 3912 | <field name="name">Leveringen/diensten belast met 21% (BTW)</field> |
1685 | 3913 | </record> | 3913 | </record> |
1686 | 3914 | <record id="btw_code_1b" model="account.tax.code.template"> | 3914 | <record id="btw_code_1b" model="account.tax.code.template"> |
1687 | 3915 | <field name="code">1b</field> | 3915 | <field name="code">1b</field> |
1688 | @@ -3955,11 +3955,13 @@ | |||
1689 | 3955 | <field name="code">4a</field> | 3955 | <field name="code">4a</field> |
1690 | 3956 | <field name="parent_id" ref="btw_code_vanuit_buitenland"/> | 3956 | <field name="parent_id" ref="btw_code_vanuit_buitenland"/> |
1691 | 3957 | <field name="name">Leveringen uit landen buiten de EU (invoer) (BTW)</field> | 3957 | <field name="name">Leveringen uit landen buiten de EU (invoer) (BTW)</field> |
1692 | 3958 | <field name="sign" eval="-1" /> | ||
1693 | 3958 | </record> | 3959 | </record> |
1694 | 3959 | <record id="btw_code_4b" model="account.tax.code.template"> | 3960 | <record id="btw_code_4b" model="account.tax.code.template"> |
1695 | 3960 | <field name="code">4b</field> | 3961 | <field name="code">4b</field> |
1696 | 3961 | <field name="parent_id" ref="btw_code_vanuit_buitenland"/> | 3962 | <field name="parent_id" ref="btw_code_vanuit_buitenland"/> |
1697 | 3962 | <field name="name">Verwerving van goederen uit landen binnen de EU (BTW)</field> | 3963 | <field name="name">Verwerving van goederen uit landen binnen de EU (BTW)</field> |
1698 | 3964 | <field name="sign" eval="-1" /> | ||
1699 | 3963 | </record> | 3965 | </record> |
1700 | 3964 | <!-- 5. Voorbelasting, kleineondernemersregeling, schatting en eindtotaal --> | 3966 | <!-- 5. Voorbelasting, kleineondernemersregeling, schatting en eindtotaal --> |
1701 | 3965 | <record id="btw_code_voorbelasting" model="account.tax.code.template"> | 3967 | <record id="btw_code_voorbelasting" model="account.tax.code.template"> |
1702 | @@ -4019,7 +4021,7 @@ | |||
1703 | 4019 | <record id="omz_code_1a" model="account.tax.code.template"> | 4021 | <record id="omz_code_1a" model="account.tax.code.template"> |
1704 | 4020 | <field name="code">1a</field> | 4022 | <field name="code">1a</field> |
1705 | 4021 | <field name="parent_id" ref="omz_code_binnenland"/> | 4023 | <field name="parent_id" ref="omz_code_binnenland"/> |
1707 | 4022 | <field name="name">Leveringen/diensten belast met 19% (omzet)</field> | 4024 | <field name="name">Leveringen/diensten belast met 21% (omzet)</field> |
1708 | 4023 | </record> | 4025 | </record> |
1709 | 4024 | <record id="omz_code_1b" model="account.tax.code.template"> | 4026 | <record id="omz_code_1b" model="account.tax.code.template"> |
1710 | 4025 | <field name="code">1b</field> | 4027 | <field name="code">1b</field> |
1711 | @@ -4100,6 +4102,7 @@ | |||
1712 | 4100 | <field name="property_account_payable" ref="a_pay"/> <!-- crediteuren --> | 4102 | <field name="property_account_payable" ref="a_pay"/> <!-- crediteuren --> |
1713 | 4101 | <field name="property_account_expense_categ" ref="a_expense"/><!-- aankoop grondstoffen --> | 4103 | <field name="property_account_expense_categ" ref="a_expense"/><!-- aankoop grondstoffen --> |
1714 | 4102 | <field name="property_account_income_categ" ref="a_sale"/> <!-- verkoop rekening --> | 4104 | <field name="property_account_income_categ" ref="a_sale"/> <!-- verkoop rekening --> |
1715 | 4105 | <field name="property_reserve_and_surplus_account" ref="a_9999"/> | ||
1716 | 4103 | </record> | 4106 | </record> |
1717 | 4104 | 4107 | ||
1718 | 4105 | <!-- BTW Template | 4108 | <!-- BTW Template |
1719 | @@ -4130,436 +4133,541 @@ | |||
1720 | 4130 | <!-- Binnen Nederland --> | 4133 | <!-- Binnen Nederland --> |
1721 | 4131 | <!-- Verkoop BTW --> | 4134 | <!-- Verkoop BTW --> |
1722 | 4132 | <record id="btw_0" model="account.tax.template"> | 4135 | <record id="btw_0" model="account.tax.template"> |
1723 | 4136 | <field name="sequence">10</field> | ||
1724 | 4133 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4137 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1725 | 4134 | <field name="name">Verkopen/omzet onbelast (nul-tarief)</field> | 4138 | <field name="name">Verkopen/omzet onbelast (nul-tarief)</field> |
1726 | 4135 | <field name="description">0% BTW</field> | 4139 | <field name="description">0% BTW</field> |
1727 | 4136 | <field eval="0.00" name="amount"/> | 4140 | <field eval="0.00" name="amount"/> |
1728 | 4137 | <field name="type">percent</field> | 4141 | <field name="type">percent</field> |
1729 | 4138 | <field name="account_collected_id" ref="vat_payable0"/> | 4142 | <field name="account_collected_id" ref="vat_payable0"/> |
1731 | 4139 | <field name="account_paid_id" ref="vat_refund0"/> | 4143 | <field name="account_paid_id" ref="vat_payable0"/> |
1732 | 4140 | <field name="base_code_id" ref="omz_code_1e"/> | 4144 | <field name="base_code_id" ref="omz_code_1e"/> |
1733 | 4141 | <field name="ref_base_code_id" ref="omz_code_1e"/> | 4145 | <field name="ref_base_code_id" ref="omz_code_1e"/> |
1734 | 4146 | <field name="ref_base_sign" eval="-1"/> | ||
1735 | 4147 | <field name="ref_tax_sign" eval="-1"/> | ||
1736 | 4142 | <field name="type_tax_use">sale</field> | 4148 | <field name="type_tax_use">sale</field> |
1737 | 4143 | </record> | 4149 | </record> |
1738 | 4144 | <record id="btw_6" model="account.tax.template"> | 4150 | <record id="btw_6" model="account.tax.template"> |
1739 | 4151 | <field name="sequence">10</field> | ||
1740 | 4145 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4152 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1741 | 4146 | <field name="name">Verkopen/omzet laag</field> | 4153 | <field name="name">Verkopen/omzet laag</field> |
1742 | 4147 | <field name="description">6% BTW</field> | 4154 | <field name="description">6% BTW</field> |
1743 | 4148 | <field eval="0.06" name="amount"/> | 4155 | <field eval="0.06" name="amount"/> |
1744 | 4149 | <field name="type">percent</field> | 4156 | <field name="type">percent</field> |
1747 | 4150 | <field name="account_collected_id" ref="vat_payable6"/> | 4157 | <field name="account_collected_id" ref="vat_payable_low"/> |
1748 | 4151 | <field name="account_paid_id" ref="vat_refund6"/> | 4158 | <field name="account_paid_id" ref="vat_payable_low"/> |
1749 | 4152 | <field name="base_code_id" ref="omz_code_1b"/> | 4159 | <field name="base_code_id" ref="omz_code_1b"/> |
1750 | 4153 | <field name="tax_code_id" ref="btw_code_1b"/> | 4160 | <field name="tax_code_id" ref="btw_code_1b"/> |
1751 | 4154 | <field name="ref_base_code_id" ref="omz_code_1b"/> | 4161 | <field name="ref_base_code_id" ref="omz_code_1b"/> |
1752 | 4155 | <field name="ref_tax_code_id" ref="btw_code_1b"/> | 4162 | <field name="ref_tax_code_id" ref="btw_code_1b"/> |
1753 | 4163 | <field name="ref_base_sign" eval="-1"/> | ||
1754 | 4164 | <field name="ref_tax_sign" eval="-1"/> | ||
1755 | 4156 | <field name="type_tax_use">sale</field> | 4165 | <field name="type_tax_use">sale</field> |
1756 | 4157 | </record> | 4166 | </record> |
1758 | 4158 | <record id="btw_19" model="account.tax.template"> | 4167 | <record id="btw_21" model="account.tax.template"> |
1759 | 4168 | <field name="sequence">5</field> | ||
1760 | 4159 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4169 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1761 | 4160 | <field name="name">Verkopen/omzet hoog</field> | 4170 | <field name="name">Verkopen/omzet hoog</field> |
1764 | 4161 | <field name="description">19% BTW</field> | 4171 | <field name="description">21% BTW</field> |
1765 | 4162 | <field eval="0.19" name="amount"/> | 4172 | <field eval="0.21" name="amount"/> |
1766 | 4163 | <field name="type">percent</field> | 4173 | <field name="type">percent</field> |
1769 | 4164 | <field name="account_collected_id" ref="vat_payable19"/> | 4174 | <field name="account_collected_id" ref="vat_payable_high"/> |
1770 | 4165 | <field name="account_paid_id" ref="vat_refund19"/> | 4175 | <field name="account_paid_id" ref="vat_payable_high"/> |
1771 | 4166 | <field name="base_code_id" ref="omz_code_1a"/> | 4176 | <field name="base_code_id" ref="omz_code_1a"/> |
1772 | 4167 | <field name="tax_code_id" ref="btw_code_1a"/> | 4177 | <field name="tax_code_id" ref="btw_code_1a"/> |
1773 | 4168 | <field name="ref_base_code_id" ref="omz_code_1a"/> | 4178 | <field name="ref_base_code_id" ref="omz_code_1a"/> |
1774 | 4169 | <field name="ref_tax_code_id" ref="btw_code_1a"/> | 4179 | <field name="ref_tax_code_id" ref="btw_code_1a"/> |
1775 | 4180 | <field name="ref_base_sign" eval="-1"/> | ||
1776 | 4181 | <field name="ref_tax_sign" eval="-1"/> | ||
1777 | 4170 | <field name="type_tax_use">sale</field> | 4182 | <field name="type_tax_use">sale</field> |
1778 | 4171 | </record> | 4183 | </record> |
1779 | 4172 | <!-- TODO - nakijken btw overig op percentage--> | 4184 | <!-- TODO - nakijken btw overig op percentage--> |
1780 | 4173 | <record id="btw_overig" model="account.tax.template"> | 4185 | <record id="btw_overig" model="account.tax.template"> |
1781 | 4186 | <field name="sequence">15</field> | ||
1782 | 4174 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4187 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1783 | 4175 | <field name="name">Verkopen/omzet overig</field> | 4188 | <field name="name">Verkopen/omzet overig</field> |
1784 | 4176 | <field name="description">variabel BTW</field> | 4189 | <field name="description">variabel BTW</field> |
1786 | 4177 | <field eval="0.19" name="amount"/> | 4190 | <field eval="0.21" name="amount"/> |
1787 | 4178 | <field name="type">percent</field> | 4191 | <field name="type">percent</field> |
1790 | 4179 | <field name="account_collected_id" ref="vat_payable19"/> | 4192 | <field name="account_collected_id" ref="vat_payable_high"/> |
1791 | 4180 | <field name="account_paid_id" ref="vat_refund19"/> | 4193 | <field name="account_paid_id" ref="vat_payable_high"/> |
1792 | 4181 | <field name="base_code_id" ref="omz_code_1a"/> | 4194 | <field name="base_code_id" ref="omz_code_1a"/> |
1793 | 4182 | <field name="tax_code_id" ref="btw_code_1a"/> | 4195 | <field name="tax_code_id" ref="btw_code_1a"/> |
1794 | 4183 | <field name="ref_base_code_id" ref="omz_code_1c"/> | 4196 | <field name="ref_base_code_id" ref="omz_code_1c"/> |
1795 | 4184 | <field name="ref_tax_code_id" ref="btw_code_1c"/> | 4197 | <field name="ref_tax_code_id" ref="btw_code_1c"/> |
1796 | 4198 | <field name="ref_base_sign" eval="-1"/> | ||
1797 | 4199 | <field name="ref_tax_sign" eval="-1"/> | ||
1798 | 4185 | <field name="type_tax_use">sale</field> | 4200 | <field name="type_tax_use">sale</field> |
1799 | 4186 | </record> | 4201 | </record> |
1800 | 4187 | 4202 | ||
1801 | 4188 | <!--Inkoop BTW --> | 4203 | <!--Inkoop BTW --> |
1802 | 4189 | <record id="btw_6_buy" model="account.tax.template"> | 4204 | <record id="btw_6_buy" model="account.tax.template"> |
1803 | 4205 | <field name="sequence">10</field> | ||
1804 | 4190 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4206 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1805 | 4191 | <field name="name">BTW te vorderen laag (inkopen)</field> | 4207 | <field name="name">BTW te vorderen laag (inkopen)</field> |
1806 | 4192 | <field name="description">6% BTW</field> | 4208 | <field name="description">6% BTW</field> |
1807 | 4193 | <field eval="0.06" name="amount"/> | 4209 | <field eval="0.06" name="amount"/> |
1808 | 4194 | <field name="type">percent</field> | 4210 | <field name="type">percent</field> |
1811 | 4195 | <field name="account_collected_id" ref="vat_refund6"/> | 4211 | <field name="account_collected_id" ref="vat_refund_low"/> |
1812 | 4196 | <field name="account_paid_id" ref="vat_payable6"/> | 4212 | <field name="account_paid_id" ref="vat_refund_low"/> |
1813 | 4197 | <field name="tax_code_id" ref="btw_code_5b"/> | 4213 | <field name="tax_code_id" ref="btw_code_5b"/> |
1814 | 4198 | <field name="ref_tax_code_id" ref="btw_code_5b"/> | 4214 | <field name="ref_tax_code_id" ref="btw_code_5b"/> |
1815 | 4215 | <field name="ref_base_sign" eval="-1"/> | ||
1816 | 4216 | <field name="ref_tax_sign" eval="-1"/> | ||
1817 | 4199 | <field name="type_tax_use">purchase</field> | 4217 | <field name="type_tax_use">purchase</field> |
1818 | 4200 | </record> | 4218 | </record> |
1820 | 4201 | <record id="btw_19_buy" model="account.tax.template"> | 4219 | <record id="btw_21_buy" model="account.tax.template"> |
1821 | 4220 | <field name="sequence">5</field> | ||
1822 | 4202 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4221 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1823 | 4203 | <field name="name">BTW te vorderen hoog (inkopen)</field> | 4222 | <field name="name">BTW te vorderen hoog (inkopen)</field> |
1826 | 4204 | <field name="description">19% BTW</field> | 4223 | <field name="description">21% BTW</field> |
1827 | 4205 | <field eval="0.19" name="amount"/> | 4224 | <field eval="0.21" name="amount"/> |
1828 | 4206 | <field name="type">percent</field> | 4225 | <field name="type">percent</field> |
1831 | 4207 | <field name="account_collected_id" ref="vat_refund19"/> | 4226 | <field name="account_collected_id" ref="vat_refund_high"/> |
1832 | 4208 | <field name="account_paid_id" ref="vat_payable19"/> | 4227 | <field name="account_paid_id" ref="vat_refund_high"/> |
1833 | 4209 | <field name="tax_code_id" ref="btw_code_5b"/> | 4228 | <field name="tax_code_id" ref="btw_code_5b"/> |
1834 | 4210 | <field name="ref_tax_code_id" ref="btw_code_5b"/> | 4229 | <field name="ref_tax_code_id" ref="btw_code_5b"/> |
1835 | 4230 | <field name="ref_base_sign" eval="-1"/> | ||
1836 | 4231 | <field name="ref_tax_sign" eval="-1"/> | ||
1837 | 4211 | <field name="type_tax_use">purchase</field> | 4232 | <field name="type_tax_use">purchase</field> |
1838 | 4212 | </record> | 4233 | </record> |
1839 | 4213 | <record id="btw_overig_buy" model="account.tax.template"> | 4234 | <record id="btw_overig_buy" model="account.tax.template"> |
1840 | 4235 | <field name="sequence">15</field> | ||
1841 | 4214 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4236 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1842 | 4215 | <field name="name">BTW te vorderen overig (inkopen)</field> | 4237 | <field name="name">BTW te vorderen overig (inkopen)</field> |
1843 | 4216 | <field name="description">variabel BTW</field> | 4238 | <field name="description">variabel BTW</field> |
1845 | 4217 | <field eval="0.19" name="amount"/> | 4239 | <field eval="0.21" name="amount"/> |
1846 | 4218 | <field name="type">percent</field> | 4240 | <field name="type">percent</field> |
1849 | 4219 | <field name="account_collected_id" ref="vat_refund19"/> | 4241 | <field name="account_collected_id" ref="vat_refund_high"/> |
1850 | 4220 | <field name="account_paid_id" ref="vat_payable19"/> | 4242 | <field name="account_paid_id" ref="vat_refund_high"/> |
1851 | 4221 | <field name="tax_code_id" ref="btw_code_5b"/> | 4243 | <field name="tax_code_id" ref="btw_code_5b"/> |
1852 | 4222 | <field name="ref_tax_code_id" ref="btw_code_5b"/> | 4244 | <field name="ref_tax_code_id" ref="btw_code_5b"/> |
1853 | 4245 | <field name="ref_base_sign" eval="-1"/> | ||
1854 | 4246 | <field name="ref_tax_sign" eval="-1"/> | ||
1855 | 4223 | <field name="type_tax_use">purchase</field> | 4247 | <field name="type_tax_use">purchase</field> |
1856 | 4224 | </record> | 4248 | </record> |
1857 | 4225 | <!--BTW verlegd--> | 4249 | <!--BTW verlegd--> |
1859 | 4226 | <record id="btw_verk_0" model="account.tax.template"> | 4250 | <record id="btw_verk_0" model="account.tax.template"> |
1860 | 4251 | <field name="sequence">15</field> | ||
1861 | 4227 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4252 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1862 | 4228 | <field name="name">BTW af te dragen verlegd (verkopen)</field> | 4253 | <field name="name">BTW af te dragen verlegd (verkopen)</field> |
1863 | 4229 | <field name="description">0% BTW verlegd</field> | 4254 | <field name="description">0% BTW verlegd</field> |
1864 | 4230 | <field eval="0.00" name="amount"/> | 4255 | <field eval="0.00" name="amount"/> |
1865 | 4231 | <field name="type">percent</field> | 4256 | <field name="type">percent</field> |
1866 | 4232 | <field name="account_collected_id" ref="vat_payable_verlegd"/> | 4257 | <field name="account_collected_id" ref="vat_payable_verlegd"/> |
1868 | 4233 | <field name="account_paid_id" ref="vat_refund_verlegd"/> | 4258 | <field name="account_paid_id" ref="vat_payable_verlegd"/> |
1869 | 4234 | <field eval="omz_code_1e" name="base_code_id"/> | 4259 | <field eval="omz_code_1e" name="base_code_id"/> |
1870 | 4235 | <field eval="omz_code_1e" name="ref_base_code_id"/> | 4260 | <field eval="omz_code_1e" name="ref_base_code_id"/> |
1871 | 4261 | <field name="ref_base_sign" eval="-1"/> | ||
1872 | 4262 | <field name="ref_tax_sign" eval="-1"/> | ||
1873 | 4236 | <field name="type_tax_use">purchase</field> | 4263 | <field name="type_tax_use">purchase</field> |
1874 | 4237 | </record> | 4264 | </record> |
1875 | 4238 | <record id="btw_ink_0" model="account.tax.template"> | 4265 | <record id="btw_ink_0" model="account.tax.template"> |
1876 | 4266 | <field name="sequence">15</field> | ||
1877 | 4239 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4267 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1878 | 4240 | <field name="name">BTW af te dragen verlegd (inkopen)</field> | 4268 | <field name="name">BTW af te dragen verlegd (inkopen)</field> |
1881 | 4241 | <field name="description">19% BTW verlegd</field> | 4269 | <field name="description">21% BTW verlegd</field> |
1882 | 4242 | <field eval="0.19" name="amount"/> | 4270 | <field eval="0.21" name="amount"/> |
1883 | 4243 | <field name="type">percent</field> | 4271 | <field name="type">percent</field> |
1884 | 4244 | <field name="account_collected_id" ref="vat_payable_verlegd"/> | 4272 | <field name="account_collected_id" ref="vat_payable_verlegd"/> |
1886 | 4245 | <field name="account_paid_id" ref="vat_refund_verlegd"/> | 4273 | <field name="account_paid_id" ref="vat_payable_verlegd"/> |
1887 | 4246 | <field eval="omz_code_2a" name="base_code_id"/> | 4274 | <field eval="omz_code_2a" name="base_code_id"/> |
1888 | 4247 | <field eval="omz_code_2a" name="ref_base_code_id"/> | 4275 | <field eval="omz_code_2a" name="ref_base_code_id"/> |
1889 | 4276 | <field name="ref_base_sign" eval="-1"/> | ||
1890 | 4277 | <field name="ref_tax_sign" eval="-1"/> | ||
1891 | 4248 | <field name="type_tax_use">purchase</field> | 4278 | <field name="type_tax_use">purchase</field> |
1892 | 4249 | <field eval="True" name="child_depend"/> | 4279 | <field eval="True" name="child_depend"/> |
1893 | 4250 | </record> | 4280 | </record> |
1918 | 4251 | <record id="btw_ink_0_1" model="account.tax.template"> | 4281 | <record id="btw_ink_0_1" model="account.tax.template"> |
1919 | 4252 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4282 | <field name="sequence">99</field> |
1920 | 4253 | <field name="name">BTW af te dragen verlegd (inkopen1)</field> | 4283 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1921 | 4254 | <field eval="1.00" name="amount"/> | 4284 | <field name="name">BTW af te dragen verlegd (inkopen1)</field> |
1922 | 4255 | <field name="type">percent</field> | 4285 | <field eval="1.00" name="amount"/> |
1923 | 4256 | <field eval="btw_ink_0" name="parent_id"/> | 4286 | <field name="type">percent</field> |
1924 | 4257 | <field name="account_collected_id" ref="vat_payable_verlegd"/> | 4287 | <field eval="btw_ink_0" name="parent_id"/> |
1925 | 4258 | <field name="account_paid_id" ref="vat_refund_verlegd"/> | 4288 | <field name="account_collected_id" ref="vat_payable_verlegd"/> |
1926 | 4259 | <field eval="btw_code_2a" name="tax_code_id"/> | 4289 | <field name="account_paid_id" ref="vat_payable_verlegd"/> |
1927 | 4260 | <field eval="btw_code_2a" name="ref_tax_code_id"/> | 4290 | <field eval="btw_code_2a" name="tax_code_id"/> |
1928 | 4261 | <field name="type_tax_use">purchase</field> | 4291 | <field eval="btw_code_2a" name="ref_tax_code_id"/> |
1929 | 4262 | </record> | 4292 | <field name="ref_base_sign" eval="-1"/> |
1930 | 4263 | <record id="btw_ink_0_2" model="account.tax.template"> | 4293 | <field name="ref_tax_sign" eval="-1"/> |
1931 | 4264 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4294 | <field name="type_tax_use">purchase</field> |
1932 | 4265 | <field name="name">BTW af te dragen verlegd (inkopen2)</field> | 4295 | </record> |
1933 | 4266 | <field eval="-1.00" name="amount"/> | 4296 | <record id="btw_ink_0_2" model="account.tax.template"> |
1934 | 4267 | <field name="type">percent</field> | 4297 | <field name="sequence">99</field> |
1935 | 4268 | <field eval="btw_ink_0" name="parent_id"/> | 4298 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1936 | 4269 | <field name="account_collected_id" ref="vat_payable_verlegd"/> | 4299 | <field name="name">BTW af te dragen verlegd (inkopen2)</field> |
1937 | 4270 | <field name="account_paid_id" ref="vat_refund_verlegd"/> | 4300 | <field eval="-1.00" name="amount"/> |
1938 | 4271 | <field eval="btw_code_5b" name="tax_code_id"/> | 4301 | <field name="type">percent</field> |
1939 | 4272 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | 4302 | <field eval="btw_ink_0" name="parent_id"/> |
1940 | 4273 | <field name="type_tax_use">purchase</field> | 4303 | <field name="account_collected_id" ref="vat_payable_verlegd"/> |
1941 | 4274 | </record> | 4304 | <field name="account_paid_id" ref="vat_payable_verlegd"/> |
1942 | 4305 | <field eval="btw_code_5b" name="tax_code_id"/> | ||
1943 | 4306 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | ||
1944 | 4307 | <field name="ref_base_sign" eval="-1"/> | ||
1945 | 4308 | <field name="ref_tax_sign" eval="-1"/> | ||
1946 | 4309 | <field name="type_tax_use">purchase</field> | ||
1947 | 4310 | </record> | ||
1948 | 4275 | <record id="btw_ink2_0" model="account.tax.template"> | 4311 | <record id="btw_ink2_0" model="account.tax.template"> |
1949 | 4312 | <field name="sequence">15</field> | ||
1950 | 4276 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4313 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1951 | 4277 | <field name="name">BTW te vorderen verlegd (inkopen)</field> | 4314 | <field name="name">BTW te vorderen verlegd (inkopen)</field> |
1954 | 4278 | <field name="description">19% BTW verlegd</field> | 4315 | <field name="description">21% BTW verlegd</field> |
1955 | 4279 | <field eval="0.19" name="amount"/> | 4316 | <field eval="0.21" name="amount"/> |
1956 | 4280 | <field name="type">percent</field> | 4317 | <field name="type">percent</field> |
1957 | 4281 | <field name="account_collected_id" ref="vat_refund_verlegd"/> | 4318 | <field name="account_collected_id" ref="vat_refund_verlegd"/> |
1959 | 4282 | <field name="account_paid_id" ref="vat_payable_verlegd"/> | 4319 | <field name="account_paid_id" ref="vat_refund_verlegd"/> |
1960 | 4283 | <field eval="omz_code_2a" name="base_code_id"/> | 4320 | <field eval="omz_code_2a" name="base_code_id"/> |
1961 | 4284 | <field eval="omz_code_2a" name="ref_base_code_id"/> | 4321 | <field eval="omz_code_2a" name="ref_base_code_id"/> |
1962 | 4322 | <field name="ref_base_sign" eval="-1"/> | ||
1963 | 4323 | <field name="ref_tax_sign" eval="-1"/> | ||
1964 | 4285 | <field name="type_tax_use">purchase</field> | 4324 | <field name="type_tax_use">purchase</field> |
1965 | 4286 | <field eval="True" name="child_depend"/> | 4325 | <field eval="True" name="child_depend"/> |
1966 | 4287 | </record> | 4326 | </record> |
1991 | 4288 | <record id="btw_ink2_0_1" model="account.tax.template"> | 4327 | <record id="btw_ink2_0_1" model="account.tax.template"> |
1992 | 4289 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4328 | <field name="sequence">99</field> |
1993 | 4290 | <field name="name">BTW te vorderen verlegd (inkopen1)</field> | 4329 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
1994 | 4291 | <field eval="1.00" name="amount"/> | 4330 | <field name="name">BTW te vorderen verlegd (inkopen1)</field> |
1995 | 4292 | <field name="type">percent</field> | 4331 | <field eval="1.00" name="amount"/> |
1996 | 4293 | <field eval="btw_ink2_0" name="parent_id"/> | 4332 | <field name="type">percent</field> |
1997 | 4294 | <field name="account_collected_id" ref="vat_refund_verlegd"/> | 4333 | <field eval="btw_ink2_0" name="parent_id"/> |
1998 | 4295 | <field name="account_paid_id" ref="vat_payable_verlegd"/> | 4334 | <field name="account_collected_id" ref="vat_refund_verlegd"/> |
1999 | 4296 | <field eval="btw_code_2a" name="tax_code_id"/> | 4335 | <field name="account_paid_id" ref="vat_refund_verlegd"/> |
2000 | 4297 | <field eval="btw_code_2a" name="ref_tax_code_id"/> | 4336 | <field eval="btw_code_2a" name="tax_code_id"/> |
2001 | 4298 | <field name="type_tax_use">purchase</field> | 4337 | <field eval="btw_code_2a" name="ref_tax_code_id"/> |
2002 | 4299 | </record> | 4338 | <field name="ref_base_sign" eval="-1"/> |
2003 | 4300 | <record id="btw_ink2_0_2" model="account.tax.template"> | 4339 | <field name="ref_tax_sign" eval="-1"/> |
2004 | 4301 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4340 | <field name="type_tax_use">purchase</field> |
2005 | 4302 | <field name="name">BTW te vorderen verlegd (inkopen2)</field> | 4341 | </record> |
2006 | 4303 | <field eval="-1.00" name="amount"/> | 4342 | <record id="btw_ink2_0_2" model="account.tax.template"> |
2007 | 4304 | <field name="type">percent</field> | 4343 | <field name="sequence">99</field> |
2008 | 4305 | <field eval="btw_ink2_0" name="parent_id"/> | 4344 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2009 | 4306 | <field name="account_collected_id" ref="vat_refund_verlegd"/> | 4345 | <field name="name">BTW te vorderen verlegd (inkopen2)</field> |
2010 | 4307 | <field name="account_paid_id" ref="vat_payable_verlegd"/> | 4346 | <field eval="-1.00" name="amount"/> |
2011 | 4308 | <field eval="btw_code_5b" name="tax_code_id"/> | 4347 | <field name="type">percent</field> |
2012 | 4309 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | 4348 | <field eval="btw_ink2_0" name="parent_id"/> |
2013 | 4310 | <field name="type_tax_use">purchase</field> | 4349 | <field name="account_collected_id" ref="vat_refund_verlegd"/> |
2014 | 4311 | </record> | 4350 | <field name="account_paid_id" ref="vat_refund_verlegd"/> |
2015 | 4351 | <field eval="btw_code_5b" name="tax_code_id"/> | ||
2016 | 4352 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | ||
2017 | 4353 | <field name="ref_base_sign" eval="-1"/> | ||
2018 | 4354 | <field name="ref_tax_sign" eval="-1"/> | ||
2019 | 4355 | <field name="type_tax_use">purchase</field> | ||
2020 | 4356 | </record> | ||
2021 | 4312 | <!-- Binnen de EU --> | 4357 | <!-- Binnen de EU --> |
2022 | 4313 | <!-- BTW inkoop --> | 4358 | <!-- BTW inkoop --> |
2023 | 4314 | <record id="btw_I_6" model="account.tax.template"> | 4359 | <record id="btw_I_6" model="account.tax.template"> |
2024 | 4360 | <field name="sequence">20</field> | ||
2025 | 4315 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4361 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2026 | 4316 | <field name="name">Inkopen import binnen EU laag</field> | 4362 | <field name="name">Inkopen import binnen EU laag</field> |
2028 | 4317 | <field name="description">6% BTW import binnen EU</field> | 4363 | <field name="description">6% BTW import binnen EU</field> |
2029 | 4318 | <field eval="0.06" name="amount"/> | 4364 | <field eval="0.06" name="amount"/> |
2030 | 4319 | <field name="type">percent</field> | 4365 | <field name="type">percent</field> |
2031 | 4320 | <field eval="True" name="child_depend"/> | 4366 | <field eval="True" name="child_depend"/> |
2032 | 4321 | <field eval="omz_code_4b" name="base_code_id"/> | 4367 | <field eval="omz_code_4b" name="base_code_id"/> |
2033 | 4322 | <field eval="omz_code_4b" name="ref_base_code_id"/> | 4368 | <field eval="omz_code_4b" name="ref_base_code_id"/> |
2034 | 4369 | <field name="ref_base_sign" eval="-1"/> | ||
2035 | 4370 | <field name="ref_tax_sign" eval="-1"/> | ||
2036 | 4323 | <field name="type_tax_use">purchase</field> | 4371 | <field name="type_tax_use">purchase</field> |
2037 | 4324 | </record> | 4372 | </record> |
2063 | 4325 | <record id="btw_I_6_1" model="account.tax.template"> | 4373 | <record id="btw_I_6_1" model="account.tax.template"> |
2064 | 4326 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4374 | <field name="sequence">99</field> |
2065 | 4327 | <field name="name">Inkopen import binnen EU laag(1)</field> | 4375 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2066 | 4328 | <field eval="1.00" name="amount"/> | 4376 | <field name="name">Inkopen import binnen EU laag(1)</field> |
2067 | 4329 | <field name="type">percent</field> | 4377 | <field eval="-1.00" name="amount"/> |
2068 | 4330 | <field name="parent_id" ref="btw_I_6"/> | 4378 | <field name="type">percent</field> |
2069 | 4331 | <field name="account_collected_id" ref="vat_payable6"/> | 4379 | <field name="parent_id" ref="btw_I_6"/> |
2070 | 4332 | <field name="account_paid_id" ref="vat_payable6"/> | 4380 | <field name="account_collected_id" ref="vat_payable_low"/> |
2071 | 4333 | <field eval="btw_code_4b" name="tax_code_id"/> | 4381 | <field name="account_paid_id" ref="vat_payable_low"/> |
2072 | 4334 | <field eval="btw_code_4b" name="ref_tax_code_id"/> | 4382 | <field eval="btw_code_4b" name="tax_code_id"/> |
2073 | 4335 | <field name="type_tax_use">purchase</field> | 4383 | <field eval="btw_code_4b" name="ref_tax_code_id"/> |
2074 | 4336 | </record> | 4384 | <field name="ref_base_sign" eval="-1"/> |
2075 | 4337 | <record id="btw_I_6_2" model="account.tax.template"> | 4385 | <field name="ref_tax_sign" eval="-1"/> |
2076 | 4338 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4386 | <field name="type_tax_use">purchase</field> |
2077 | 4339 | <field name="name">Inkopen import binnen EU laag(2)</field> | 4387 | </record> |
2078 | 4340 | <field eval="-1.00" name="amount"/> | 4388 | <record id="btw_I_6_2" model="account.tax.template"> |
2079 | 4341 | <field name="type">percent</field> | 4389 | <field name="sequence">99</field> |
2080 | 4342 | <field name="parent_id" ref="btw_I_6"/> | 4390 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2081 | 4343 | <field name="account_collected_id" ref="vat_refund6"/> | 4391 | <field name="name">Inkopen import binnen EU laag(2)</field> |
2082 | 4344 | <field name="account_paid_id" ref="vat_refund6"/> | 4392 | <field eval="1.00" name="amount"/> |
2083 | 4345 | <field eval="btw_code_5b" name="tax_code_id"/> | 4393 | <field name="type">percent</field> |
2084 | 4346 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | 4394 | <field name="parent_id" ref="btw_I_6"/> |
2085 | 4347 | <field name="type_tax_use">purchase</field> | 4395 | <field name="account_collected_id" ref="vat_refund_low"/> |
2086 | 4348 | </record> | 4396 | <field name="account_paid_id" ref="vat_refund_low"/> |
2087 | 4349 | <record id="btw_I_19" model="account.tax.template"> | 4397 | <field eval="btw_code_5b" name="tax_code_id"/> |
2088 | 4398 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | ||
2089 | 4399 | <field name="ref_base_sign" eval="-1"/> | ||
2090 | 4400 | <field name="ref_tax_sign" eval="-1"/> | ||
2091 | 4401 | <field name="type_tax_use">purchase</field> | ||
2092 | 4402 | </record> | ||
2093 | 4403 | <record id="btw_I_21" model="account.tax.template"> | ||
2094 | 4404 | <field name="sequence">20</field> | ||
2095 | 4350 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4405 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2096 | 4351 | <field name="name">Inkopen import binnen EU hoog</field> | 4406 | <field name="name">Inkopen import binnen EU hoog</field> |
2099 | 4352 | <field name="description">19% BTW import binnen EU</field> | 4407 | <field name="description">21% BTW import binnen EU</field> |
2100 | 4353 | <field eval="0.19" name="amount"/> | 4408 | <field eval="0.21" name="amount"/> |
2101 | 4354 | <field name="type">percent</field> | 4409 | <field name="type">percent</field> |
2102 | 4355 | <field eval="True" name="child_depend"/> | 4410 | <field eval="True" name="child_depend"/> |
2103 | 4356 | <field eval="omz_code_4b" name="base_code_id"/> | 4411 | <field eval="omz_code_4b" name="base_code_id"/> |
2104 | 4357 | <field eval="omz_code_4b" name="ref_base_code_id"/> | 4412 | <field eval="omz_code_4b" name="ref_base_code_id"/> |
2105 | 4413 | <field name="ref_base_sign" eval="-1"/> | ||
2106 | 4414 | <field name="ref_tax_sign" eval="-1"/> | ||
2107 | 4358 | <field name="type_tax_use">purchase</field> | 4415 | <field name="type_tax_use">purchase</field> |
2108 | 4359 | </record> | 4416 | </record> |
2133 | 4360 | <record id="btw_I_19_1" model="account.tax.template"> | 4417 | <record id="btw_I_21_1" model="account.tax.template"> |
2134 | 4361 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4418 | <field name="sequence">99</field> |
2135 | 4362 | <field name="name">Inkopen import binnen EU hoog(1)</field> | 4419 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2136 | 4363 | <field eval="1.00" name="amount"/> | 4420 | <field name="name">Inkopen import binnen EU hoog(1)</field> |
2137 | 4364 | <field name="type">percent</field> | 4421 | <field eval="-1.00" name="amount"/> |
2138 | 4365 | <field name="parent_id" ref="btw_I_19"/> | 4422 | <field name="type">percent</field> |
2139 | 4366 | <field name="account_collected_id" ref="vat_payable19"/> | 4423 | <field name="parent_id" ref="btw_I_21"/> |
2140 | 4367 | <field name="account_paid_id" ref="vat_payable19"/> | 4424 | <field name="account_collected_id" ref="vat_payable_high"/> |
2141 | 4368 | <field eval="btw_code_4b" name="tax_code_id"/> | 4425 | <field name="account_paid_id" ref="vat_payable_high"/> |
2142 | 4369 | <field eval="btw_code_4b" name="ref_tax_code_id"/> | 4426 | <field eval="btw_code_4b" name="tax_code_id"/> |
2143 | 4370 | <field name="type_tax_use">purchase</field> | 4427 | <field eval="btw_code_4b" name="ref_tax_code_id"/> |
2144 | 4371 | </record> | 4428 | <field name="ref_base_sign" eval="-1"/> |
2145 | 4372 | <record id="btw_I_19_2" model="account.tax.template"> | 4429 | <field name="ref_tax_sign" eval="-1"/> |
2146 | 4373 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4430 | <field name="type_tax_use">purchase</field> |
2147 | 4374 | <field name="name">Inkopen import binnen EU hoog(2)</field> | 4431 | </record> |
2148 | 4375 | <field eval="-1.00" name="amount"/> | 4432 | <record id="btw_I_21_2" model="account.tax.template"> |
2149 | 4376 | <field name="type">percent</field> | 4433 | <field name="sequence">99</field> |
2150 | 4377 | <field name="parent_id" ref="btw_I_19"/> | 4434 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2151 | 4378 | <field name="account_collected_id" ref="vat_refund19"/> | 4435 | <field name="name">Inkopen import binnen EU hoog(2)</field> |
2152 | 4379 | <field name="account_paid_id" ref="vat_refund19"/> | 4436 | <field eval="1.00" name="amount"/> |
2153 | 4380 | <field eval="btw_code_5b" name="tax_code_id"/> | 4437 | <field name="type">percent</field> |
2154 | 4381 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | 4438 | <field name="parent_id" ref="btw_I_21"/> |
2155 | 4382 | <field name="type_tax_use">purchase</field> | 4439 | <field name="account_collected_id" ref="vat_refund_high"/> |
2156 | 4383 | </record> | 4440 | <field name="account_paid_id" ref="vat_refund_high"/> |
2157 | 4441 | <field eval="btw_code_5b" name="tax_code_id"/> | ||
2158 | 4442 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | ||
2159 | 4443 | <field name="ref_base_sign" eval="-1"/> | ||
2160 | 4444 | <field name="ref_tax_sign" eval="-1"/> | ||
2161 | 4445 | <field name="type_tax_use">purchase</field> | ||
2162 | 4446 | </record> | ||
2163 | 4384 | <record id="btw_I_overig" model="account.tax.template"> | 4447 | <record id="btw_I_overig" model="account.tax.template"> |
2164 | 4448 | <field name="sequence">20</field> | ||
2165 | 4385 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4449 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2166 | 4386 | <field name="name">Inkopen import binnen EU overig</field> | 4450 | <field name="name">Inkopen import binnen EU overig</field> |
2168 | 4387 | <field name="description">0% BTW import binnen EU</field> | 4451 | <field name="description">0% BTW import binnen EU</field> |
2169 | 4388 | <field eval="0.00" name="amount"/> | 4452 | <field eval="0.00" name="amount"/> |
2170 | 4389 | <field name="type">percent</field> | 4453 | <field name="type">percent</field> |
2171 | 4390 | <field eval="True" name="child_depend"/> | 4454 | <field eval="True" name="child_depend"/> |
2172 | 4391 | <field eval="omz_code_4b" name="base_code_id"/> | 4455 | <field eval="omz_code_4b" name="base_code_id"/> |
2173 | 4392 | <field eval="omz_code_4b" name="ref_base_code_id"/> | 4456 | <field eval="omz_code_4b" name="ref_base_code_id"/> |
2174 | 4457 | <field name="ref_base_sign" eval="-1"/> | ||
2175 | 4458 | <field name="ref_tax_sign" eval="-1"/> | ||
2176 | 4393 | <field name="type_tax_use">purchase</field> | 4459 | <field name="type_tax_use">purchase</field> |
2177 | 4394 | </record> | 4460 | </record> |
2203 | 4395 | <record id="btw_I_overig_1" model="account.tax.template"> | 4461 | <record id="btw_I_overig_1" model="account.tax.template"> |
2204 | 4396 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4462 | <field name="sequence">99</field> |
2205 | 4397 | <field name="name">Inkopen import binnen EU overig(1)</field> | 4463 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2206 | 4398 | <field eval="1.00" name="amount"/> | 4464 | <field name="name">Inkopen import binnen EU overig(1)</field> |
2207 | 4399 | <field name="type">percent</field> | 4465 | <field eval="-1.00" name="amount"/> |
2208 | 4400 | <field name="parent_id" ref="btw_I_overig"/> | 4466 | <field name="type">percent</field> |
2209 | 4401 | <field name="account_collected_id" ref="vat_payable19"/> | 4467 | <field name="parent_id" ref="btw_I_overig"/> |
2210 | 4402 | <field name="account_paid_id" ref="vat_payable19"/> | 4468 | <field name="account_collected_id" ref="vat_payable_high"/> |
2211 | 4403 | <field eval="btw_code_4b" name="tax_code_id"/> | 4469 | <field name="account_paid_id" ref="vat_payable_high"/> |
2212 | 4404 | <field eval="btw_code_4b" name="ref_tax_code_id"/> | 4470 | <field eval="btw_code_4b" name="tax_code_id"/> |
2213 | 4405 | <field name="type_tax_use">purchase</field> | 4471 | <field eval="btw_code_4b" name="ref_tax_code_id"/> |
2214 | 4406 | </record> | 4472 | <field name="ref_base_sign" eval="-1"/> |
2215 | 4407 | <record id="btw_I_overig_2" model="account.tax.template"> | 4473 | <field name="ref_tax_sign" eval="-1"/> |
2216 | 4408 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4474 | <field name="type_tax_use">purchase</field> |
2217 | 4409 | <field name="name">Inkopen import binnen EU overig(2)</field> | 4475 | </record> |
2218 | 4410 | <field eval="-1.00" name="amount"/> | 4476 | <record id="btw_I_overig_2" model="account.tax.template"> |
2219 | 4411 | <field name="type">percent</field> | 4477 | <field name="sequence">99</field> |
2220 | 4412 | <field name="parent_id" ref="btw_I_overig"/> | 4478 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2221 | 4413 | <field name="account_collected_id" ref="vat_refund19"/> | 4479 | <field name="name">Inkopen import binnen EU overig(2)</field> |
2222 | 4414 | <field name="account_paid_id" ref="vat_refund19"/> | 4480 | <field eval="1.00" name="amount"/> |
2223 | 4415 | <field eval="btw_code_5b" name="tax_code_id"/> | 4481 | <field name="type">percent</field> |
2224 | 4416 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | 4482 | <field name="parent_id" ref="btw_I_overig"/> |
2225 | 4417 | <field name="type_tax_use">purchase</field> | 4483 | <field name="account_collected_id" ref="vat_refund_high"/> |
2226 | 4418 | </record> | 4484 | <field name="account_paid_id" ref="vat_refund_high"/> |
2227 | 4419 | <!-- BTW verkoop --> | 4485 | <field eval="btw_code_5b" name="tax_code_id"/> |
2228 | 4486 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | ||
2229 | 4487 | <field name="ref_base_sign" eval="-1"/> | ||
2230 | 4488 | <field name="ref_tax_sign" eval="-1"/> | ||
2231 | 4489 | <field name="type_tax_use">purchase</field> | ||
2232 | 4490 | </record> | ||
2233 | 4491 | <!-- BTW verkoop --> | ||
2234 | 4420 | <record id="btw_X0" model="account.tax.template"> | 4492 | <record id="btw_X0" model="account.tax.template"> |
2235 | 4493 | <field name="sequence">20</field> | ||
2236 | 4421 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4494 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2237 | 4422 | <field name="name">Verkopen export binnen EU</field> | 4495 | <field name="name">Verkopen export binnen EU</field> |
2239 | 4423 | <field name="description">BTW export binnen EU</field> | 4496 | <field name="description">BTW export binnen EU</field> |
2240 | 4424 | <field eval="0.00" name="amount"/> | 4497 | <field eval="0.00" name="amount"/> |
2241 | 4425 | <field name="type">percent</field> | 4498 | <field name="type">percent</field> |
2242 | 4426 | <field name="account_collected_id" ref="vat_payable0"/> | 4499 | <field name="account_collected_id" ref="vat_payable0"/> |
2244 | 4427 | <field name="account_paid_id" ref="vat_refund0"/> | 4500 | <field name="account_paid_id" ref="vat_payable0"/> |
2245 | 4428 | <field name="base_code_id" ref="omz_code_3b"/> | 4501 | <field name="base_code_id" ref="omz_code_3b"/> |
2246 | 4429 | <field name="ref_base_code_id" ref="omz_code_3b"/> | 4502 | <field name="ref_base_code_id" ref="omz_code_3b"/> |
2247 | 4503 | <field name="ref_base_sign" eval="-1"/> | ||
2248 | 4504 | <field name="ref_tax_sign" eval="-1"/> | ||
2249 | 4430 | <field name="type_tax_use">sale</field> | 4505 | <field name="type_tax_use">sale</field> |
2250 | 4431 | </record> | 4506 | </record> |
2251 | 4432 | <record id="btw_X2" model="account.tax.template"> | 4507 | <record id="btw_X2" model="account.tax.template"> |
2252 | 4508 | <field name="sequence">20</field> | ||
2253 | 4433 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4509 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2254 | 4434 | <field name="name">Installatie/afstandsverkopen binnen EU</field> | 4510 | <field name="name">Installatie/afstandsverkopen binnen EU</field> |
2256 | 4435 | <field name="description">Inst./afst.verkopen binnen EU</field> | 4511 | <field name="description">Inst./afst.verkopen binnen EU</field> |
2257 | 4436 | <field eval="0.00" name="amount"/> | 4512 | <field eval="0.00" name="amount"/> |
2258 | 4437 | <field name="type">percent</field> | 4513 | <field name="type">percent</field> |
2259 | 4438 | <field name="account_collected_id" ref="vat_payable0"/> | 4514 | <field name="account_collected_id" ref="vat_payable0"/> |
2261 | 4439 | <field name="account_paid_id" ref="vat_refund0"/> | 4515 | <field name="account_paid_id" ref="vat_payable0"/> |
2262 | 4440 | <field name="base_code_id" ref="omz_code_3c"/> | 4516 | <field name="base_code_id" ref="omz_code_3c"/> |
2263 | 4441 | <field name="ref_base_code_id" ref="omz_code_3c"/> | 4517 | <field name="ref_base_code_id" ref="omz_code_3c"/> |
2264 | 4518 | <field name="ref_base_sign" eval="-1"/> | ||
2265 | 4519 | <field name="ref_tax_sign" eval="-1"/> | ||
2266 | 4442 | <field name="type_tax_use">sale</field> | 4520 | <field name="type_tax_use">sale</field> |
2267 | 4443 | </record> | 4521 | </record> |
2268 | 4444 | 4522 | ||
2269 | 4445 | <!-- Buiten de EU --> | 4523 | <!-- Buiten de EU --> |
2270 | 4446 | <!-- BTW inkoop --> | 4524 | <!-- BTW inkoop --> |
2271 | 4447 | <record id="btw_E1" model="account.tax.template"> | 4525 | <record id="btw_E1" model="account.tax.template"> |
2272 | 4526 | <field name="sequence">20</field> | ||
2273 | 4448 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4527 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2274 | 4449 | <field name="name">Inkopen import buiten EU laag</field> | 4528 | <field name="name">Inkopen import buiten EU laag</field> |
2276 | 4450 | <field name="description">BTW import buiten EU</field> | 4529 | <field name="description">BTW import buiten EU</field> |
2277 | 4451 | <field eval="0.06" name="amount"/> | 4530 | <field eval="0.06" name="amount"/> |
2278 | 4452 | <field name="type">percent</field> | 4531 | <field name="type">percent</field> |
2279 | 4453 | <field eval="True" name="child_depend"/> | 4532 | <field eval="True" name="child_depend"/> |
2280 | 4454 | <field eval="omz_code_4a" name="base_code_id"/> | 4533 | <field eval="omz_code_4a" name="base_code_id"/> |
2281 | 4455 | <field eval="omz_code_4a" name="ref_base_code_id"/> | 4534 | <field eval="omz_code_4a" name="ref_base_code_id"/> |
2282 | 4535 | <field name="ref_base_sign" eval="-1"/> | ||
2283 | 4536 | <field name="ref_tax_sign" eval="-1"/> | ||
2284 | 4456 | <field name="type_tax_use">purchase</field> | 4537 | <field name="type_tax_use">purchase</field> |
2285 | 4457 | </record> | 4538 | </record> |
2310 | 4458 | <record id="btw_E1_1" model="account.tax.template"> | 4539 | <record id="btw_E1_1" model="account.tax.template"> |
2311 | 4459 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4540 | <field name="sequence">99</field> |
2312 | 4460 | <field name="name">Inkopen import buiten EU laag(1)</field> | 4541 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2313 | 4461 | <field eval="1.00" name="amount"/> | 4542 | <field name="name">Inkopen import buiten EU laag(1)</field> |
2314 | 4462 | <field name="type">percent</field> | 4543 | <field eval="-1.00" name="amount"/> |
2315 | 4463 | <field name="parent_id" ref="btw_E1"/> | 4544 | <field name="type">percent</field> |
2316 | 4464 | <field name="account_collected_id" ref="vat_payable6"/> | 4545 | <field name="parent_id" ref="btw_E1"/> |
2317 | 4465 | <field name="account_paid_id" ref="vat_payable6"/> | 4546 | <field name="account_collected_id" ref="vat_payable_low"/> |
2318 | 4466 | <field eval="btw_code_4a" name="tax_code_id"/> | 4547 | <field name="account_paid_id" ref="vat_payable_low"/> |
2319 | 4467 | <field eval="btw_code_4a" name="ref_tax_code_id"/> | 4548 | <field eval="btw_code_4a" name="tax_code_id"/> |
2320 | 4468 | <field name="type_tax_use">purchase</field> | 4549 | <field eval="btw_code_4a" name="ref_tax_code_id"/> |
2321 | 4469 | </record> | 4550 | <field name="ref_base_sign" eval="-1"/> |
2322 | 4470 | <record id="btw_E1_2" model="account.tax.template"> | 4551 | <field name="ref_tax_sign" eval="-1"/> |
2323 | 4471 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4552 | <field name="type_tax_use">purchase</field> |
2324 | 4472 | <field name="name">Inkopen import buiten EU laag(2)</field> | 4553 | </record> |
2325 | 4473 | <field eval="-1.00" name="amount"/> | 4554 | <record id="btw_E1_2" model="account.tax.template"> |
2326 | 4474 | <field name="type">percent</field> | 4555 | <field name="sequence">99</field> |
2327 | 4475 | <field name="parent_id" ref="btw_E1"/> | 4556 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2328 | 4476 | <field name="account_collected_id" ref="vat_refund6"/> | 4557 | <field name="name">Inkopen import buiten EU laag(2)</field> |
2329 | 4477 | <field name="account_paid_id" ref="vat_refund6"/> | 4558 | <field eval="1.00" name="amount"/> |
2330 | 4478 | <field eval="btw_code_5b" name="tax_code_id"/> | 4559 | <field name="type">percent</field> |
2331 | 4479 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | 4560 | <field name="parent_id" ref="btw_E1"/> |
2332 | 4480 | <field name="type_tax_use">purchase</field> | 4561 | <field name="account_collected_id" ref="vat_refund_low"/> |
2333 | 4481 | </record> | 4562 | <field name="account_paid_id" ref="vat_refund_low"/> |
2334 | 4563 | <field eval="btw_code_5b" name="tax_code_id"/> | ||
2335 | 4564 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | ||
2336 | 4565 | <field name="ref_base_sign" eval="-1"/> | ||
2337 | 4566 | <field name="ref_tax_sign" eval="-1"/> | ||
2338 | 4567 | <field name="type_tax_use">purchase</field> | ||
2339 | 4568 | </record> | ||
2340 | 4482 | <record id="btw_E2" model="account.tax.template"> | 4569 | <record id="btw_E2" model="account.tax.template"> |
2341 | 4570 | <field name="sequence">20</field> | ||
2342 | 4483 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4571 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2343 | 4484 | <field name="name">Inkopen import buiten EU hoog</field> | 4572 | <field name="name">Inkopen import buiten EU hoog</field> |
2346 | 4485 | <field name="description">BTW import buiten EU</field> | 4573 | <field name="description">BTW import buiten EU</field> |
2347 | 4486 | <field eval="0.19" name="amount"/> | 4574 | <field eval="0.21" name="amount"/> |
2348 | 4487 | <field name="type">percent</field> | 4575 | <field name="type">percent</field> |
2349 | 4488 | <field eval="True" name="child_depend"/> | 4576 | <field eval="True" name="child_depend"/> |
2350 | 4489 | <field eval="omz_code_4a" name="base_code_id"/> | 4577 | <field eval="omz_code_4a" name="base_code_id"/> |
2351 | 4490 | <field eval="omz_code_4a" name="ref_base_code_id"/> | 4578 | <field eval="omz_code_4a" name="ref_base_code_id"/> |
2352 | 4579 | <field name="ref_base_sign" eval="-1"/> | ||
2353 | 4580 | <field name="ref_tax_sign" eval="-1"/> | ||
2354 | 4491 | <field name="type_tax_use">purchase</field> | 4581 | <field name="type_tax_use">purchase</field> |
2355 | 4492 | </record> | 4582 | </record> |
2380 | 4493 | <record id="btw_E2_1" model="account.tax.template"> | 4583 | <record id="btw_E2_1" model="account.tax.template"> |
2381 | 4494 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4584 | <field name="sequence">99</field> |
2382 | 4495 | <field name="name">Inkopen import buiten EU hoog(1)</field> | 4585 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2383 | 4496 | <field eval="1.00" name="amount"/> | 4586 | <field name="name">Inkopen import buiten EU hoog(1)</field> |
2384 | 4497 | <field name="type">percent</field> | 4587 | <field eval="-1.00" name="amount"/> |
2385 | 4498 | <field name="parent_id" ref="btw_E2"/> | 4588 | <field name="type">percent</field> |
2386 | 4499 | <field name="account_collected_id" ref="vat_payable19"/> | 4589 | <field name="parent_id" ref="btw_E2"/> |
2387 | 4500 | <field name="account_paid_id" ref="vat_payable19"/> | 4590 | <field name="account_collected_id" ref="vat_payable_high"/> |
2388 | 4501 | <field eval="btw_code_4a" name="tax_code_id"/> | 4591 | <field name="account_paid_id" ref="vat_payable_high"/> |
2389 | 4502 | <field eval="btw_code_4a" name="ref_tax_code_id"/> | 4592 | <field eval="btw_code_4a" name="tax_code_id"/> |
2390 | 4503 | <field name="type_tax_use">purchase</field> | 4593 | <field eval="btw_code_4a" name="ref_tax_code_id"/> |
2391 | 4504 | </record> | 4594 | <field name="ref_base_sign" eval="-1"/> |
2392 | 4505 | <record id="btw_E2_2" model="account.tax.template"> | 4595 | <field name="ref_tax_sign" eval="-1"/> |
2393 | 4506 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4596 | <field name="type_tax_use">purchase</field> |
2394 | 4507 | <field name="name">Inkopen import buiten EU hoog(2)</field> | 4597 | </record> |
2395 | 4508 | <field eval="-1.00" name="amount"/> | 4598 | <record id="btw_E2_2" model="account.tax.template"> |
2396 | 4509 | <field name="type">percent</field> | 4599 | <field name="sequence">99</field> |
2397 | 4510 | <field name="parent_id" ref="btw_E2"/> | 4600 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2398 | 4511 | <field name="account_collected_id" ref="vat_refund19"/> | 4601 | <field name="name">Inkopen import buiten EU hoog(2)</field> |
2399 | 4512 | <field name="account_paid_id" ref="vat_refund19"/> | 4602 | <field eval="1.00" name="amount"/> |
2400 | 4513 | <field eval="btw_code_5b" name="tax_code_id"/> | 4603 | <field name="type">percent</field> |
2401 | 4514 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | 4604 | <field name="parent_id" ref="btw_E2"/> |
2402 | 4515 | <field name="type_tax_use">purchase</field> | 4605 | <field name="account_collected_id" ref="vat_refund_high"/> |
2403 | 4516 | </record> | 4606 | <field name="account_paid_id" ref="vat_refund_high"/> |
2404 | 4607 | <field eval="btw_code_5b" name="tax_code_id"/> | ||
2405 | 4608 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | ||
2406 | 4609 | <field name="ref_base_sign" eval="-1"/> | ||
2407 | 4610 | <field name="ref_tax_sign" eval="-1"/> | ||
2408 | 4611 | <field name="type_tax_use">purchase</field> | ||
2409 | 4612 | </record> | ||
2410 | 4517 | <record id="btw_E_overig" model="account.tax.template"> | 4613 | <record id="btw_E_overig" model="account.tax.template"> |
2411 | 4614 | <field name="sequence">20</field> | ||
2412 | 4518 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4615 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2413 | 4519 | <field name="name">Inkopen import buiten EU overig</field> | 4616 | <field name="name">Inkopen import buiten EU overig</field> |
2416 | 4520 | <field name="description">BTW import buiten EU</field> | 4617 | <field name="description">BTW import buiten EU</field> |
2417 | 4521 | <field eval="0.19" name="amount"/> | 4618 | <field eval="0.21" name="amount"/> |
2418 | 4522 | <field name="type">percent</field> | 4619 | <field name="type">percent</field> |
2419 | 4523 | <field eval="True" name="child_depend"/> | 4620 | <field eval="True" name="child_depend"/> |
2420 | 4524 | <field eval="omz_code_4a" name="base_code_id"/> | 4621 | <field eval="omz_code_4a" name="base_code_id"/> |
2421 | 4525 | <field eval="omz_code_4a" name="ref_base_code_id"/> | 4622 | <field eval="omz_code_4a" name="ref_base_code_id"/> |
2422 | 4623 | <field name="ref_base_sign" eval="-1"/> | ||
2423 | 4624 | <field name="ref_tax_sign" eval="-1"/> | ||
2424 | 4526 | <field name="type_tax_use">purchase</field> | 4625 | <field name="type_tax_use">purchase</field> |
2425 | 4527 | </record> | 4626 | </record> |
2450 | 4528 | <record id="btw_E_overig_1" model="account.tax.template"> | 4627 | <record id="btw_E_overig_1" model="account.tax.template"> |
2451 | 4529 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4628 | <field name="sequence">99</field> |
2452 | 4530 | <field name="name">Inkopen import buiten EU overig(1)</field> | 4629 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2453 | 4531 | <field eval="1.00" name="amount"/> | 4630 | <field name="name">Inkopen import buiten EU overig(1)</field> |
2454 | 4532 | <field name="type">percent</field> | 4631 | <field eval="-1.00" name="amount"/> |
2455 | 4533 | <field name="parent_id" ref="btw_E_overig"/> | 4632 | <field name="type">percent</field> |
2456 | 4534 | <field name="account_collected_id" ref="vat_payable19"/> | 4633 | <field name="parent_id" ref="btw_E_overig"/> |
2457 | 4535 | <field name="account_paid_id" ref="vat_payable19"/> | 4634 | <field name="account_collected_id" ref="vat_payable_high"/> |
2458 | 4536 | <field eval="btw_code_4a" name="tax_code_id"/> | 4635 | <field name="account_paid_id" ref="vat_payable_high"/> |
2459 | 4537 | <field eval="btw_code_4a" name="ref_tax_code_id"/> | 4636 | <field eval="btw_code_4a" name="tax_code_id"/> |
2460 | 4538 | <field name="type_tax_use">purchase</field> | 4637 | <field eval="btw_code_4a" name="ref_tax_code_id"/> |
2461 | 4539 | </record> | 4638 | <field name="ref_base_sign" eval="-1"/> |
2462 | 4540 | <record id="btw_E_overig_2" model="account.tax.template"> | 4639 | <field name="ref_tax_sign" eval="-1"/> |
2463 | 4541 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4640 | <field name="type_tax_use">purchase</field> |
2464 | 4542 | <field name="name">Inkopen import buiten EU overig(2)</field> | 4641 | </record> |
2465 | 4543 | <field eval="-1.00" name="amount"/> | 4642 | <record id="btw_E_overig_2" model="account.tax.template"> |
2466 | 4544 | <field name="type">percent</field> | 4643 | <field name="sequence">99</field> |
2467 | 4545 | <field name="parent_id" ref="btw_E_overig"/> | 4644 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2468 | 4546 | <field name="account_collected_id" ref="vat_refund19"/> | 4645 | <field name="name">Inkopen import buiten EU overig(2)</field> |
2469 | 4547 | <field name="account_paid_id" ref="vat_refund19"/> | 4646 | <field eval="1.00" name="amount"/> |
2470 | 4548 | <field eval="btw_code_5b" name="tax_code_id"/> | 4647 | <field name="type">percent</field> |
2471 | 4549 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | 4648 | <field name="parent_id" ref="btw_E_overig"/> |
2472 | 4550 | <field name="type_tax_use">purchase</field> | 4649 | <field name="account_collected_id" ref="vat_refund_high"/> |
2473 | 4551 | </record> | 4650 | <field name="account_paid_id" ref="vat_refund_high"/> |
2474 | 4651 | <field eval="btw_code_5b" name="tax_code_id"/> | ||
2475 | 4652 | <field eval="btw_code_5b" name="ref_tax_code_id"/> | ||
2476 | 4653 | <field name="ref_base_sign" eval="-1"/> | ||
2477 | 4654 | <field name="ref_tax_sign" eval="-1"/> | ||
2478 | 4655 | <field name="type_tax_use">purchase</field> | ||
2479 | 4656 | </record> | ||
2480 | 4552 | <!-- BTW Verkoop --> | 4657 | <!-- BTW Verkoop --> |
2481 | 4553 | <record id="btw_X1" model="account.tax.template"> | 4658 | <record id="btw_X1" model="account.tax.template"> |
2482 | 4659 | <field name="sequence">20</field> | ||
2483 | 4554 | <field name="chart_template_id" ref="l10nnl_chart_template"/> | 4660 | <field name="chart_template_id" ref="l10nnl_chart_template"/> |
2484 | 4555 | <field name="name">Verkopen export buiten EU</field> | 4661 | <field name="name">Verkopen export buiten EU</field> |
2486 | 4556 | <field name="description">BTW export buiten EU</field> | 4662 | <field name="description">BTW export buiten EU</field> |
2487 | 4557 | <field eval="0.00" name="amount"/> | 4663 | <field eval="0.00" name="amount"/> |
2488 | 4558 | <field name="type">percent</field> | 4664 | <field name="type">percent</field> |
2489 | 4559 | <field name="account_collected_id" ref="vat_payable0"/> | 4665 | <field name="account_collected_id" ref="vat_payable0"/> |
2491 | 4560 | <field name="account_paid_id" ref="vat_refund0"/> | 4666 | <field name="account_paid_id" ref="vat_payable0"/> |
2492 | 4561 | <field name="base_code_id" ref="omz_code_3a"/> | 4667 | <field name="base_code_id" ref="omz_code_3a"/> |
2493 | 4562 | <field name="ref_base_code_id" ref="omz_code_3a"/> | 4668 | <field name="ref_base_code_id" ref="omz_code_3a"/> |
2494 | 4669 | <field name="ref_base_sign" eval="-1"/> | ||
2495 | 4670 | <field name="ref_tax_sign" eval="-1"/> | ||
2496 | 4563 | <field name="type_tax_use">sale</field> | 4671 | <field name="type_tax_use">sale</field> |
2497 | 4564 | </record> | 4672 | </record> |
2498 | 4565 | </data> | 4673 | </data> |
2499 | 4566 | 4674 | ||
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 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
2505 | 2 | <openerp> | ||
2506 | 3 | <data> | ||
2507 | 4 | <!-- Fiscal Position Account Templates --> | ||
2508 | 5 | |||
2509 | 6 | <!-- Position 2 - NON-EU Countries --> | ||
2510 | 7 | <!-- inkopen laag --> | ||
2511 | 8 | <record | ||
2512 | 9 | id="position_account_non_eu_purchase_low" | ||
2513 | 10 | model="account.fiscal.position.account.template"> | ||
2514 | 11 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2515 | 12 | <field name="account_src_id" ref="l10n_nl.a_7001" /> | ||
2516 | 13 | <field name="account_dest_id" ref="l10n_nl.a_7017" /> | ||
2517 | 14 | </record> | ||
2518 | 15 | <!-- inkopen hoog. NB: id not according to convention! --> | ||
2519 | 16 | <record | ||
2520 | 17 | id="position_account_non_eu_purchase_high" | ||
2521 | 18 | model="account.fiscal.position.account.template"> | ||
2522 | 19 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2523 | 20 | <field name="account_src_id" ref="l10n_nl.a_expense" /> | ||
2524 | 21 | <field name="account_dest_id" ref="l10n_nl.a_7018" /> | ||
2525 | 22 | </record> | ||
2526 | 23 | <!-- inkopen overig --> | ||
2527 | 24 | <record | ||
2528 | 25 | id="position_account_non_eu_purchase_other" | ||
2529 | 26 | model="account.fiscal.position.account.template"> | ||
2530 | 27 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2531 | 28 | <field name="account_src_id" ref="l10n_nl.a_7003" /> | ||
2532 | 29 | <field name="account_dest_id" ref="l10n_nl.a_7019" /> | ||
2533 | 30 | </record> | ||
2534 | 31 | <!-- verkopen fabricage --> | ||
2535 | 32 | <!-- verkopen laag --> | ||
2536 | 33 | <record | ||
2537 | 34 | id="position_account_non_eu_production_sales_low" | ||
2538 | 35 | model="account.fiscal.position.account.template"> | ||
2539 | 36 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2540 | 37 | <field name="account_src_id" ref="l10n_nl.a_8001" /> | ||
2541 | 38 | <field name="account_dest_id" ref="l10n_nl.a_8020" /> | ||
2542 | 39 | </record> | ||
2543 | 40 | <!-- verkopen hoog --> | ||
2544 | 41 | <record | ||
2545 | 42 | id="position_account_non_eu_production_sales_high" | ||
2546 | 43 | model="account.fiscal.position.account.template"> | ||
2547 | 44 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2548 | 45 | <field name="account_src_id" ref="l10n_nl.a_8002" /> | ||
2549 | 46 | <field name="account_dest_id" ref="l10n_nl.a_8020" /> | ||
2550 | 47 | </record> | ||
2551 | 48 | <!-- verkopen overig --> | ||
2552 | 49 | <record | ||
2553 | 50 | id="position_account_non_eu_sales_production_other" | ||
2554 | 51 | model="account.fiscal.position.account.template"> | ||
2555 | 52 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2556 | 53 | <field name="account_src_id" ref="l10n_nl.a_8003" /> | ||
2557 | 54 | <field name="account_dest_id" ref="l10n_nl.a_8020" /> | ||
2558 | 55 | </record> | ||
2559 | 56 | <!-- verkopen handel --> | ||
2560 | 57 | <!-- verkopen laag --> | ||
2561 | 58 | <record | ||
2562 | 59 | id="position_account_non_eu_sales_trade_low" | ||
2563 | 60 | model="account.fiscal.position.account.template"> | ||
2564 | 61 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2565 | 62 | <field name="account_src_id" ref="l10n_nl.a_8011" /> | ||
2566 | 63 | <field name="account_dest_id" ref="l10n_nl.a_8021" /> | ||
2567 | 64 | </record> | ||
2568 | 65 | <!-- verkopen hoog --> | ||
2569 | 66 | <record | ||
2570 | 67 | id="position_account_non_eu_sales_trade_high" | ||
2571 | 68 | model="account.fiscal.position.account.template"> | ||
2572 | 69 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2573 | 70 | <field name="account_src_id" ref="l10n_nl.a_sale" /> | ||
2574 | 71 | <field name="account_dest_id" ref="l10n_nl.a_8021" /> | ||
2575 | 72 | </record> | ||
2576 | 73 | <!-- verkopen overig --> | ||
2577 | 74 | <record | ||
2578 | 75 | id="position_account_non_eu_sales_trade_other" | ||
2579 | 76 | model="account.fiscal.position.account.template"> | ||
2580 | 77 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2581 | 78 | <field name="account_src_id" ref="l10n_nl.a_8013" /> | ||
2582 | 79 | <field name="account_dest_id" ref="l10n_nl.a_8021" /> | ||
2583 | 80 | </record> | ||
2584 | 81 | <!-- verkopen diensten fabricage --> | ||
2585 | 82 | <!-- verkopen laag --> | ||
2586 | 83 | <record | ||
2587 | 84 | id="position_account_non_eu_sales_service_production_low" | ||
2588 | 85 | model="account.fiscal.position.account.template"> | ||
2589 | 86 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2590 | 87 | <field name="account_src_id" ref="l10n_nl.a_8041" /> | ||
2591 | 88 | <field name="account_dest_id" ref="l10n_nl.a_8060" /> | ||
2592 | 89 | </record> | ||
2593 | 90 | <!-- verkopen hoog --> | ||
2594 | 91 | <record | ||
2595 | 92 | id="position_account_non_eu_sales_service_production_high" | ||
2596 | 93 | model="account.fiscal.position.account.template"> | ||
2597 | 94 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2598 | 95 | <field name="account_src_id" ref="l10n_nl.a_8042" /> | ||
2599 | 96 | <field name="account_dest_id" ref="l10n_nl.a_8060" /> | ||
2600 | 97 | </record> | ||
2601 | 98 | <!-- verkopen overig --> | ||
2602 | 99 | <record | ||
2603 | 100 | id="position_account_non_eu_sales_service_production_other" | ||
2604 | 101 | model="account.fiscal.position.account.template"> | ||
2605 | 102 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2606 | 103 | <field name="account_src_id" ref="l10n_nl.a_8043" /> | ||
2607 | 104 | <field name="account_dest_id" ref="l10n_nl.a_8060" /> | ||
2608 | 105 | </record> | ||
2609 | 106 | <!-- verkopen diensten handel --> | ||
2610 | 107 | <!-- verkopen laag --> | ||
2611 | 108 | <record | ||
2612 | 109 | id="position_account_non_eu_sales_service_trade_low" | ||
2613 | 110 | model="account.fiscal.position.account.template"> | ||
2614 | 111 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2615 | 112 | <field name="account_src_id" ref="l10n_nl.a_8051" /> | ||
2616 | 113 | <field name="account_dest_id" ref="l10n_nl.a_8061" /> | ||
2617 | 114 | </record> | ||
2618 | 115 | <!-- verkopen hoog --> | ||
2619 | 116 | <record | ||
2620 | 117 | id="position_account_non_eu_sales_service_trade_high" | ||
2621 | 118 | model="account.fiscal.position.account.template"> | ||
2622 | 119 | <field name="position_id" ref="fiscal_position_template_non_eu" /> | ||
2623 | 120 | <field name="account_src_id" ref="l10n_nl.a_8052" /> | ||
2624 | 121 | <field name="account_dest_id" ref="l10n_nl.a_8061" /> | ||
2625 | 122 | </record> | ||
2626 | 123 | <!-- verkopen overig: is er niet?? --> | ||
2627 | 124 | |||
2628 | 125 | <!-- Position 3 - EU Countries --> | ||
2629 | 126 | <!-- inkopen laag --> | ||
2630 | 127 | <record | ||
2631 | 128 | id="position_account_eu_purchase_low" | ||
2632 | 129 | model="account.fiscal.position.account.template"> | ||
2633 | 130 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2634 | 131 | <field name="account_src_id" ref="l10n_nl.a_7001" /> | ||
2635 | 132 | <field name="account_dest_id" ref="l10n_nl.a_7014" /> | ||
2636 | 133 | </record> | ||
2637 | 134 | <!-- inkopen hoog --> | ||
2638 | 135 | <record | ||
2639 | 136 | id="position_account_eu_purchase_high" | ||
2640 | 137 | model="account.fiscal.position.account.template"> | ||
2641 | 138 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2642 | 139 | <field name="account_src_id" ref="l10n_nl.a_expense" /> | ||
2643 | 140 | <field name="account_dest_id" ref="l10n_nl.a_7015" /> | ||
2644 | 141 | </record> | ||
2645 | 142 | <!-- inkopen overig --> | ||
2646 | 143 | <record | ||
2647 | 144 | id="position_account_eu_purchase_other" | ||
2648 | 145 | model="account.fiscal.position.account.template"> | ||
2649 | 146 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2650 | 147 | <field name="account_src_id" ref="l10n_nl.a_7003" /> | ||
2651 | 148 | <field name="account_dest_id" ref="l10n_nl.a_7016" /> | ||
2652 | 149 | </record> | ||
2653 | 150 | <!-- verkopen fabricage --> | ||
2654 | 151 | <!-- verkopen laag --> | ||
2655 | 152 | <record | ||
2656 | 153 | id="position_account_eu_sales_production_low" | ||
2657 | 154 | model="account.fiscal.position.account.template"> | ||
2658 | 155 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2659 | 156 | <field name="account_src_id" ref="l10n_nl.a_8001" /> | ||
2660 | 157 | <field name="account_dest_id" ref="l10n_nl.a_8000" /> | ||
2661 | 158 | </record> | ||
2662 | 159 | <!-- verkopen hoog --> | ||
2663 | 160 | <record | ||
2664 | 161 | id="position_account_eu_sales_production_high" | ||
2665 | 162 | model="account.fiscal.position.account.template"> | ||
2666 | 163 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2667 | 164 | <field name="account_src_id" ref="l10n_nl.a_8002" /> | ||
2668 | 165 | <field name="account_dest_id" ref="l10n_nl.a_8000" /> | ||
2669 | 166 | </record> | ||
2670 | 167 | <!-- verkopen overig --> | ||
2671 | 168 | <record | ||
2672 | 169 | id="position_account_eu_sales_production_other" | ||
2673 | 170 | model="account.fiscal.position.account.template"> | ||
2674 | 171 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2675 | 172 | <field name="account_src_id" ref="l10n_nl.a_8003" /> | ||
2676 | 173 | <field name="account_dest_id" ref="l10n_nl.a_8000" /> | ||
2677 | 174 | </record> | ||
2678 | 175 | <!-- verkopen handel --> | ||
2679 | 176 | <!-- verkopen laag --> | ||
2680 | 177 | <record | ||
2681 | 178 | id="position_account_eu_sales_trade_low" | ||
2682 | 179 | model="account.fiscal.position.account.template"> | ||
2683 | 180 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2684 | 181 | <field name="account_src_id" ref="l10n_nl.a_8011" /> | ||
2685 | 182 | <field name="account_dest_id" ref="l10n_nl.a_8010" /> | ||
2686 | 183 | </record> | ||
2687 | 184 | <!-- verkopen hoog --> | ||
2688 | 185 | <record | ||
2689 | 186 | id="position_account_eu_sales_trade_high" | ||
2690 | 187 | model="account.fiscal.position.account.template"> | ||
2691 | 188 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2692 | 189 | <field name="account_src_id" ref="l10n_nl.a_sale" /> | ||
2693 | 190 | <field name="account_dest_id" ref="l10n_nl.a_8010" /> | ||
2694 | 191 | </record> | ||
2695 | 192 | <!-- verkopen overig --> | ||
2696 | 193 | <record | ||
2697 | 194 | id="position_account_eu_sales_trade_other" | ||
2698 | 195 | model="account.fiscal.position.account.template"> | ||
2699 | 196 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2700 | 197 | <field name="account_src_id" ref="l10n_nl.a_8013" /> | ||
2701 | 198 | <field name="account_dest_id" ref="l10n_nl.a_8010" /> | ||
2702 | 199 | </record> | ||
2703 | 200 | <!-- verkopen diensten fabricage --> | ||
2704 | 201 | <!-- verkopen laag --> | ||
2705 | 202 | <record | ||
2706 | 203 | id="position_account_eu_sales_service_production_low" | ||
2707 | 204 | model="account.fiscal.position.account.template"> | ||
2708 | 205 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2709 | 206 | <field name="account_src_id" ref="l10n_nl.a_8041" /> | ||
2710 | 207 | <field name="account_dest_id" ref="l10n_nl.a_8040" /> | ||
2711 | 208 | </record> | ||
2712 | 209 | <!-- verkopen hoog --> | ||
2713 | 210 | <record | ||
2714 | 211 | id="position_account_eu_sales_service_production_high" | ||
2715 | 212 | model="account.fiscal.position.account.template"> | ||
2716 | 213 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2717 | 214 | <field name="account_src_id" ref="l10n_nl.a_8042" /> | ||
2718 | 215 | <field name="account_dest_id" ref="l10n_nl.a_8040" /> | ||
2719 | 216 | </record> | ||
2720 | 217 | <!-- verkopen overig --> | ||
2721 | 218 | <record | ||
2722 | 219 | id="position_account_eu_sales_service_production_other" | ||
2723 | 220 | model="account.fiscal.position.account.template"> | ||
2724 | 221 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2725 | 222 | <field name="account_src_id" ref="l10n_nl.a_8043" /> | ||
2726 | 223 | <field name="account_dest_id" ref="l10n_nl.a_8040" /> | ||
2727 | 224 | </record> | ||
2728 | 225 | <!-- verkopen diensten handel --> | ||
2729 | 226 | <!-- verkopen laag --> | ||
2730 | 227 | <record | ||
2731 | 228 | id="position_account_eu_sales_service_trade_low" | ||
2732 | 229 | model="account.fiscal.position.account.template"> | ||
2733 | 230 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2734 | 231 | <field name="account_src_id" ref="l10n_nl.a_8051" /> | ||
2735 | 232 | <field name="account_dest_id" ref="l10n_nl.a_8050" /> | ||
2736 | 233 | </record> | ||
2737 | 234 | <!-- verkopen hoog --> | ||
2738 | 235 | <record | ||
2739 | 236 | id="position_account_eu_sales_service_trade_high" | ||
2740 | 237 | model="account.fiscal.position.account.template"> | ||
2741 | 238 | <field name="position_id" ref="fiscal_position_template_eu" /> | ||
2742 | 239 | <field name="account_src_id" ref="l10n_nl.a_8052" /> | ||
2743 | 240 | <field name="account_dest_id" ref="l10n_nl.a_8050" /> | ||
2744 | 241 | </record> | ||
2745 | 242 | <!-- verkopen overig: is er niet?? --> | ||
2746 | 243 | |||
2747 | 244 | </data> | ||
2748 | 245 | </openerp> | ||
2749 | 0 | \ No newline at end of file | 246 | \ No newline at end of file |
2750 | 1 | 247 | ||
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 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2756 | 2 | <openerp> | ||
2757 | 3 | <data> | ||
2758 | 4 | |||
2759 | 5 | <!-- account.fiscal.position.tax.template --> | ||
2760 | 6 | |||
2761 | 7 | <!-- Position 2 - NON-EU Countries --> | ||
2762 | 8 | <!-- All sales tax will become 0 --> | ||
2763 | 9 | <record id="position_tax_extracom_1" model="account.fiscal.position.tax.template"> | ||
2764 | 10 | <field name="position_id" ref="fiscal_position_template_non_eu"/> | ||
2765 | 11 | <field name="tax_src_id" ref="l10n_nl.btw_0"/> | ||
2766 | 12 | <field name="tax_dest_id" ref="l10n_nl.btw_X1"/> | ||
2767 | 13 | </record> | ||
2768 | 14 | <record id="position_tax_extracom_2" model="account.fiscal.position.tax.template"> | ||
2769 | 15 | <field name="position_id" ref="fiscal_position_template_non_eu"/> | ||
2770 | 16 | <field name="tax_src_id" ref="l10n_nl.btw_6"/> | ||
2771 | 17 | <field name="tax_dest_id" ref="l10n_nl.btw_X1"/> | ||
2772 | 18 | </record> | ||
2773 | 19 | <record id="position_tax_extracom_3" model="account.fiscal.position.tax.template"> | ||
2774 | 20 | <field name="position_id" ref="fiscal_position_template_non_eu"/> | ||
2775 | 21 | <field name="tax_src_id" ref="l10n_nl.btw_21"/> | ||
2776 | 22 | <field name="tax_dest_id" ref="l10n_nl.btw_X1"/> | ||
2777 | 23 | </record> | ||
2778 | 24 | <record id="position_tax_extracom_4" model="account.fiscal.position.tax.template"> | ||
2779 | 25 | <field name="position_id" ref="fiscal_position_template_non_eu"/> | ||
2780 | 26 | <field name="tax_src_id" ref="l10n_nl.btw_overig"/> | ||
2781 | 27 | <field name="tax_dest_id" ref="l10n_nl.btw_X1"/> | ||
2782 | 28 | </record> | ||
2783 | 29 | |||
2784 | 30 | <!-- VAT on buying from outside the EU --> | ||
2785 | 31 | <!-- VAT low --> | ||
2786 | 32 | <record id="position_tax_extracom_5" model="account.fiscal.position.tax.template"> | ||
2787 | 33 | <field name="position_id" ref="fiscal_position_template_non_eu"/> | ||
2788 | 34 | <field name="tax_src_id" ref="l10n_nl.btw_6_buy"/> | ||
2789 | 35 | <field name="tax_dest_id" ref="l10n_nl.btw_E1"/> | ||
2790 | 36 | </record> | ||
2791 | 37 | <!-- VAT high --> | ||
2792 | 38 | <record id="position_tax_extracom_6" model="account.fiscal.position.tax.template"> | ||
2793 | 39 | <field name="position_id" ref="fiscal_position_template_non_eu"/> | ||
2794 | 40 | <field name="tax_src_id" ref="l10n_nl.btw_21_buy"/> | ||
2795 | 41 | <field name="tax_dest_id" ref="l10n_nl.btw_E2"/> | ||
2796 | 42 | </record> | ||
2797 | 43 | <!-- VAT other --> | ||
2798 | 44 | <record id="position_tax_extracom_7" model="account.fiscal.position.tax.template"> | ||
2799 | 45 | <field name="position_id" ref="fiscal_position_template_non_eu"/> | ||
2800 | 46 | <field name="tax_src_id" ref="l10n_nl.btw_overig_buy"/> | ||
2801 | 47 | <field name="tax_dest_id" ref="l10n_nl.btw_E_overig"/> | ||
2802 | 48 | </record> | ||
2803 | 49 | <!-- Belgian schema has many more lines here.... --> | ||
2804 | 50 | |||
2805 | 51 | <!-- Position 3 - EU Countries --> | ||
2806 | 52 | <record id="position_tax_intracom_1" model="account.fiscal.position.tax.template"> | ||
2807 | 53 | <field name="position_id" ref="fiscal_position_template_eu"/> | ||
2808 | 54 | <field name="tax_src_id" ref="l10n_nl.btw_0"/> | ||
2809 | 55 | <field name="tax_dest_id" ref="l10n_nl.btw_X0"/> | ||
2810 | 56 | </record> | ||
2811 | 57 | <record id="position_tax_intracom_2" model="account.fiscal.position.tax.template"> | ||
2812 | 58 | <field name="position_id" ref="fiscal_position_template_eu"/> | ||
2813 | 59 | <field name="tax_src_id" ref="l10n_nl.btw_6"/> | ||
2814 | 60 | <field name="tax_dest_id" ref="l10n_nl.btw_X0"/> | ||
2815 | 61 | </record> | ||
2816 | 62 | <record id="position_tax_intracom_3" model="account.fiscal.position.tax.template"> | ||
2817 | 63 | <field name="position_id" ref="fiscal_position_template_eu"/> | ||
2818 | 64 | <field name="tax_src_id" ref="l10n_nl.btw_21"/> | ||
2819 | 65 | <field name="tax_dest_id" ref="l10n_nl.btw_X0"/> | ||
2820 | 66 | </record> | ||
2821 | 67 | <record id="position_tax_intracom_4" model="account.fiscal.position.tax.template"> | ||
2822 | 68 | <field name="position_id" ref="fiscal_position_template_eu"/> | ||
2823 | 69 | <field name="tax_src_id" ref="l10n_nl.btw_overig"/> | ||
2824 | 70 | <field name="tax_dest_id" ref="l10n_nl.btw_X0"/> | ||
2825 | 71 | </record> | ||
2826 | 72 | |||
2827 | 73 | <!-- In source-tax we lack the separation of goods and services, | ||
2828 | 74 | therefore no lines now for "Installatie/Afstandsverkopen. --> | ||
2829 | 75 | |||
2830 | 76 | <!-- Buying from other EU countries (only goods = VAT 0 --> | ||
2831 | 77 | <record id="position_tax_intracom_5" model="account.fiscal.position.tax.template"> | ||
2832 | 78 | <field name="position_id" ref="fiscal_position_template_eu"/> | ||
2833 | 79 | <field name="tax_src_id" ref="l10n_nl.btw_6_buy"/> | ||
2834 | 80 | <field name="tax_dest_id" ref="l10n_nl.btw_I_6"/> | ||
2835 | 81 | </record> | ||
2836 | 82 | <record id="position_tax_intracom_6" model="account.fiscal.position.tax.template"> | ||
2837 | 83 | <field name="position_id" ref="fiscal_position_template_eu"/> | ||
2838 | 84 | <field name="tax_src_id" ref="l10n_nl.btw_21_buy"/> | ||
2839 | 85 | <field name="tax_dest_id" ref="l10n_nl.btw_I_21"/> | ||
2840 | 86 | </record> | ||
2841 | 87 | <record id="position_tax_intracom_7" model="account.fiscal.position.tax.template"> | ||
2842 | 88 | <field name="position_id" ref="fiscal_position_template_eu"/> | ||
2843 | 89 | <field name="tax_src_id" ref="l10n_nl.btw_overig_buy"/> | ||
2844 | 90 | <field name="tax_dest_id" ref="l10n_nl.btw_I_overig"/> | ||
2845 | 91 | </record> | ||
2846 | 92 | |||
2847 | 93 | <!-- Again, Belgian schema has 17 (!) more records. Missing VAT 0 | ||
2848 | 94 | and separation of goods and services .. --> | ||
2849 | 95 | |||
2850 | 96 | </data> | ||
2851 | 97 | </openerp> | ||
2852 | 0 | 98 | ||
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 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
2858 | 2 | <openerp> | ||
2859 | 3 | <data> | ||
2860 | 4 | <!-- Fiscal Position Templates --> | ||
2861 | 5 | |||
2862 | 6 | <!-- for the moment no use for this | ||
2863 | 7 | <record | ||
2864 | 8 | id="fiscal_position_template_domestic" | ||
2865 | 9 | model="account.fiscal.position.template"> | ||
2866 | 10 | <field name="name">Binnenland</field> | ||
2867 | 11 | <field | ||
2868 | 12 | name="chart_template_id" | ||
2869 | 13 | ref="l10nnl_chart_template" /> | ||
2870 | 14 | </record> | ||
2871 | 15 | --> | ||
2872 | 16 | <record | ||
2873 | 17 | id="fiscal_position_template_eu" | ||
2874 | 18 | model="account.fiscal.position.template"> | ||
2875 | 19 | <field name="name">EU landen</field> | ||
2876 | 20 | <field | ||
2877 | 21 | name="chart_template_id" | ||
2878 | 22 | ref="l10nnl_chart_template" /> | ||
2879 | 23 | </record> | ||
2880 | 24 | <record | ||
2881 | 25 | id="fiscal_position_template_non_eu" | ||
2882 | 26 | model="account.fiscal.position.template"> | ||
2883 | 27 | <field name="name">Niet-EU landen</field> | ||
2884 | 28 | <field | ||
2885 | 29 | name="chart_template_id" | ||
2886 | 30 | ref="l10nnl_chart_template" /> | ||
2887 | 31 | </record> | ||
2888 | 32 | </data> | ||
2889 | 33 | </openerp> | ||
2890 | 0 | 34 | ||
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 | 26 | import email | 26 | import email |
2896 | 27 | import logging | 27 | import logging |
2897 | 28 | import pytz | 28 | import pytz |
2898 | 29 | import re | ||
2899 | 30 | import time | 29 | import time |
2900 | 31 | from email.header import decode_header | 30 | from email.header import decode_header |
2901 | 32 | from email.message import Message | 31 | from email.message import Message |
2902 | 32 | from email.utils import getaddresses | ||
2903 | 33 | 33 | ||
2904 | 34 | import tools | 34 | import tools |
2905 | 35 | from osv import osv | 35 | from osv import osv |
2906 | @@ -60,9 +60,15 @@ | |||
2907 | 60 | return ''.join([tools.ustr(x[0], x[1]) for x in text]) | 60 | return ''.join([tools.ustr(x[0], x[1]) for x in text]) |
2908 | 61 | 61 | ||
2909 | 62 | def to_email(text): | 62 | def to_email(text): |
2911 | 63 | """Return a list of the email addresses found in ``text``""" | 63 | """Returns a list of the email addresses found in ``text`` |
2912 | 64 | """ | ||
2913 | 64 | if not text: return [] | 65 | if not text: return [] |
2915 | 65 | return re.findall(r'([^ ,<@]+@[^> ,]+)', text) | 66 | |
2916 | 67 | people = getaddresses([text]) | ||
2917 | 68 | addresses = [person[1] for person in people] | ||
2918 | 69 | |||
2919 | 70 | return addresses | ||
2920 | 71 | |||
2921 | 66 | 72 | ||
2922 | 67 | class mail_message_common(osv.osv_memory): | 73 | class mail_message_common(osv.osv_memory): |
2923 | 68 | """Common abstract class for holding the main attributes of a | 74 | """Common abstract class for holding the main attributes of a |
2924 | @@ -534,7 +540,14 @@ | |||
2925 | 534 | mail_server_id=message.mail_server_id.id, | 540 | mail_server_id=message.mail_server_id.id, |
2926 | 535 | context=context) | 541 | context=context) |
2927 | 536 | if res: | 542 | if res: |
2929 | 537 | message.write({'state':'sent', 'message_id': res}) | 543 | message.write( |
2930 | 544 | { | ||
2931 | 545 | 'state':'sent', | ||
2932 | 546 | 'message_id': res, | ||
2933 | 547 | 'user_id': message.user_id.id or uid, | ||
2934 | 548 | 'date': message.date | ||
2935 | 549 | or datetime.datetime.now(), | ||
2936 | 550 | }) | ||
2937 | 538 | message_sent = True | 551 | message_sent = True |
2938 | 539 | else: | 552 | else: |
2939 | 540 | message.write({'state':'exception'}) | 553 | message.write({'state':'exception'}) |
2940 | 541 | 554 | ||
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 | 358 | match = tools.reference_re.search(references) | 358 | match = tools.reference_re.search(references) |
2946 | 359 | if match: res_id = match.group(1) | 359 | if match: res_id = match.group(1) |
2947 | 360 | if not res_id: | 360 | if not res_id: |
2949 | 361 | match = tools.res_re.search(msg['subject']) | 361 | match = tools.res_re.search(msg.get('subject') or '') |
2950 | 362 | if match: res_id = match.group(1) | 362 | if match: res_id = match.group(1) |
2951 | 363 | if res_id: | 363 | if res_id: |
2952 | 364 | res_id = int(res_id) | 364 | res_id = int(res_id) |
2953 | 365 | 365 | ||
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 | 20 | ############################################################################## | 20 | ############################################################################## |
2959 | 21 | 21 | ||
2960 | 22 | from datetime import datetime | 22 | from datetime import datetime |
2962 | 23 | from osv import osv, fields | 23 | from osv import osv, fields, orm |
2963 | 24 | import decimal_precision as dp | 24 | import decimal_precision as dp |
2964 | 25 | from tools import float_compare | 25 | from tools import float_compare |
2965 | 26 | from tools import DEFAULT_SERVER_DATETIME_FORMAT | ||
2966 | 26 | from tools.translate import _ | 27 | from tools.translate import _ |
2967 | 27 | import netsvc | 28 | import netsvc |
2968 | 28 | import time | 29 | import time |
2969 | @@ -280,8 +281,10 @@ | |||
2970 | 280 | @param properties: List of related properties. | 281 | @param properties: List of related properties. |
2971 | 281 | @return: False or BoM id. | 282 | @return: False or BoM id. |
2972 | 282 | """ | 283 | """ |
2975 | 283 | cr.execute('select id from mrp_bom where product_id=%s and bom_id is null order by sequence', (product_id,)) | 284 | domain = [('product_id', '=', product_id), ('bom_id', '=', False), |
2976 | 284 | ids = map(lambda x: x[0], cr.fetchall()) | 285 | '|', ('date_start', '=', False), ('date_start', '<=', time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)), |
2977 | 286 | '|', ('date_stop', '=', False), ('date_stop', '>=', time.strftime(DEFAULT_SERVER_DATETIME_FORMAT))] | ||
2978 | 287 | ids = self.search(cr, uid, domain, order='sequence') | ||
2979 | 285 | max_prop = 0 | 288 | max_prop = 0 |
2980 | 286 | result = False | 289 | result = False |
2981 | 287 | for bom in self.pool.get('mrp.bom').browse(cr, uid, ids): | 290 | for bom in self.pool.get('mrp.bom').browse(cr, uid, ids): |
2982 | @@ -434,6 +437,22 @@ | |||
2983 | 434 | for prod in self.browse(cr, uid, ids, context=context): | 437 | for prod in self.browse(cr, uid, ids, context=context): |
2984 | 435 | result[prod.id] = prod.date_planned[:10] | 438 | result[prod.id] = prod.date_planned[:10] |
2985 | 436 | return result | 439 | return result |
2986 | 440 | |||
2987 | 441 | def _src_id_default(self, cr, uid, ids, context=None): | ||
2988 | 442 | try: | ||
2989 | 443 | location_model, location_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_stock') | ||
2990 | 444 | self.pool.get('stock.location').check_access_rule(cr, uid, [location_id], 'read', context=context) | ||
2991 | 445 | except (orm.except_orm, ValueError): | ||
2992 | 446 | location_id = False | ||
2993 | 447 | return location_id | ||
2994 | 448 | |||
2995 | 449 | def _dest_id_default(self, cr, uid, ids, context=None): | ||
2996 | 450 | try: | ||
2997 | 451 | location_model, location_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_stock') | ||
2998 | 452 | self.pool.get('stock.location').check_access_rule(cr, uid, [location_id], 'read', context=context) | ||
2999 | 453 | except (orm.except_orm, ValueError): | ||
3000 | 454 | location_id = False | ||
3001 | 455 | return location_id | ||
3002 | 437 | 456 | ||
3003 | 438 | _columns = { | 457 | _columns = { |
3004 | 439 | 'name': fields.char('Reference', size=64, required=True), | 458 | 'name': fields.char('Reference', size=64, required=True), |
3005 | @@ -481,6 +500,8 @@ | |||
3006 | 481 | 'state': lambda *a: 'draft', | 500 | 'state': lambda *a: 'draft', |
3007 | 482 | 'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), | 501 | 'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), |
3008 | 483 | 'product_qty': lambda *a: 1.0, | 502 | 'product_qty': lambda *a: 1.0, |
3009 | 503 | 'location_src_id': _src_id_default, | ||
3010 | 504 | 'location_dest_id': _dest_id_default, | ||
3011 | 484 | 'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'mrp.production') or '/', | 505 | 'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'mrp.production') or '/', |
3012 | 485 | 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c), | 506 | 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c), |
3013 | 486 | } | 507 | } |
3014 | 487 | 508 | ||
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 | 36 | <field name="name">mrp_bom multi-company</field> | 36 | <field name="name">mrp_bom multi-company</field> |
3020 | 37 | <field name="model_id" search="[('model','=','mrp.bom')]" model="ir.model"/> | 37 | <field name="model_id" search="[('model','=','mrp.bom')]" model="ir.model"/> |
3021 | 38 | <field name="global" eval="True"/> | 38 | <field name="global" eval="True"/> |
3023 | 39 | <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field> | 39 | <field name="domain_force">['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field> |
3024 | 40 | </record> | 40 | </record> |
3025 | 41 | 41 | ||
3026 | 42 | <record model="ir.rule" id="mrp_routing_rule"> | 42 | <record model="ir.rule" id="mrp_routing_rule"> |
3027 | 43 | 43 | ||
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 | 349 | return True | 349 | return True |
3033 | 350 | 350 | ||
3034 | 351 | def wkf_invoice_create(self, cr, uid, ids, *args): | 351 | def wkf_invoice_create(self, cr, uid, ids, *args): |
3036 | 352 | return self.action_invoice_create(cr, uid, ids) | 352 | self.action_invoice_create(cr, uid, ids) |
3037 | 353 | return True | ||
3038 | 353 | 354 | ||
3039 | 354 | def action_invoice_create(self, cr, uid, ids, group=False, context=None): | 355 | def action_invoice_create(self, cr, uid, ids, group=False, context=None): |
3040 | 355 | """ Creates invoice(s) for repair order. | 356 | """ Creates invoice(s) for repair order. |
3041 | 356 | 357 | ||
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 | 81 | """ | 81 | """ |
3047 | 82 | _name = "procurement.order" | 82 | _name = "procurement.order" |
3048 | 83 | _description = "Procurement" | 83 | _description = "Procurement" |
3050 | 84 | _order = 'priority,date_planned desc' | 84 | _order = 'priority desc,date_planned' |
3051 | 85 | _log_create = False | 85 | _log_create = False |
3052 | 86 | _columns = { | 86 | _columns = { |
3053 | 87 | 'name': fields.char('Reason', size=64, required=True, help='Procurement name.'), | 87 | 'name': fields.char('Reason', size=64, required=True, help='Procurement name.'), |
3054 | 88 | 88 | ||
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 | 199 | categ_ids = _create_parent_category_list(categ_id, [categ_id]) | 199 | categ_ids = _create_parent_category_list(categ_id, [categ_id]) |
3060 | 200 | if categ_ids: | 200 | if categ_ids: |
3061 | 201 | categ_where = '(categ_id IN (' + ','.join(map(str, categ_ids)) + '))' | 201 | categ_where = '(categ_id IN (' + ','.join(map(str, categ_ids)) + '))' |
3062 | 202 | categ_where_i = '(i.categ_id IN (' + ','.join(map(str, categ_ids)) + '))' | ||
3063 | 202 | else: | 203 | else: |
3064 | 203 | categ_where = '(categ_id IS NULL)' | 204 | categ_where = '(categ_id IS NULL)' |
3065 | 205 | categ_where_i = '(i.categ_id IS NULL)' | ||
3066 | 204 | 206 | ||
3067 | 205 | if partner: | 207 | if partner: |
3068 | 206 | partner_where = 'base <> -2 OR %s IN (SELECT name FROM product_supplierinfo WHERE product_id = %s) ' | 208 | partner_where = 'base <> -2 OR %s IN (SELECT name FROM product_supplierinfo WHERE product_id = %s) ' |
3070 | 207 | partner_args = (partner, product_id) | 209 | partner_args = (partner, tmpl_id) |
3071 | 208 | else: | 210 | else: |
3072 | 209 | partner_where = 'base <> -2 ' | 211 | partner_where = 'base <> -2 ' |
3073 | 210 | partner_args = () | 212 | partner_args = () |
3088 | 211 | 213 | ||
3089 | 212 | cr.execute( | 214 | query = ( |
3090 | 213 | 'SELECT i.*, pl.currency_id ' | 215 | 'SELECT ' |
3091 | 214 | 'FROM product_pricelist_item AS i, ' | 216 | 'i.*, pl.currency_id , p.* ' |
3092 | 215 | 'product_pricelist_version AS v, product_pricelist AS pl ' | 217 | 'FROM ' |
3093 | 216 | 'WHERE (product_tmpl_id IS NULL OR product_tmpl_id = %s) ' | 218 | 'product_pricelist_item AS i ' |
3094 | 217 | 'AND (product_id IS NULL OR product_id = %s) ' | 219 | 'JOIN product_pricelist_version AS v ' |
3095 | 218 | 'AND (' + categ_where + ' OR (categ_id IS NULL)) ' | 220 | 'ON i.price_version_id = v.id ' |
3096 | 219 | 'AND (' + partner_where + ') ' | 221 | 'JOIN product_pricelist AS pl ' |
3097 | 220 | 'AND price_version_id = %s ' | 222 | 'ON v.pricelist_id = pl.id ' |
3098 | 221 | 'AND (min_quantity IS NULL OR min_quantity <= %s) ' | 223 | 'LEFT OUTER JOIN ( ' |
3099 | 222 | 'AND i.price_version_id = v.id AND v.pricelist_id = pl.id ' | 224 | 'WITH RECURSIVE subtree(depth, categ_id, parent_id, name) AS ( ' |
3100 | 223 | 'ORDER BY sequence', | 225 | 'SELECT 0, id, parent_id, name FROM product_category WHERE parent_id is NULL ' |
3101 | 224 | (tmpl_id, product_id) + partner_args + (pricelist_version_ids[0], qty)) | 226 | 'UNION ' |
3102 | 227 | 'SELECT depth+1, m.id, m.parent_id, m.name ' | ||
3103 | 228 | 'FROM subtree t, product_category m ' | ||
3104 | 229 | 'WHERE m.parent_id = t.categ_id ' | ||
3105 | 230 | ') ' | ||
3106 | 231 | 'SELECT * ' | ||
3107 | 232 | 'FROM subtree ' | ||
3108 | 233 | 'WHERE (' + categ_where + ' OR (categ_id IS NULL)) ' | ||
3109 | 234 | ') AS p ' | ||
3110 | 235 | 'on i.categ_id = p.categ_id ' | ||
3111 | 236 | 'WHERE ' | ||
3112 | 237 | '(product_tmpl_id IS NULL OR product_tmpl_id = %s) ' | ||
3113 | 238 | 'AND (product_id IS NULL OR product_id = %s) ' | ||
3114 | 239 | 'AND (' + categ_where_i + ' OR (i.categ_id IS NULL)) ' | ||
3115 | 240 | 'AND (' + partner_where + ') ' | ||
3116 | 241 | 'AND price_version_id = %s ' | ||
3117 | 242 | 'AND (min_quantity IS NULL OR min_quantity <= %s) ' | ||
3118 | 243 | 'ORDER BY ' | ||
3119 | 244 | 'sequence, depth desc ' | ||
3120 | 245 | ) % ((tmpl_id, product_id) + partner_args + (pricelist_version_ids[0], qty)) | ||
3121 | 246 | |||
3122 | 247 | cr.execute(query) | ||
3123 | 225 | res1 = cr.dictfetchall() | 248 | res1 = cr.dictfetchall() |
3124 | 226 | uom_price_already_computed = False | 249 | uom_price_already_computed = False |
3125 | 227 | for res in res1: | 250 | for res in res1: |
3126 | @@ -232,7 +255,7 @@ | |||
3127 | 232 | else: | 255 | else: |
3128 | 233 | price_tmp = self.price_get(cr, uid, | 256 | price_tmp = self.price_get(cr, uid, |
3129 | 234 | [res['base_pricelist_id']], product_id, | 257 | [res['base_pricelist_id']], product_id, |
3131 | 235 | qty, context=context)[res['base_pricelist_id']] | 258 | qty, partner=partner, context=context)[res['base_pricelist_id']] |
3132 | 236 | ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id | 259 | ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id |
3133 | 237 | uom_price_already_computed = True | 260 | uom_price_already_computed = True |
3134 | 238 | price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False) | 261 | price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False) |
3135 | @@ -269,10 +292,17 @@ | |||
3136 | 269 | price_type.field, context=context)[product_id], round=False, context=context) | 292 | price_type.field, context=context)[product_id], round=False, context=context) |
3137 | 270 | 293 | ||
3138 | 271 | if price is not False: | 294 | if price is not False: |
3139 | 295 | surcharge = res['price_surcharge'] or 0.0 | ||
3140 | 296 | if 'uom' in context: | ||
3141 | 297 | product = products_dict[product_id] | ||
3142 | 298 | uom = product.uos_id or product.uom_id | ||
3143 | 299 | surcharge = product_uom_obj._compute_price(cr, uid, uom.id, surcharge, context['uom']) | ||
3144 | 300 | |||
3145 | 272 | price_limit = price | 301 | price_limit = price |
3146 | 273 | price = price * (1.0+(res['price_discount'] or 0.0)) | 302 | price = price * (1.0+(res['price_discount'] or 0.0)) |
3147 | 274 | price = rounding(price, res['price_round']) #TOFIX: rounding with tools.float_rouding | 303 | price = rounding(price, res['price_round']) #TOFIX: rounding with tools.float_rouding |
3149 | 275 | price += (res['price_surcharge'] or 0.0) | 304 | price += surcharge |
3150 | 305 | |||
3151 | 276 | if res['price_min_margin']: | 306 | if res['price_min_margin']: |
3152 | 277 | price = max(price, price_limit+res['price_min_margin']) | 307 | price = max(price, price_limit+res['price_min_margin']) |
3153 | 278 | if res['price_max_margin']: | 308 | if res['price_max_margin']: |
3154 | @@ -304,6 +334,7 @@ | |||
3155 | 304 | res.update({'item_id': {ids[-1]: res_multi.get('item_id', ids[-1])}}) | 334 | res.update({'item_id': {ids[-1]: res_multi.get('item_id', ids[-1])}}) |
3156 | 305 | return res | 335 | return res |
3157 | 306 | 336 | ||
3158 | 337 | |||
3159 | 307 | product_pricelist() | 338 | product_pricelist() |
3160 | 308 | 339 | ||
3161 | 309 | 340 | ||
3162 | 310 | 341 | ||
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 | 611 | # Performing a quick memory merge of ids in Python will give much better performance | 611 | # Performing a quick memory merge of ids in Python will give much better performance |
3168 | 612 | ids = set() | 612 | ids = set() |
3169 | 613 | ids.update(self.search(cr, user, args + [('default_code',operator,name)], limit=limit, context=context)) | 613 | ids.update(self.search(cr, user, args + [('default_code',operator,name)], limit=limit, context=context)) |
3171 | 614 | if len(ids) < limit: | 614 | if not limit or len(ids) < limit: |
3172 | 615 | # we may underrun the limit because of dupes in the results, that's fine | 615 | # we may underrun the limit because of dupes in the results, that's fine |
3174 | 616 | ids.update(self.search(cr, user, args + [('name',operator,name)], limit=(limit-len(ids)), context=context)) | 616 | ids.update(self.search(cr, user, args + [('name',operator,name)], limit=(limit-len(ids) if limit else limit) , context=context)) |
3175 | 617 | ids = list(ids) | 617 | ids = list(ids) |
3176 | 618 | if not ids: | 618 | if not ids: |
3177 | 619 | ptrn = re.compile('(\[(.*?)\])') | 619 | ptrn = re.compile('(\[(.*?)\])') |
3178 | 620 | 620 | ||
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 | 70 | </td> | 70 | </td> |
3184 | 71 | </tr><tr> | 71 | </tr><tr> |
3185 | 72 | <td> | 72 | <td> |
3187 | 73 | <barCode><xsl:value-of select="code"/></barCode> | 73 | <barCode><xsl:value-of select="ean13"/></barCode> |
3188 | 74 | </td><td> | 74 | </td><td> |
3189 | 75 | <para style="nospace"><xsl:value-of select="product"/></para><xsl:text>, </xsl:text> | 75 | <para style="nospace"><xsl:value-of select="product"/></para><xsl:text>, </xsl:text> |
3190 | 76 | <para style="nospace"><xsl:value-of select="variant"/></para> | 76 | <para style="nospace"><xsl:value-of select="variant"/></para> |
3191 | 77 | 77 | ||
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 | 68 | </field> | 68 | </field> |
3197 | 69 | </page> | 69 | </page> |
3198 | 70 | <page string="Billing" groups="account.group_account_invoice"> | 70 | <page string="Billing" groups="account.group_account_invoice"> |
3201 | 71 | <field colspan="4" name="partner_id" on_change="onchange_partner_id(partner_id)" select="1" string="Customer"/> | 71 | <field name="partner_id" on_change="onchange_partner_id(partner_id)" select="1" string="Customer" colspan="4" /> |
3202 | 72 | <field domain="[('partner_id','=',partner_id)]" name="contact_id" string="Contact Address"/> | 72 | <field name="contact_id" string="Contact Address" domain="[('partner_id','=',partner_id)]" options='{"quick_create": false}' context="{'default_partner_id':partner_id}" /> |
3203 | 73 | <field name="warn_customer"/> | 73 | <field name="warn_customer"/> |
3204 | 74 | <field name="currency_id" select="1" groups="base.group_multi_company" required="1"/> | 74 | <field name="currency_id" select="1" groups="base.group_multi_company" required="1"/> |
3205 | 75 | <newline/> | 75 | <newline/> |
3206 | 76 | 76 | ||
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 | 68 | <group col="2" colspan="2"> | 68 | <group col="2" colspan="2"> |
3212 | 69 | <separator colspan="2" string="Contact Information"/> | 69 | <separator colspan="2" string="Contact Information"/> |
3213 | 70 | <field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/> | 70 | <field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/> |
3215 | 71 | <field name="partner_address_id" string="Contact" on_change="onchange_partner_address_id(partner_address_id, email_from)"/> | 71 | <field name="partner_address_id" string="Contact" on_change="onchange_partner_address_id(partner_address_id, email_from)" options='{"quick_create": false}' context="{'default_partner_id':partner_id}" /> |
3216 | 72 | <field name="email_from"/> | 72 | <field name="email_from"/> |
3217 | 73 | </group> | 73 | </group> |
3218 | 74 | <group col="3" colspan="2"> | 74 | <group col="3" colspan="2"> |
3219 | 75 | 75 | ||
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 | 20 | ############################################################################## | 20 | ############################################################################## |
3225 | 21 | 21 | ||
3226 | 22 | from osv import fields, osv | 22 | from osv import fields, osv |
3227 | 23 | from openerp.tools.translate import _ | ||
3228 | 23 | 24 | ||
3229 | 24 | class procurement_order(osv.osv): | 25 | class procurement_order(osv.osv): |
3230 | 25 | _name = "procurement.order" | 26 | _name = "procurement.order" |
3231 | @@ -37,8 +38,10 @@ | |||
3232 | 37 | """ Checks if task is done or not. | 38 | """ Checks if task is done or not. |
3233 | 38 | @return: True or False. | 39 | @return: True or False. |
3234 | 39 | """ | 40 | """ |
3237 | 40 | return all(proc.product_id.type != 'service' or (proc.task_id and proc.task_id.state in ('done', 'cancelled')) \ | 41 | for p in self.browse(cr, uid, ids, context=context): |
3238 | 41 | for proc in self.browse(cr, uid, ids, context=context)) | 42 | if (p.product_id.type=='service') and (p.procure_method=='make_to_order') and p.task_id and (p.task_id.state not in ('done', 'cancelled')): |
3239 | 43 | return False | ||
3240 | 44 | return True | ||
3241 | 42 | 45 | ||
3242 | 43 | def check_produce_service(self, cr, uid, procurement, context=None): | 46 | def check_produce_service(self, cr, uid, procurement, context=None): |
3243 | 44 | return True | 47 | return True |
3244 | @@ -79,8 +82,9 @@ | |||
3245 | 79 | 'description': procurement.note, | 82 | 'description': procurement.note, |
3246 | 80 | 'project_id': project and project.id or False, | 83 | 'project_id': project and project.id or False, |
3247 | 81 | 'company_id': procurement.company_id.id, | 84 | 'company_id': procurement.company_id.id, |
3248 | 85 | 'partner_id': procurement.sale_line_id and procurement.sale_line_id.order_id.partner_id.id, | ||
3249 | 82 | },context=context) | 86 | },context=context) |
3251 | 83 | self.write(cr, uid, [procurement.id], {'task_id': task_id, 'state': 'running'}, context=context) | 87 | self.write(cr, uid, [procurement.id], {'task_id': task_id, 'state': 'running', 'message':_('Task created.')}, context=context) |
3252 | 84 | return task_id | 88 | return task_id |
3253 | 85 | 89 | ||
3254 | 86 | procurement_order() | 90 | procurement_order() |
3255 | 87 | 91 | ||
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 | 142 | vals_line['name'] = '%s: %s' % (tools.ustr(task.task_id.name), tools.ustr(vals['name']) or '/') | 142 | vals_line['name'] = '%s: %s' % (tools.ustr(task.task_id.name), tools.ustr(vals['name']) or '/') |
3261 | 143 | if 'user_id' in vals: | 143 | if 'user_id' in vals: |
3262 | 144 | vals_line['user_id'] = vals['user_id'] | 144 | vals_line['user_id'] = vals['user_id'] |
3263 | 145 | result = self.get_user_related_details(cr, uid, vals['user_id']) | ||
3264 | 146 | for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'): | ||
3265 | 147 | if result.get(fld, False): | ||
3266 | 148 | vals_line[fld] = result[fld] | ||
3267 | 149 | 145 | ||
3268 | 150 | if 'date' in vals: | 146 | if 'date' in vals: |
3269 | 151 | vals_line['date'] = vals['date'][:10] | 147 | vals_line['date'] = vals['date'][:10] |
3270 | @@ -153,6 +149,10 @@ | |||
3271 | 153 | default_uom = self.pool.get('res.users').browse(cr, uid, uid).company_id.project_time_mode_id.id | 149 | default_uom = self.pool.get('res.users').browse(cr, uid, uid).company_id.project_time_mode_id.id |
3272 | 154 | vals_line['unit_amount'] = vals['hours'] | 150 | vals_line['unit_amount'] = vals['hours'] |
3273 | 155 | prod_id = vals_line.get('product_id', line_id.product_id.id) # False may be set | 151 | prod_id = vals_line.get('product_id', line_id.product_id.id) # False may be set |
3274 | 152 | result = self.get_user_related_details(cr, uid, vals.get('user_id', task.user_id.id)) | ||
3275 | 153 | for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'): | ||
3276 | 154 | if result.get(fld, False): | ||
3277 | 155 | vals_line[fld] = result[fld] | ||
3278 | 156 | 156 | ||
3279 | 157 | if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom): | 157 | if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom): |
3280 | 158 | vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id']) | 158 | vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id']) |
3281 | @@ -165,7 +165,9 @@ | |||
3282 | 165 | if amount_unit and 'amount' in amount_unit.get('value',{}): | 165 | if amount_unit and 'amount' in amount_unit.get('value',{}): |
3283 | 166 | vals_line['amount'] = amount_unit['value']['amount'] | 166 | vals_line['amount'] = amount_unit['value']['amount'] |
3284 | 167 | 167 | ||
3286 | 168 | self.pool.get('hr.analytic.timesheet').write(cr, uid, [line_id.id], vals_line, context=context) | 168 | #workaround for lp:1023047 |
3287 | 169 | if vals_line: | ||
3288 | 170 | self.pool.get('hr.analytic.timesheet').write(cr, uid, [line_id.id], vals_line, context=context) | ||
3289 | 169 | 171 | ||
3290 | 170 | return super(project_work,self).write(cr, uid, ids, vals, context) | 172 | return super(project_work,self).write(cr, uid, ids, vals, context) |
3291 | 171 | 173 | ||
3292 | 172 | 174 | ||
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 | 294 | self.write(cr, uid, [id], {'state' : 'confirmed', 'validator' : uid}) | 294 | self.write(cr, uid, [id], {'state' : 'confirmed', 'validator' : uid}) |
3298 | 295 | return True | 295 | return True |
3299 | 296 | 296 | ||
3300 | 297 | def _choose_account_from_po_line(self, cr, uid, po_line, context=None): | ||
3301 | 298 | fiscal_obj = self.pool.get('account.fiscal.position') | ||
3302 | 299 | property_obj = self.pool.get('ir.property') | ||
3303 | 300 | if po_line.product_id: | ||
3304 | 301 | acc_id = po_line.product_id.property_account_expense.id | ||
3305 | 302 | if not acc_id: | ||
3306 | 303 | acc_id = po_line.product_id.categ_id.property_account_expense_categ.id | ||
3307 | 304 | if not acc_id: | ||
3308 | 305 | raise osv.except_osv(_('Error!'), _('Define expense account for this company: "%s" (id:%d).') % (po_line.product_id.name, po_line.product_id.id,)) | ||
3309 | 306 | else: | ||
3310 | 307 | acc_id = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category').id | ||
3311 | 308 | fpos = po_line.order_id.fiscal_position or False | ||
3312 | 309 | return fiscal_obj.map_account(cr, uid, fpos, acc_id) | ||
3313 | 310 | |||
3314 | 297 | def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None): | 311 | def _prepare_inv_line(self, cr, uid, account_id, order_line, context=None): |
3315 | 298 | """Collects require data from purchase order line that is used to create invoice line | 312 | """Collects require data from purchase order line that is used to create invoice line |
3316 | 299 | for that purchase order line | 313 | for that purchase order line |
3317 | @@ -338,8 +352,6 @@ | |||
3318 | 338 | journal_obj = self.pool.get('account.journal') | 352 | journal_obj = self.pool.get('account.journal') |
3319 | 339 | inv_obj = self.pool.get('account.invoice') | 353 | inv_obj = self.pool.get('account.invoice') |
3320 | 340 | inv_line_obj = self.pool.get('account.invoice.line') | 354 | inv_line_obj = self.pool.get('account.invoice.line') |
3321 | 341 | fiscal_obj = self.pool.get('account.fiscal.position') | ||
3322 | 342 | property_obj = self.pool.get('ir.property') | ||
3323 | 343 | 355 | ||
3324 | 344 | for order in self.browse(cr, uid, ids, context=context): | 356 | for order in self.browse(cr, uid, ids, context=context): |
3325 | 345 | pay_acc_id = order.partner_id.property_account_payable.id | 357 | pay_acc_id = order.partner_id.property_account_payable.id |
3326 | @@ -351,16 +363,7 @@ | |||
3327 | 351 | # generate invoice line correspond to PO line and link that to created invoice (inv_id) and PO line | 363 | # generate invoice line correspond to PO line and link that to created invoice (inv_id) and PO line |
3328 | 352 | inv_lines = [] | 364 | inv_lines = [] |
3329 | 353 | for po_line in order.order_line: | 365 | for po_line in order.order_line: |
3340 | 354 | if po_line.product_id: | 366 | acc_id = self._choose_account_from_po_line(cr, uid, po_line, context=context) |
3331 | 355 | acc_id = po_line.product_id.product_tmpl_id.property_account_expense.id | ||
3332 | 356 | if not acc_id: | ||
3333 | 357 | acc_id = po_line.product_id.categ_id.property_account_expense_categ.id | ||
3334 | 358 | if not acc_id: | ||
3335 | 359 | raise osv.except_osv(_('Error !'), _('There is no expense account defined for this product: "%s" (id:%d)') % (po_line.product_id.name, po_line.product_id.id,)) | ||
3336 | 360 | else: | ||
3337 | 361 | acc_id = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category').id | ||
3338 | 362 | fpos = order.fiscal_position or False | ||
3339 | 363 | acc_id = fiscal_obj.map_account(cr, uid, fpos, acc_id) | ||
3341 | 364 | 367 | ||
3342 | 365 | inv_line_data = self._prepare_inv_line(cr, uid, acc_id, po_line, context=context) | 368 | inv_line_data = self._prepare_inv_line(cr, uid, acc_id, po_line, context=context) |
3343 | 366 | inv_line_id = inv_line_obj.create(cr, uid, inv_line_data, context=context) | 369 | inv_line_id = inv_line_obj.create(cr, uid, inv_line_data, context=context) |
3344 | @@ -539,7 +542,6 @@ | |||
3345 | 539 | @param context: A standard dictionary | 542 | @param context: A standard dictionary |
3346 | 540 | 543 | ||
3347 | 541 | @return: new purchase order id | 544 | @return: new purchase order id |
3348 | 542 | |||
3349 | 543 | """ | 545 | """ |
3350 | 544 | #TOFIX: merged order line should be unlink | 546 | #TOFIX: merged order line should be unlink |
3351 | 545 | wf_service = netsvc.LocalService("workflow") | 547 | wf_service = netsvc.LocalService("workflow") |
3352 | @@ -590,7 +592,8 @@ | |||
3353 | 590 | if porder.notes: | 592 | if porder.notes: |
3354 | 591 | order_infos['notes'] = (order_infos['notes'] or '') + ('\n%s' % (porder.notes,)) | 593 | order_infos['notes'] = (order_infos['notes'] or '') + ('\n%s' % (porder.notes,)) |
3355 | 592 | if porder.origin: | 594 | if porder.origin: |
3357 | 593 | order_infos['origin'] = (order_infos['origin'] or '') + ' ' + porder.origin | 595 | if not porder.origin in order_infos['origin'] and not order_infos['origin'] in porder.origin: |
3358 | 596 | order_infos['origin'] = (order_infos['origin'] or '') + ' ' + porder.origin | ||
3359 | 594 | 597 | ||
3360 | 595 | for order_line in porder.order_line: | 598 | for order_line in porder.order_line: |
3361 | 596 | line_key = make_key(order_line, ('name', 'date_planned', 'taxes_id', 'price_unit', 'notes', 'product_id', 'move_dest_id', 'account_analytic_id')) | 599 | line_key = make_key(order_line, ('name', 'date_planned', 'taxes_id', 'price_unit', 'notes', 'product_id', 'move_dest_id', 'account_analytic_id')) |
3362 | @@ -781,7 +784,7 @@ | |||
3363 | 781 | 784 | ||
3364 | 782 | qty = qty or 1.0 | 785 | qty = qty or 1.0 |
3365 | 783 | supplierinfo = False | 786 | supplierinfo = False |
3367 | 784 | supplierinfo_ids = product_supplierinfo.search(cr, uid, [('name','=',partner_id),('product_id','=',product.id)]) | 787 | supplierinfo_ids = product_supplierinfo.search(cr, uid, [('name', '=', partner_id),('product_id', '=', product.product_tmpl_id.id)]) |
3368 | 785 | if supplierinfo_ids: | 788 | if supplierinfo_ids: |
3369 | 786 | supplierinfo = product_supplierinfo.browse(cr, uid, supplierinfo_ids[0], context=context) | 789 | supplierinfo = product_supplierinfo.browse(cr, uid, supplierinfo_ids[0], context=context) |
3370 | 787 | if supplierinfo.product_uom.id != uom_id: | 790 | if supplierinfo.product_uom.id != uom_id: |
3371 | @@ -799,8 +802,12 @@ | |||
3372 | 799 | price = product_pricelist.price_get(cr, uid, [pricelist_id], | 802 | price = product_pricelist.price_get(cr, uid, [pricelist_id], |
3373 | 800 | product.id, qty or 1.0, partner_id, {'uom': uom_id, 'date': date_order})[pricelist_id] | 803 | product.id, qty or 1.0, partner_id, {'uom': uom_id, 'date': date_order})[pricelist_id] |
3374 | 801 | 804 | ||
3375 | 802 | taxes = account_tax.browse(cr, uid, map(lambda x: x.id, product.supplier_taxes_id)) | ||
3376 | 803 | fpos = fiscal_position_id and account_fiscal_position.browse(cr, uid, fiscal_position_id, context=context) or False | 805 | fpos = fiscal_position_id and account_fiscal_position.browse(cr, uid, fiscal_position_id, context=context) or False |
3377 | 806 | a = product.product_tmpl_id.property_account_expense.id | ||
3378 | 807 | if not a: | ||
3379 | 808 | a = product.categ_id.property_account_expense_categ.id | ||
3380 | 809 | a = account_fiscal_position.map_account(cr, uid, fpos, a) | ||
3381 | 810 | taxes = product.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids) | ||
3382 | 804 | taxes_ids = account_fiscal_position.map_tax(cr, uid, fpos, taxes) | 811 | taxes_ids = account_fiscal_position.map_tax(cr, uid, fpos, taxes) |
3383 | 805 | res['value'].update({'price_unit': price, 'taxes_id': taxes_ids}) | 812 | res['value'].update({'price_unit': price, 'taxes_id': taxes_ids}) |
3384 | 806 | 813 | ||
3385 | 807 | 814 | ||
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 | 173 | <notebook colspan="4"> | 173 | <notebook colspan="4"> |
3391 | 174 | <page string="Purchase Order"> | 174 | <page string="Purchase Order"> |
3392 | 175 | <field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="[('supplier', '=', True)]" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}" options='{"quick_create": false}'/> | 175 | <field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="[('supplier', '=', True)]" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}" options='{"quick_create": false}'/> |
3394 | 176 | <field name="partner_address_id" options='{"quick_create": false}'/> | 176 | <field name="partner_address_id" options='{"quick_create": false}' context="{'default_partner_id':partner_id}"/> |
3395 | 177 | <field domain="[('type','=','purchase')]" name="pricelist_id" groups="base.group_extended"/> | 177 | <field domain="[('type','=','purchase')]" name="pricelist_id" groups="base.group_extended"/> |
3396 | 178 | <field name="origin" groups="base.group_extended"/> | 178 | <field name="origin" groups="base.group_extended"/> |
3397 | 179 | <newline/> | 179 | <newline/> |
3398 | 180 | 180 | ||
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 | 48 | if record_ids: | 48 | if record_ids: |
3404 | 49 | res = False | 49 | res = False |
3405 | 50 | invoices = {} | 50 | invoices = {} |
3412 | 51 | invoice_obj=self.pool.get('account.invoice') | 51 | invoice_obj = self.pool.get('account.invoice') |
3413 | 52 | purchase_line_obj=self.pool.get('purchase.order.line') | 52 | purchase_obj = self.pool.get('purchase.order') |
3414 | 53 | property_obj=self.pool.get('ir.property') | 53 | purchase_line_obj = self.pool.get('purchase.order.line') |
3415 | 54 | account_fiscal_obj=self.pool.get('account.fiscal.position') | 54 | invoice_line_obj = self.pool.get('account.invoice.line') |
3416 | 55 | invoice_line_obj=self.pool.get('account.invoice.line') | 55 | account_jrnl_obj = self.pool.get('account.journal') |
3411 | 56 | account_jrnl_obj=self.pool.get('account.journal') | ||
3417 | 57 | 56 | ||
3418 | 58 | def multiple_order_invoice_notes(orders): | 57 | def multiple_order_invoice_notes(orders): |
3419 | 59 | notes = "" | 58 | notes = "" |
3420 | @@ -62,7 +61,6 @@ | |||
3421 | 62 | return notes | 61 | return notes |
3422 | 63 | 62 | ||
3423 | 64 | 63 | ||
3424 | 65 | |||
3425 | 66 | def make_invoice_by_partner(partner, orders, lines_ids): | 64 | def make_invoice_by_partner(partner, orders, lines_ids): |
3426 | 67 | """ | 65 | """ |
3427 | 68 | create a new invoice for one supplier | 66 | create a new invoice for one supplier |
3428 | @@ -99,37 +97,16 @@ | |||
3429 | 99 | order.write({'invoice_ids': [(4, inv_id)]}) | 97 | order.write({'invoice_ids': [(4, inv_id)]}) |
3430 | 100 | return inv_id | 98 | return inv_id |
3431 | 101 | 99 | ||
3434 | 102 | for line in purchase_line_obj.browse(cr,uid,record_ids): | 100 | for line in purchase_line_obj.browse(cr, uid, record_ids, context=context): |
3435 | 103 | if (not line.invoiced) and (line.state not in ('draft','cancel')): | 101 | if (not line.invoiced) and (line.state not in ('draft', 'cancel')): |
3436 | 104 | if not line.partner_id.id in invoices: | 102 | if not line.partner_id.id in invoices: |
3437 | 105 | invoices[line.partner_id.id] = [] | 103 | invoices[line.partner_id.id] = [] |
3465 | 106 | if line.product_id: | 104 | |
3466 | 107 | a = line.product_id.product_tmpl_id.property_account_expense.id | 105 | acc_id = purchase_obj._choose_account_from_po_line(cr, uid, line, context=context) |
3467 | 108 | if not a: | 106 | inv_line_data = purchase_obj._prepare_inv_line(cr, uid, acc_id, line, context=context) |
3468 | 109 | a = line.product_id.categ_id.property_account_expense_categ.id | 107 | inv_line_data.update({'origin': line.order_id.name}) |
3469 | 110 | if not a: | 108 | inv_id = invoice_line_obj.create(cr, uid, inv_line_data, context=context) |
3470 | 111 | raise osv.except_osv(_('Error !'), | 109 | |
3444 | 112 | _('There is no expense account defined ' \ | ||
3445 | 113 | 'for this product: "%s" (id:%d)') % \ | ||
3446 | 114 | (line.product_id.name, line.product_id.id,)) | ||
3447 | 115 | else: | ||
3448 | 116 | a = property_obj.get(cr, uid, | ||
3449 | 117 | 'property_account_expense_categ', 'product.category', | ||
3450 | 118 | context=context).id | ||
3451 | 119 | fpos = line.order_id.fiscal_position or False | ||
3452 | 120 | a = account_fiscal_obj.map_account(cr, uid, fpos, a) | ||
3453 | 121 | inv_id = invoice_line_obj.create(cr, uid, { | ||
3454 | 122 | 'name': line.name, | ||
3455 | 123 | 'origin': line.order_id.name, | ||
3456 | 124 | 'account_id': a, | ||
3457 | 125 | 'price_unit': line.price_unit, | ||
3458 | 126 | 'quantity': line.product_qty, | ||
3459 | 127 | 'uos_id': line.product_uom.id, | ||
3460 | 128 | 'product_id': line.product_id.id or False, | ||
3461 | 129 | 'invoice_line_tax_id': [(6, 0, [x.id for x in line.taxes_id])], | ||
3462 | 130 | 'note': line.notes, | ||
3463 | 131 | 'account_analytic_id': line.account_analytic_id and line.account_analytic_id.id or False, | ||
3464 | 132 | }) | ||
3471 | 133 | purchase_line_obj.write(cr, uid, [line.id], {'invoiced': True, 'invoice_lines': [(4, inv_id)]}) | 110 | purchase_line_obj.write(cr, uid, [line.id], {'invoiced': True, 'invoice_lines': [(4, inv_id)]}) |
3472 | 134 | invoices[line.partner_id.id].append((line,inv_id)) | 111 | invoices[line.partner_id.id].append((line,inv_id)) |
3473 | 135 | 112 | ||
3474 | 136 | 113 | ||
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 | 9 | <form string="Purchase Requisition"> | 9 | <form string="Purchase Requisition"> |
3480 | 10 | <group colspan="2" col="2"> | 10 | <group colspan="2" col="2"> |
3481 | 11 | <field name="partner_id" on_change="onchange_partner_id(partner_id)"/> | 11 | <field name="partner_id" on_change="onchange_partner_id(partner_id)"/> |
3483 | 12 | <field domain="[('partner_id','=',partner_id)]" name="partner_address_id"/> | 12 | <field name="partner_address_id" domain="[('partner_id','=',partner_id)]" options='{"quick_create": false}' context="{'default_partner_id':partner_id}" /> |
3484 | 13 | <separator string="" colspan="4" /> | 13 | <separator string="" colspan="4" /> |
3485 | 14 | <button icon="gtk-cancel" special="cancel" string="_Cancel"/> | 14 | <button icon="gtk-cancel" special="cancel" string="_Cancel"/> |
3486 | 15 | <button icon="gtk-ok" name="create_order" string="Create Quotation" type="object"/> | 15 | <button icon="gtk-ok" name="create_order" string="Create Quotation" type="object"/> |
3487 | 16 | 16 | ||
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 | 126 | <images/> | 126 | <images/> |
3493 | 127 | </stylesheet> | 127 | </stylesheet> |
3494 | 128 | <story> | 128 | <story> |
3495 | 129 | <pto> | ||
3496 | 130 | <para style="terp_default_8">[[repeatIn(objects,'o')]]</para> | 129 | <para style="terp_default_8">[[repeatIn(objects,'o')]]</para> |
3497 | 131 | <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para> | 130 | <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para> |
3498 | 132 | <pto_header> | ||
3499 | 133 | <blockTable colWidths="181.0,70.0,80.0,70.0,50.0,85.0" repeatRows="1" style="Table4"> | ||
3500 | 134 | <tr> | ||
3501 | 135 | <td> | ||
3502 | 136 | <para style="terp_tblheader_Details">Description</para> | ||
3503 | 137 | </td> | ||
3504 | 138 | <td> | ||
3505 | 139 | <para style="terp_tblheader_Details_Centre">VAT</para> | ||
3506 | 140 | </td> | ||
3507 | 141 | <td> | ||
3508 | 142 | <para style="terp_tblheader_Details_Right">Quantity</para> | ||
3509 | 143 | </td> | ||
3510 | 144 | <td> | ||
3511 | 145 | <para style="terp_tblheader_Details_Right">Unit Price</para> | ||
3512 | 146 | </td> | ||
3513 | 147 | <td> | ||
3514 | 148 | <para style="terp_tblheader_Details_Centre">Disc.(%)</para> | ||
3515 | 149 | </td> | ||
3516 | 150 | <td> | ||
3517 | 151 | <para style="terp_tblheader_Details_Right">Price</para> | ||
3518 | 152 | </td> | ||
3519 | 153 | </tr> | ||
3520 | 154 | </blockTable> | ||
3521 | 155 | </pto_header> | ||
3522 | 156 | <para style="terp_default_9"> | 131 | <para style="terp_default_9"> |
3523 | 157 | <font color="white"> </font> | 132 | <font color="white"> </font> |
3524 | 158 | </para> | 133 | </para> |
3525 | @@ -233,6 +208,31 @@ | |||
3526 | 233 | <para style="terp_default_8"> | 208 | <para style="terp_default_8"> |
3527 | 234 | <font color="white"> </font> | 209 | <font color="white"> </font> |
3528 | 235 | </para> | 210 | </para> |
3529 | 211 | <pto> | ||
3530 | 212 | <pto_header> | ||
3531 | 213 | <blockTable colWidths="181.0,70.0,80.0,70.0,50.0,85.0" repeatRows="1" style="Table4"> | ||
3532 | 214 | <tr> | ||
3533 | 215 | <td> | ||
3534 | 216 | <para style="terp_tblheader_Details">Description</para> | ||
3535 | 217 | </td> | ||
3536 | 218 | <td> | ||
3537 | 219 | <para style="terp_tblheader_Details_Centre">VAT</para> | ||
3538 | 220 | </td> | ||
3539 | 221 | <td> | ||
3540 | 222 | <para style="terp_tblheader_Details_Right">Quantity</para> | ||
3541 | 223 | </td> | ||
3542 | 224 | <td> | ||
3543 | 225 | <para style="terp_tblheader_Details_Right">Unit Price</para> | ||
3544 | 226 | </td> | ||
3545 | 227 | <td> | ||
3546 | 228 | <para style="terp_tblheader_Details_Centre">Disc.(%)</para> | ||
3547 | 229 | </td> | ||
3548 | 230 | <td> | ||
3549 | 231 | <para style="terp_tblheader_Details_Right">Price</para> | ||
3550 | 232 | </td> | ||
3551 | 233 | </tr> | ||
3552 | 234 | </blockTable> | ||
3553 | 235 | </pto_header> | ||
3554 | 236 | <blockTable colWidths="181.0,70.0,80.0,70.0,50.0,85.0" repeatRows="1" style="Table4"> | 236 | <blockTable colWidths="181.0,70.0,80.0,70.0,50.0,85.0" repeatRows="1" style="Table4"> |
3555 | 237 | <tr> | 237 | <tr> |
3556 | 238 | <td> | 238 | <td> |
3557 | @@ -310,6 +310,7 @@ | |||
3558 | 310 | </tr> | 310 | </tr> |
3559 | 311 | </blockTable> | 311 | </blockTable> |
3560 | 312 | </section> | 312 | </section> |
3561 | 313 | </pto> | ||
3562 | 313 | <blockTable colWidths="381.0,60.0,93.0" style="Table6"> | 314 | <blockTable colWidths="381.0,60.0,93.0" style="Table6"> |
3563 | 314 | <tr> | 315 | <tr> |
3564 | 315 | <td> | 316 | <td> |
3565 | @@ -365,6 +366,5 @@ | |||
3566 | 365 | <para style="terp_default_8"> | 366 | <para style="terp_default_8"> |
3567 | 366 | <font color="white"> </font> | 367 | <font color="white"> </font> |
3568 | 367 | </para> | 368 | </para> |
3569 | 368 | </pto> | ||
3570 | 369 | </story> | 369 | </story> |
3571 | 370 | </document> | 370 | </document> |
3572 | 371 | 371 | ||
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 | 52 | <search string="Sales Analysis"> | 52 | <search string="Sales Analysis"> |
3578 | 53 | <group> | 53 | <group> |
3579 | 54 | <filter icon="terp-go-year" string="Year" name="year" | 54 | <filter icon="terp-go-year" string="Year" name="year" |
3581 | 55 | domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-01-01'))]" | 55 | domain="[('date','<=', time.strftime('%%Y-12-31')),('date','>=',time.strftime('%%Y-01-01'))]" |
3582 | 56 | help="Sales order created in current year"/> | 56 | help="Sales order created in current year"/> |
3583 | 57 | <separator orientation="vertical"/> | 57 | <separator orientation="vertical"/> |
3584 | 58 | <filter icon="terp-go-month" string="Month" | 58 | <filter icon="terp-go-month" string="Month" |
3585 | 59 | 59 | ||
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 | 756 | return { | 756 | return { |
3591 | 757 | 'name': pick_name, | 757 | 'name': pick_name, |
3592 | 758 | 'origin': order.name, | 758 | 'origin': order.name, |
3594 | 759 | 'date': order.date_order, | 759 | 'date': order.date_confirm, |
3595 | 760 | 'type': 'out', | 760 | 'type': 'out', |
3596 | 761 | 'state': 'auto', | 761 | 'state': 'auto', |
3597 | 762 | 'move_type': order.picking_policy, | 762 | 'move_type': order.picking_policy, |
3598 | @@ -822,7 +822,7 @@ | |||
3599 | 822 | if line.state == 'done': | 822 | if line.state == 'done': |
3600 | 823 | continue | 823 | continue |
3601 | 824 | 824 | ||
3603 | 825 | date_planned = self._get_date_planned(cr, uid, order, line, order.date_order, context=context) | 825 | date_planned = self._get_date_planned(cr, uid, order, line, order.date_confirm, context=context) |
3604 | 826 | 826 | ||
3605 | 827 | if line.product_id: | 827 | if line.product_id: |
3606 | 828 | if line.product_id.product_tmpl_id.type in ('product', 'consu'): | 828 | if line.product_id.product_tmpl_id.type in ('product', 'consu'): |
3607 | @@ -1206,6 +1206,7 @@ | |||
3608 | 1206 | product_uom_obj = self.pool.get('product.uom') | 1206 | product_uom_obj = self.pool.get('product.uom') |
3609 | 1207 | partner_obj = self.pool.get('res.partner') | 1207 | partner_obj = self.pool.get('res.partner') |
3610 | 1208 | product_obj = self.pool.get('product.product') | 1208 | product_obj = self.pool.get('product.product') |
3611 | 1209 | fpos_obj = self.pool.get('account.fiscal.position') | ||
3612 | 1209 | context = dict(context, lang=lang, partner_id=partner_id) | 1210 | context = dict(context, lang=lang, partner_id=partner_id) |
3613 | 1210 | if partner_id: | 1211 | if partner_id: |
3614 | 1211 | lang = partner_obj.browse(cr, uid, partner_id, context=context).lang | 1212 | lang = partner_obj.browse(cr, uid, partner_id, context=context).lang |
3615 | @@ -1241,7 +1242,12 @@ | |||
3616 | 1241 | fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position, context=context) or False | 1242 | fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position, context=context) or False |
3617 | 1242 | if update_tax: #The quantity only have changed | 1243 | if update_tax: #The quantity only have changed |
3618 | 1243 | result['delay'] = (product_obj.sale_delay or 0.0) | 1244 | result['delay'] = (product_obj.sale_delay or 0.0) |
3620 | 1244 | result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id) | 1245 | a = product_obj.product_tmpl_id.property_account_income.id |
3621 | 1246 | if not a: | ||
3622 | 1247 | a = product_obj.categ_id.property_account_income_categ.id | ||
3623 | 1248 | a = fpos_obj.map_account(cr, uid, fpos, a) | ||
3624 | 1249 | taxes = product_obj.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids) | ||
3625 | 1250 | result['tax_id'] = fpos_obj.map_tax(cr, uid, fpos, taxes) | ||
3626 | 1245 | result.update({'type': product_obj.procure_method}) | 1251 | result.update({'type': product_obj.procure_method}) |
3627 | 1246 | 1252 | ||
3628 | 1247 | if not flag: | 1253 | if not flag: |
3629 | 1248 | 1254 | ||
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 | 116 | <notebook colspan="5"> | 116 | <notebook colspan="5"> |
3635 | 117 | <page string="Sales Order"> | 117 | <page string="Sales Order"> |
3636 | 118 | <field name="partner_id" options='{"quick_create": false}' on_change="onchange_partner_id(partner_id)" domain="[('customer','=',True)]" context="{'search_default_customer':1}" required="1"/> | 118 | <field name="partner_id" options='{"quick_create": false}' on_change="onchange_partner_id(partner_id)" domain="[('customer','=',True)]" context="{'search_default_customer':1}" required="1"/> |
3640 | 119 | <field domain="[('partner_id','=',partner_id)]" name="partner_order_id" on_change="onchange_partner_order_id(partner_order_id, partner_invoice_id, partner_shipping_id)" options='{"quick_create": false}'/> | 119 | <field domain="[('partner_id','=',partner_id)]" name="partner_order_id" on_change="onchange_partner_order_id(partner_order_id, partner_invoice_id, partner_shipping_id)" options='{"quick_create": false}' context="{'default_partner_id':partner_id}"/> |
3641 | 120 | <field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id" groups="base.group_extended" options='{"quick_create": false}'/> | 120 | <field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id" groups="base.group_extended" options='{"quick_create": false}' context="{'default_partner_id':partner_id}"/> |
3642 | 121 | <field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id" groups="base.group_extended" options='{"quick_create": false}'/> | 121 | <field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id" groups="base.group_extended" options='{"quick_create": false}' context="{'default_partner_id':partner_id}"/> |
3643 | 122 | <field domain="[('type','=','sale')]" name="pricelist_id" groups="base.group_extended" on_change="onchange_pricelist_id(pricelist_id,order_line)"/> | 122 | <field domain="[('type','=','sale')]" name="pricelist_id" groups="base.group_extended" on_change="onchange_pricelist_id(pricelist_id,order_line)"/> |
3644 | 123 | <field name="project_id" context="{'partner_id':partner_id, 'contact_id':partner_order_id, 'pricelist_id':pricelist_id, 'default_name':name}" groups="analytic.group_analytic_accounting" domain="[('type','<>','view'), ('company_id', '=', company_id), ('parent_id', '!=', False)]"/> | 123 | <field name="project_id" context="{'partner_id':partner_id, 'contact_id':partner_order_id, 'pricelist_id':pricelist_id, 'default_name':name}" groups="analytic.group_analytic_accounting" domain="[('type','<>','view'), ('company_id', '=', company_id), ('parent_id', '!=', False)]"/> |
3645 | 124 | <newline/> | 124 | <newline/> |
3646 | 125 | 125 | ||
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 | 153 | 'date': fields.datetime('Date', readonly=True), | 153 | 'date': fields.datetime('Date', readonly=True), |
3652 | 154 | 'year': fields.char('Year', size=4, readonly=True), | 154 | 'year': fields.char('Year', size=4, readonly=True), |
3653 | 155 | 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), | 155 | 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), |
3655 | 156 | ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September')]), | 156 | ('05', 'May'), ('06', 'June'), ('07', 'July'), ('08', 'August'), ('09', 'September'), |
3656 | 157 | ('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly = True), | ||
3657 | 157 | 'partner_id':fields.many2one('res.partner.address', 'Partner', readonly=True), | 158 | 'partner_id':fields.many2one('res.partner.address', 'Partner', readonly=True), |
3658 | 158 | 'product_id':fields.many2one('product.product', 'Product', readonly=True), | 159 | 'product_id':fields.many2one('product.product', 'Product', readonly=True), |
3659 | 159 | 'product_categ_id':fields.many2one('product.category', 'Product Category', readonly=True), | 160 | 'product_categ_id':fields.many2one('product.category', 'Product Category', readonly=True), |
3660 | @@ -173,6 +174,8 @@ | |||
3661 | 173 | CREATE OR REPLACE view report_stock_inventory AS ( | 174 | CREATE OR REPLACE view report_stock_inventory AS ( |
3662 | 174 | (SELECT | 175 | (SELECT |
3663 | 175 | min(m.id) as id, m.date as date, | 176 | min(m.id) as id, m.date as date, |
3664 | 177 | to_char(m.date, 'YYYY') as year, | ||
3665 | 178 | to_char(m.date, 'MM') as month, | ||
3666 | 176 | m.address_id as partner_id, m.location_id as location_id, | 179 | m.address_id as partner_id, m.location_id as location_id, |
3667 | 177 | m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, | 180 | m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, |
3668 | 178 | m.company_id, | 181 | m.company_id, |
3669 | @@ -196,6 +199,8 @@ | |||
3670 | 196 | ) UNION ALL ( | 199 | ) UNION ALL ( |
3671 | 197 | SELECT | 200 | SELECT |
3672 | 198 | -m.id as id, m.date as date, | 201 | -m.id as id, m.date as date, |
3673 | 202 | to_char(m.date, 'YYYY') as year, | ||
3674 | 203 | to_char(m.date, 'MM') as month, | ||
3675 | 199 | m.address_id as partner_id, m.location_dest_id as location_id, | 204 | m.address_id as partner_id, m.location_dest_id as location_id, |
3676 | 200 | m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, | 205 | m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type, |
3677 | 201 | m.company_id, | 206 | m.company_id, |
3678 | 202 | 207 | ||
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 | 1268 | 'product_uos_qty': product_qty, #TODO: put correct uos_qty | 1268 | 'product_uos_qty': product_qty, #TODO: put correct uos_qty |
3684 | 1269 | 'picking_id' : new_picking, | 1269 | 'picking_id' : new_picking, |
3685 | 1270 | 'state': 'assigned', | 1270 | 'state': 'assigned', |
3687 | 1271 | 'move_dest_id': False, | 1271 | 'move_dest_id': move.move_dest_id.id, |
3688 | 1272 | 'price_unit': move.price_unit, | 1272 | 'price_unit': move.price_unit, |
3689 | 1273 | 'product_uom': product_uoms[move.id] | 1273 | 'product_uom': product_uoms[move.id] |
3690 | 1274 | } | 1274 | } |
3691 | @@ -2572,7 +2572,7 @@ | |||
3692 | 2572 | 'product_uos_qty': product_qty, | 2572 | 'product_uos_qty': product_qty, |
3693 | 2573 | 'picking_id' : move.picking_id.id, | 2573 | 'picking_id' : move.picking_id.id, |
3694 | 2574 | 'state': 'assigned', | 2574 | 'state': 'assigned', |
3696 | 2575 | 'move_dest_id': False, | 2575 | 'move_dest_id': move.move_dest_id.id, |
3697 | 2576 | 'price_unit': move.price_unit, | 2576 | 'price_unit': move.price_unit, |
3698 | 2577 | } | 2577 | } |
3699 | 2578 | prodlot_id = prodlot_ids[move.id] | 2578 | prodlot_id = prodlot_ids[move.id] |
3700 | 2579 | 2579 | ||
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 | 72 | res.update({'invoice_state': 'none'}) | 72 | res.update({'invoice_state': 'none'}) |
3706 | 73 | return_history = self.get_return_history(cr, uid, record_id, context) | 73 | return_history = self.get_return_history(cr, uid, record_id, context) |
3707 | 74 | for line in pick.move_lines: | 74 | for line in pick.move_lines: |
3711 | 75 | qty = line.product_qty - return_history[line.id] | 75 | if line.state <> 'cancel': |
3712 | 76 | if qty > 0: | 76 | qty = line.product_qty - return_history[line.id] |
3713 | 77 | result1.append({'product_id': line.product_id.id, 'quantity': qty,'move_id':line.id}) | 77 | if qty > 0: |
3714 | 78 | result1.append({'product_id': line.product_id.id, 'quantity': qty,'move_id':line.id}) | ||
3715 | 78 | if 'product_return_moves' in fields: | 79 | if 'product_return_moves' in fields: |
3716 | 79 | res.update({'product_return_moves': result1}) | 80 | res.update({'product_return_moves': result1}) |
3717 | 80 | return res | 81 | return res |
3718 | @@ -128,7 +129,7 @@ | |||
3719 | 128 | # a valid return move will be the exact opposite of ours: | 129 | # a valid return move will be the exact opposite of ours: |
3720 | 129 | # (src location, dest location) <=> (dest location, src location)) | 130 | # (src location, dest location) <=> (dest location, src location)) |
3721 | 130 | if rec.location_dest_id.id == m.location_id.id \ | 131 | if rec.location_dest_id.id == m.location_id.id \ |
3723 | 131 | and rec.location_id.id == m.location_dest_id.id: | 132 | and rec.location_id.id == m.location_dest_id.id and rec.state != 'cancel': |
3724 | 132 | return_history[m.id] += (rec.product_qty * rec.product_uom.factor) | 133 | return_history[m.id] += (rec.product_qty * rec.product_uom.factor) |
3725 | 133 | return return_history | 134 | return return_history |
3726 | 134 | 135 | ||
3727 | @@ -166,9 +167,14 @@ | |||
3728 | 166 | new_type = 'internal' | 167 | new_type = 'internal' |
3729 | 167 | seq_obj_name = 'stock.picking.' + new_type | 168 | seq_obj_name = 'stock.picking.' + new_type |
3730 | 168 | new_pick_name = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name) | 169 | new_pick_name = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name) |
3734 | 169 | new_picking = pick_obj.copy(cr, uid, pick.id, {'name':'%s-%s-return' % (new_pick_name, pick.name), | 170 | new_picking = pick_obj.copy(cr, uid, pick.id, { |
3735 | 170 | 'move_lines':[], 'state':'draft', 'type':new_type, | 171 | 'name':'%s-%s-return' % (new_pick_name, pick.name), |
3736 | 171 | 'date':date_cur, 'invoice_state':data['invoice_state'],}) | 172 | 'move_lines':[], |
3737 | 173 | 'state':'draft', | ||
3738 | 174 | 'backorder_id': False, | ||
3739 | 175 | 'type':new_type, | ||
3740 | 176 | 'date':date_cur, | ||
3741 | 177 | 'invoice_state':data['invoice_state'],}) | ||
3742 | 172 | 178 | ||
3743 | 173 | val_id = data['product_return_moves'] | 179 | val_id = data['product_return_moves'] |
3744 | 174 | for v in val_id: | 180 | for v in val_id: |
3745 | 175 | 181 | ||
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 | 184 | """ | 184 | """ |
3751 | 185 | 185 | ||
3752 | 186 | user_id = False | 186 | user_id = False |
3754 | 187 | login = tools.ustr(login) | 187 | login = tools.ustr(login.lower()) |
3755 | 188 | cr.execute("SELECT id, active FROM res_users WHERE login=%s", (login,)) | 188 | cr.execute("SELECT id, active FROM res_users WHERE login=%s", (login,)) |
3756 | 189 | res = cr.fetchone() | 189 | res = cr.fetchone() |
3757 | 190 | if res: | 190 | if res: |
3758 | 191 | 191 | ||
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 | 231 | class purchase_order_line(osv.osv): | 231 | class purchase_order_line(osv.osv): |
3764 | 232 | _inherit = 'purchase.order.line' | 232 | _inherit = 'purchase.order.line' |
3765 | 233 | def onchange_product_id(self,cr, uid, ids, pricelist, product, qty, uom, | 233 | def onchange_product_id(self,cr, uid, ids, pricelist, product, qty, uom, |
3767 | 234 | partner_id, date_order=False, fiscal_position=False, date_planned=False, | 234 | partner_id, date_order=False, fiscal_position_id=False, date_planned=False, |
3768 | 235 | name=False, price_unit=False, notes=False, context=None): | 235 | name=False, price_unit=False, notes=False, context=None): |
3769 | 236 | warning = {} | 236 | warning = {} |
3770 | 237 | if not product: | 237 | if not product: |
3771 | @@ -250,7 +250,7 @@ | |||
3772 | 250 | warning['message'] = message | 250 | warning['message'] = message |
3773 | 251 | 251 | ||
3774 | 252 | result = super(purchase_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, uom, | 252 | result = super(purchase_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, uom, |
3776 | 253 | partner_id, date_order, fiscal_position) | 253 | partner_id, date_order, fiscal_position_id) |
3777 | 254 | 254 | ||
3778 | 255 | if result.get('warning',False): | 255 | if result.get('warning',False): |
3779 | 256 | warning['title'] = title and title +' & '+result['warning']['title'] or result['warning']['title'] | 256 | warning['title'] = title and title +' & '+result['warning']['title'] or result['warning']['title'] |
3780 | 257 | 257 | ||
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 | 81 | } | 81 | } |
3786 | 82 | group = self.browse(cr, uid, group_id, context=context) | 82 | group = self.browse(cr, uid, group_id, context=context) |
3787 | 83 | value['domain'] = "[('group_id','=',%d)]" % (group.id) | 83 | value['domain'] = "[('group_id','=',%d)]" % (group.id) |
3788 | 84 | value['context'] = "{'default_group_id': %d}" % (group.id) | ||
3789 | 84 | if group.method == 'page': | 85 | if group.method == 'page': |
3790 | 85 | value['res_id'] = group.home.id | 86 | value['res_id'] = group.home.id |
3791 | 86 | elif group.method == 'list': | 87 | elif group.method == 'list': |
3792 | 87 | 88 | ||
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 | 66 | } | 66 | } |
3798 | 67 | group = obj_wiki_group.browse(cr, uid, group_id, context=context) | 67 | group = obj_wiki_group.browse(cr, uid, group_id, context=context) |
3799 | 68 | value['domain'] = "[('group_id','=',%d)]" % (group.id) | 68 | value['domain'] = "[('group_id','=',%d)]" % (group.id) |
3800 | 69 | value['context'] = "{'default_group_id': %d}" % (group.id) | ||
3801 | 69 | if group.method == 'page': | 70 | if group.method == 'page': |
3802 | 70 | value['res_id'] = group.home.id | 71 | value['res_id'] = group.home.id |
3803 | 71 | elif group.method == 'list': | 72 | elif group.method == 'list': |
3804 | 72 | 73 | ||
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 | 41 | for group in self.pool.get('wiki.groups').browse(cr, uid, group_ids, context=context): | 41 | for group in self.pool.get('wiki.groups').browse(cr, uid, group_ids, context=context): |
3810 | 42 | value = { | 42 | value = { |
3811 | 43 | 'domain': "[('group_id','=',%d)]" % (group.id), | 43 | 'domain': "[('group_id','=',%d)]" % (group.id), |
3812 | 44 | 'context': "{'default_group_id': %d}" % (group.id), | ||
3813 | 44 | 'name': 'Wiki Page', | 45 | 'name': 'Wiki Page', |
3814 | 45 | 'view_type': 'form', | 46 | 'view_type': 'form', |
3815 | 46 | 'view_mode': 'form,tree', | 47 | 'view_mode': 'form,tree', |
LGTM