Merge lp:~openerp-dev/openobject-addons/trunk-opw-573823-port-mma into lp:openobject-addons

Proposed by Mayur Maheshwari(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-opw-573823-port-mma
Merge into: lp:openobject-addons
Diff against target: 35 lines (+6/-4)
1 file modified
point_of_sale/point_of_sale.py (+6/-4)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-opw-573823-port-mma
Reviewer Review Type Date Requested Status
Mayur Maheshwari(OpenERP) (community) Needs Resubmitting
Fabien (Open ERP) Pending
Purnendu Singh (OpenERP) Pending
Review via email: mp+140364@code.launchpad.net

This proposal supersedes a proposal from 2012-10-31.

Description of the change

Hello,

In Point of Sale, for PoS Order when we don't fill field 'Salesman' and try to set the company based on salesman's company then there will be a traceback so improve the code for it.

also solved problem for tax account, we any product has default tax configured and tax is not configured with tax account then in that case product's account should be used.

Code is forward port from 6.1

Thanks,
Mayur

To post a comment you must log in.
Revision history for this message
Purnendu Singh (OpenERP) (purnendu-singh) wrote : Posted in a previous version of this proposal

right now the Post entries button not there as it was in 6.1!! SO, it is not reproducing but if system tries to set the company based on salesman and as the salesman field is not required it may be possible to get tracback!!

patch proposed is a genuine technically looking at the code.

Thanks,
purnendu Singh

review: Approve
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote : Posted in a previous version of this proposal

user_company = order.user_id and user_proxy.browse(cr, order.user_id.id, order.user_id.id).company_id or False

should be:

user_company = order.user_id and order.user_id.company_id or False

review: Disapprove
Revision history for this message
Mayur Maheshwari(OpenERP) (mma-openerp) wrote : Posted in a previous version of this proposal

Hello,

    I Have improve a code of as par specification

review: Needs Resubmitting
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote : Posted in a previous version of this proposal

several issues:
   user_proxy.browse(cr, order.user_id.id, order.user_id.id).company_id
should be:
   order.user_id.company_id

review: Disapprove
Revision history for this message
Mayur Maheshwari(OpenERP) (mma-openerp) wrote :

Hello,

     Sorry for the inconveniences of Resubmit
     Code improve as per specification
     Resubmit again now diff changes more clean as before

Thanks

review: Needs Resubmitting

Unmerged revisions

7900. By Mayur Maheshwari(OpenERP)

[IMP]point_of_sale: improve a code of as par specification

7899. By Mayur Maheshwari(OpenERP)

[FIX]point_of_sale : fix problem for default product account in case tax does not have tax account

7898. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

7897. By Olivier Dony (Odoo)

[FIX] account: currency_id must be passed to the chart installation wizard

Otherwise the installation of a chart of account
via the settings page fails miserably.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'point_of_sale/point_of_sale.py'
2--- point_of_sale/point_of_sale.py 2012-11-29 22:26:45 +0000
3+++ point_of_sale/point_of_sale.py 2012-12-18 07:13:29 +0000
4@@ -913,14 +913,12 @@
5 tax_amount = line.price_subtotal * tax['ref_base_sign']
6
7 return (tax_code_id, tax_amount,)
8-
9 for order in self.browse(cr, uid, ids, context=context):
10 if order.account_move:
11 continue
12 if order.state != 'paid':
13 continue
14-
15- user_company = user_proxy.browse(cr, order.user_id.id, order.user_id.id).company_id
16+ user_company = order.user_id and order.user_id.company_id or False
17
18 group_tax = {}
19 account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context).id
20@@ -986,10 +984,14 @@
21 tax_amount = 0
22 taxes = [t for t in line.product_id.taxes_id]
23 computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit * (100.0-line.discount) / 100.0, line.qty)['taxes']
24+ product_income_acc = line.product_id.product_tmpl_id.property_account_income and \
25+ line.product_id.product_tmpl_id.property_account_income.id or \
26+ line.product_id.categ_id.property_account_income_categ and \
27+ line.product_id.categ_id.property_account_income_categ.id
28
29 for tax in computed_taxes:
30 tax_amount += round(tax['amount'], 2)
31- group_key = (tax['tax_code_id'], tax['base_code_id'], tax['account_collected_id'], tax['id'])
32+ group_key = (tax['tax_code_id'], tax['base_code_id'], tax['account_collected_id'] or product_income_acc, tax['id'])
33
34 group_tax.setdefault(group_key, 0)
35 group_tax[group_key] += round(tax['amount'], 2)

Subscribers

People subscribed via source and target branches

to all changes: