Merge lp:~openerp-dev/openobject-addons/trunk-opw-581301-port-skh into lp:openobject-addons

Proposed by Somesh Khare
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-opw-581301-port-skh
Merge into: lp:openobject-addons
Diff against target: 60 lines (+16/-14)
1 file modified
account/account_invoice.py (+16/-14)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-opw-581301-port-skh
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+136097@code.launchpad.net

Description of the change

Hello Sir,

[FIX]Invoice: on change account in invoice line did not shows the taxes of the changed accounts.

Steps:
1 - I take the product ARM100 which has no taxes set up
2 - I create a supplier invoice
3 - I create a invoice line
4 - I select the product ARM100
5 - I change the account to an other one with no taxeand use the tab to trigger the on_change

PROBLEM : I see a tax while neither my product nor my account have any taxes set by default.

This branch fixes this issue, Kindly review the branch and please share your views.

Thanks
Somesh Khare

To post a comment you must log in.
8118. By Fabien (Open ERP)

[IMP] account fixes

8119. By Fabien (Open ERP)

[IMP] HR Leaves useability

8120. By Fabien (Open ERP)

[IMP] Open marketing menu after install small crm form improvement

8121. By Fabien (Open ERP)

[IMP] some timesheet invoices fixes (not all)

8122. By Fabien (Open ERP)

[IMP] Sales team on invoices

8123. By Fabien (Open ERP)

[IMP] MRP quick create poducts from BoM

8124. By Fabien (Open ERP)

[IMP] removed extra dependency fetchmail

8125. By Fabien (Open ERP)

[IMP] Repair useability

8126. By Fabien (Open ERP)

[IMP] PoS Useability

8127. By Fabien (Open ERP)

[MERGED] already merged

8128. By Fabien (Open ERP)

[IMP] useability ideas

8129. By Fabien (Open ERP)

[FIX] domain on invoice lines

8130. By Fabien (Open ERP)

[FIX] typo

8131. By Quentin (OpenERP) <email address hidden>

[MERGE] staging branch

8132. By Olivier Dony (Odoo)

[FIX] update_notifications: typo

8133. By Fabien (Open ERP)

[IMP] Misc useability improvement in account
[MERGE] warehouse misc imp, receptions
[IMP] fixes in po

8134. By Fabien (Open ERP)

[FIX] account multi-company & crm log call

8135. By Fabien (Open ERP)

[IMP] CSS fix

8136. By Fabien (Open ERP)

[IMP] wording, no default filter for archives

8137. By Fabien (Open ERP)

[FIX] bug in repair, mo when creating a stock.move

8138. By Fabien (Open ERP)

[FIX] crm small fixes

8139. By Fabien (Open ERP)

[MERGE] empty to close MP

8140. By Fabien (Open ERP)

[IMP] case stage fix for actions

8141. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8142. By Fabien (Open ERP)

[MERGE] addons 24

8143. By Fabien (Open ERP)

[MERGE] fgi improve

8144. By Antony Lesuisse (OpenERP)

[MERGE] signup with oauth by rco

8145. By Antony Lesuisse (OpenERP)

[IMP] auth_signup remove all css, better wording, auth_oauth align button better wording

8146. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8147. By Raphael Collet (OpenERP)

[MERGE] trunk-oauth-signin-rco (small improvements in modules auth_oauth, auth_reset_password, auth_signup)

8148. By Raphael Collet (OpenERP)

[FIX] auth_oauth: revert not-so-smart change

8149. By vta <email address hidden>

[MERGE] trunk-bug-1081044-vja.

8150. By Raphael Collet (OpenERP)

[IMP] auth_oauth: factor js method to make it reusable

8151. By Raphael Collet (OpenERP)

[IMP] auth_reset_password: when sending email, return error message when user has no email address

8152. By Quentin (OpenERP) <email address hidden>

[MERGE] merged the branch with new constraints on accounting + fixes that were spotted by those constraints

8153. By Quentin (OpenERP) <email address hidden>

[MERGE] staging branch, with fixes in contracts

8154. By Thibault Delavallée (OpenERP)

[FIX] Accuracy of the various server actions 'mark read' and 'mark unread': updated their name by adding the model name to be more precise when seing them in a list.

8155. By Fabien Meghazi (OpenERP)

[REM] Removed manual many2many tags from kanban views

Kanban view supports many2many as m2m tags by default.

8156. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8157. By vta <email address hidden>

[MERGE] trunk-improve_portal-vta.

8158. By Xavier (Open ERP)

[MERGE] evalpocalypse-related fixes

8159. By Christophe Matthieu (OpenERP)

[MERGE] form trunk-openchatter-vive-lilo-chm; Improve openchatter and fix

8160. By Antony Lesuisse (OpenERP)

[FIX] auth_signup on token

8161. By Fabien (Open ERP)

[IMP] fixes for kanban column visible in tasks & issues

8162. By Fabien (Open ERP)

[FIX] project issue

8163. By Fabien (Open ERP)

[FIX]

8164. By Denis Ledoux (OpenERP)

[FIX]Hide useless columns in bank statement

8165. By Fabien (Open ERP)

[IMP] project_issue private note for phu

8166. By Fabien (Open ERP)

[IMP] layout issue forms

8167. By Quentin (OpenERP) <email address hidden>

[MERGE] staging branch with fixes on slow analysis reports, and contracts managements

8168. By Antony Lesuisse (OpenERP)

[MERGE] account journal items widget by dle

8169. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8170. By Nicolas Vanhoren (OpenERP)

[IMP] Removed usage of method date.today() in xml files.

8171. By Cedric Snauwaert (OpenERP)

[FIX]fleet : generation of contract cost should take into account current day too

8172. By Fabien (Open ERP)

[IMP] merge addons23

8173. By Olivier Dony (Odoo)

[MERGE] Fix sale.order.line's `invoiced` flag, as part of forward-port of 6.1 server bugfixes

After forward-porting the 6.1 server bugfixes to trunk, a hidden bug
was revealed in the way sale.order.line's `invoiced` field
is updated. It makes the sale/test/cancel_order.yml test fail,
because the "recreate invoice" action does not work properly
if there are multiple cancelled invoices, due to incorrect
and outdated `invoiced` values on sale.order.lines.

By replacing the invoiced field with a stored fields.function
we simplify the code and fix this incorrect behavior at the
same time.

8174. By Fabien (Open ERP)

[IMP] followup

8175. By Fabien (Open ERP)

[IMP]

8176. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8177. By Fabien (Open ERP)

[FIX] followup

8178. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8179. By Fabien (Open ERP)

[MERGE] sequence in l10n_nl + cleaned indentation

8180. By Fabien (Open ERP)

[MERGE] l10n_nl fiscal positions

8181. By Fabien (Open ERP)

[FIX] account creation

8182. By Fabien (Open ERP)

[MERGE] fix create invoice on picking

8183. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8184. By Christophe Matthieu (OpenERP)

[MERGE] from trunk-openchatter-doc-chm: doc to use openchatter client action and options

8185. By Christophe Matthieu (OpenERP)

[MERGE] from trunk-patest-w45: date and timerelative with timezone

8186. By Christophe Matthieu (OpenERP)

[MERGE] from trunk-fix-1084424: use abs(v)<epsilon when checking a small difference between 2 values

8187. By Olivier Dony (Odoo)

[I18N] Update translation templates for latest changes

8188. By Olivier Dony (Odoo)

[I18N] Removed duplicated terms for inherited [_sql]_constraints -> 400 terms removed

8189. By Xavier (Open ERP)

[REM] stock_planning reintroduced after launchpad export

8190. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8191. By vta <email address hidden>

[MERGE] Merged lp:~openerp-dev/openobject-addons/trunk-filters-warehouse-pja into lp:openobject-addons, which solves some tracebacks when filtering in warehouse.

8192. By Arnaud Pineux (OpenERP)

[FIX] Lunch wrong access rights

8193. By Quentin (OpenERP) <email address hidden>

[MERGE] staging branch with misc fixes in accounting

8194. By Raphael Collet (OpenERP)

[MERGE] trunk-merge_signup_resetpw-rco (merge auth_reset_password into auth_signup)

8195. By Quentin (OpenERP) <email address hidden>

[MERGE] merged the branch with supplier payment term from alexis de Lattre (Akretion). Thanks for the nice proposal

8196. By Christophe Simonis (OpenERP)

[FIX] web_analytics: works in monodb mode

8197. By vta <email address hidden>

[MERGE] lp:~openerp-dev/openobject-addons/trunk-bug-1080127-pja

8198. By Olivier Dony (Odoo)

[MERGE] stock: proper quantity rounding, courtesy of Sebastien Lange (Syleam)

8199. By vta <email address hidden>

[MERGE] lp:~openerp-dev/openobject-addons/trunk-bug-1079205-pja

8200. By Olivier Dony (Odoo)

[FIX] auth_signup: missing translation marks in JS text

8201. By Olivier Dony (Odoo)

[I18N] auth_signup: regenerate translation template after merging with auth_reset_password + carry over existing po entries

8202. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8203. By Olivier Dony (Odoo)

[MERGE] Added Columbia Chart of Accounts, courtesy of Vauxoo

8204. By vta <email address hidden>

[MERGE] lp:~openerp-dev/openobject-addons/trunk-bug-938728-odo

8205. By vta <email address hidden>

[FIX] Fix parameter name as per my previous commit

8206. By Olivier Dony (Odoo)

[MERGE] Updated Venezuela Chart of Accounts, courtesy of Vauxoo

8207. By Olivier Dony (Odoo)

[MERGE] account.invoice: cleanup useless code, courtesy of Raphaël Valyi (Akretion)

8208. By vta <email address hidden>

[MERGE] lp:~openerp-dev/openobject-addons/trunk-bug-1085410-psa

8209. By Arnaud Pineux (OpenERP)

[FIX] lunch cashmove

8210. By Arnaud Pineux (OpenERP)

[MERGE] with account-invoice-api

8211. By vta <email address hidden>

[FIX] Bug https://bugs.launchpad.net/openobject-addons/+bug/1085787.

8212. By vta <email address hidden>

[MERGE] lp:~openerp-dev/openobject-addons/trunk-bug-1038189-kbh-new

8213. By vta <email address hidden>

[MERGE] lp:~openerp-dev/openobject-addons/trunk-bug-1083763-ggh

8214. By Christophe Matthieu (OpenERP)

[FIX] mail: on_scroll activate expandable message, reverse order of messages for the root thread.

8215. By vta <email address hidden>

[MERGE] lp:~openerp-dev/openobject-addons/trunk-bug-1083703-dhr

8216. By vta <email address hidden>

[MERGE] lp:~openerp-dev/openobject-addons/trunk-bug-1082849-sgo

8217. By Christophe Simonis (OpenERP)

[IMP] auth_oauth: allow to redirect to a given action

8218. By Antony Lesuisse (OpenERP)

[IMP] anonymous login target current

8219. By Antony Lesuisse (OpenERP)

[IMP] portal_anonymous
add anonymous to the portal group. When both portal and anonymous are
installed, anonymous user can see the public subset of the portal menu.

8220. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8221. By Raphael Collet (OpenERP)

[FIX] auth_signup: automatically invite new users to set their password *only* when created from the users form view

8222. By Quentin (OpenERP) <email address hidden>

[MERGE] accont_check_writing: batch printing

8223. By Quentin (OpenERP) <email address hidden>

[MERGE] trunk-traceback-issue-3

8224. By Raphael Collet (OpenERP)

[IMP] auth_signup: move exception guard from second-order method to controller method

8225. By Cedric Snauwaert (OpenERP)

[ADD]access rights and group for fleet

8226. By Quentin (OpenERP) <email address hidden>

[MERGE] account_test module

8227. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8228. By Quentin (OpenERP) <email address hidden>

[MERGE] merged the branch of jco with account_followup improvement, fixes and refactoring. It also includes a fix of the function search on credit field of res.partner that wasn't given proper results if a partner had no account.move.line

8229. By Arnaud Pineux (OpenERP)

[MERGE] with purchase_double_validation fix

8230. By Xavier (Open ERP)

[FIX] stock: warehous board actions domains

8231. By Xavier (Open ERP)

[FIX] board: missed JS-ification of context and domains evaluations

various contexts and domains would remain unevaluated during the loading of board actions, leading to errors down the line

8232. By vta <email address hidden>

[MERGE] lp:~openerp-dev/openobject-addons/trunk-bug-1085017-psa

8233. By Raphael Collet (OpenERP)

[MERGE] lp:~vrt-openerp/openobject-addons/trunk-bug-932584 (manage working times as local times)

8234. By vta <email address hidden>

[MERGE] lp:~openerp-dev/openobject-addons/trunk-bug-1076374-hip

8235. By vta <email address hidden>

[MERGE] lp:~openerp-dev/openobject-addons/trunk-bug-1086918-aja

8236. By Raphael Collet (OpenERP)

[REV] undo revid:<email address hidden>, because a potentially better patch is in line

8237. By Quentin (OpenERP) <email address hidden>

[MERGE] staging branch

8238. By Olivier Dony (Odoo)

[MERGE] Another batch of Bugfixes from 6.1

Up to 6.1 revision 6800 <email address hidden>

8239. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8240. By Fabien (Open ERP)

[MERGE] fix account asset, event, purchase

8241. By Fabien (Open ERP)

[IMP] fields name

8242. By Fabien (Open ERP)

[FIX] product_id in SO line tree

8243. By Fabien (Open ERP)

[MERGE] improvements in projects

8244. By Fabien (Open ERP)

[MERGE] fixes + cleaning hr_evaluation

8245. By Fabien (Open ERP)

[MERGE] Misc Fixes

8246. By Fabien (Open ERP)

[IMP] better demo data for contracts

8247. By Fabien (Open ERP)

fix

8248. By Fabien (Open ERP)

[IMP] implification of payment terms, it even works without balance line

8249. By Fabien (Open ERP)

[IMP] purchase min qty useability

8250. By Fabien (Open ERP)

[IMP] typo

8251. By Antony Lesuisse (OpenERP)

[MERGE] improve_crm_leads_flux by abo

8252. By Fabien (Open ERP)

[MERGE] stock improvement in views + misc typo

8253. By Fabien (Open ERP)

[MERGE]

8254. By Fabien (Open ERP)

[IMP] button in MO

8255. By Fabien (Open ERP)

[IMP] better form view

8256. By Fabien (Open ERP)

[IMP] layout ftp config

8257. By Antony Lesuisse (OpenERP)

[MERGE] portal fixes groups, payments, shortcut
portal_stock has been removed from this merge, sale_order state is enough.

8258. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8259. By Fabien (Open ERP)

[MERGE] module desc + stock

8260. By Fabien (Open ERP)

[MERGE] ps week 46/47, sale order report + invite

8261. By Fabien (Open ERP)

[IMP] fetchmail config and auto-install by default as it's the way to configure incoming emails

8262. By Antony Lesuisse (OpenERP)

[FIX] incorrect import, prepare for wizard removal

8263. By Antony Lesuisse (OpenERP)

[FIX] more incorrect import, prepare for wizard removal

8264. By Antony Lesuisse (OpenERP)

[FIX] required on boolean warning

8265. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8266. By Raphael Collet (OpenERP)

[IMP] resource: improve ugly code in conversion function

8267. By vta <email address hidden>

[FIX] Added portal_stock

8268. By Antony Lesuisse (OpenERP)

[FIX] document_webdav graceful import

8269. By Thibault Delavallée (OpenERP)

[MERGE] Perform auto-join and mailboxes+needaction speed udpate. Addons-side branch, holding an update of functional fields to use _auto_join and refactoring of starred messages implementation.

mail_thread
- updated the message_unread function field, now returning a domain on mail_message notifications. This domain is quite complex and redundant, but mandatory in 7.0 considering the limitations of _auto_join
- message_ids is now using auto_join
- removed message_comment_ids field, not necessary and that lead to confusing data on kanban views
mail_message:
- notifications_ids is now using auto_join
- refactored the todo, now delegated to the notifications
- the favorite_user_ids field is therefore removed, and various methods updated
- updated _search_to_read and _search_starred to return a domain on notifications
- updated the domains of the mailboxes accordingly

8270. By Fabien (Open ERP)

[IMP] contract management

8271. By Fabien (Open ERP)

[IMP] better contract search view

8272. By Fabien (Open ERP)

[IMP] contracts

8273. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8274. By Denis Ledoux (OpenERP)

[FIX]Chart of analytic account parent not displayed in toolbar

8275. By Josse Colpaert (OpenERP)

[MERGE] account: missing rename of payment term id after recent change

8276. By Cedric Snauwaert (OpenERP)

[FIX]fleet : go to fleet menu after installation, change demo data, correct some bugs

8277. By Fabien (Open ERP)

[iMP] contract, add customer name

8278. By Olivier Laurent (Open ERP)

[IMP] analytic: 'code' field: remove size limit

8279. By Christophe Matthieu (OpenERP)

[MERGE] catch and display error when there are an error in an attachment upload. Add mail/download_attachment controllers

8280. By Arnaud Pineux (OpenERP)

[IMP] groups and menuitems

8281. By Arnaud Pineux (OpenERP)

[MERGE] with branch bug-1052079

8282. By Olivier Dony (Odoo)

[MERGE] Addition of Croatian Chart of Accounts, courtesy of Goran Kliska

8283. By Olivier Dony (Odoo)

[FIX] project_long_term: quick hacks to avoid crash at project phase creation

This is broken by design, and crashes now that the
"Day" UOM was renamed to "Day(s)". Needs to be
reviewed correctly, there are other things that
will break.

8284. By Antony Lesuisse (OpenERP)

[MERGE] l10n_be coda refactoring

8285. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8286. By Quentin (OpenERP) <email address hidden>

[MERGE] fixes about virtual ids in base_calendar + dependancy fixed in sale_journal

8287. By Quentin (OpenERP) <email address hidden>

[MERGE] staging branch

8288. By Christophe Matthieu (OpenERP)

[MERGE] project: remove wrong div (convert into qweb t tag) into the kanban view for a good rendering.

8289. By Arnaud Pineux (OpenERP)

[MERGE] with trunk-bug-1078628-api

8290. By Arnaud Pineux (OpenERP)

[FIX] mrp.repair fixed

8291. By Quentin (OpenERP) <email address hidden>

[MERGE] staging branch with fixes, again, on base_calendar and virtual ids

8292. By Fabien Meghazi (OpenERP)

[IMP] mail: some IE specific css

8293. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

8294. By vta <email address hidden>

[MERGE] Modified the way that OpenERP allows anonymous user to log into the public part (portal_anonymous). Also portal module is auto_install (and all its dependencies).

8295. By Cedric Snauwaert (OpenERP)

[FIX]better error message in my timesheet(give correct employee name) and fix error on creation saying that user_id was recquired in some cases

8296. By Quentin (OpenERP) <email address hidden>

[REV] revert of revision 8290, which was fixing the bug in a wrong way

8297. By Somesh Khare

[IMP] Invoice: improved variable name a with account including the fix of account change on invoice line(Reference: Case 581301)

Unmerged revisions

8297. By Somesh Khare

[IMP] Invoice: improved variable name a with account including the fix of account change on invoice line(Reference: Case 581301)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_invoice.py'
2--- account/account_invoice.py 2012-12-08 10:45:58 +0000
3+++ account/account_invoice.py 2012-12-13 11:59:22 +0000
4@@ -1454,23 +1454,25 @@
5 context.update({'lang': part.lang})
6 result = {}
7 res = self.pool.get('product.product').browse(cr, uid, product, context=context)
8-
9 if type in ('out_invoice','out_refund'):
10- a = res.product_tmpl_id.property_account_income.id
11- if not a:
12- a = res.categ_id.property_account_income_categ.id
13+ account = res.product_tmpl_id.property_account_income.id
14+ if not account:
15+ account = res.categ_id.property_account_income_categ.id
16 else:
17- a = res.product_tmpl_id.property_account_expense.id
18- if not a:
19- a = res.categ_id.property_account_expense_categ.id
20- a = fpos_obj.map_account(cr, uid, fpos, a)
21- if a:
22- result['account_id'] = a
23+ account = res.product_tmpl_id.property_account_expense.id
24+ if not account:
25+ account = res.categ_id.property_account_expense_categ.id
26+
27+ if context.get('account_id',False):
28+ account = context.get('account_id')
29+ account = fpos_obj.map_account(cr, uid, fpos, accounts)
30+ if account:
31+ result['account_id'] = account
32
33 if type in ('out_invoice', 'out_refund'):
34- taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
35+ taxes = res.taxes_id and res.taxes_id or (account and self.pool.get('account.account').browse(cr, uid, account, context=context).tax_ids or False)
36 else:
37- 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)
38+ taxes = res.supplier_taxes_id and res.supplier_taxes_id or (account and self.pool.get('account.account').browse(cr, uid, account, context=context).tax_ids or False)
39 tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
40
41 if type in ('in_invoice', 'in_refund'):
42@@ -1482,7 +1484,6 @@
43 result['uos_id'] = uom_id or res.uom_id.id
44 if res.description:
45 result['name'] += '\n'+res.description
46-
47 domain = {'uos_id':[('category_id','=',res.uom_id.category_id.id)]}
48
49 res_final = {'value':result, 'domain':domain}
50@@ -1595,8 +1596,9 @@
51 taxes = account.tax_ids
52 unique_tax_ids = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes)
53 else:
54+ context = {'account_id': account_id}
55 product_change_result = self.product_id_change(cr, uid, ids, product_id, False, type=inv_type,
56- partner_id=partner_id, fposition_id=fposition_id,
57+ partner_id=partner_id, fposition_id=fposition_id,context=context,
58 company_id=account.company_id.id)
59 if product_change_result and 'value' in product_change_result and 'invoice_line_tax_id' in product_change_result['value']:
60 unique_tax_ids = product_change_result['value']['invoice_line_tax_id']

Subscribers

People subscribed via source and target branches

to all changes: