[6.1/trunk] invoice upon picking: re-attached service lines have wrong fiscal position

Bug #922427 reported by Raphaël Valyi - http://www.akretion.com
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

Hello,

in trunk addons, if you create a sale order with both stockable products and service. Set invoicing method as "from picking".
Set some specific fiscal position.
Then validate and create the picking.
Then create an invoice from the picking.

The invoice line corresponding to the service line will have the fiscal position of the sale order partner (if any), not the one specifically set on the sale order (can be different).

This is because of the following code in sale/stock.py around line 188:
                    account_id = fiscal_position_obj.map_account(cursor, user, picking.sale_id.partner_id.property_account_position, account_id)

In fact, the fiscal position could have been set different on the sale order.

On the contrary, the creation of an invoice line from a sale order gets it right, with the following code in sale/sale.py:
fpos = line.order_id.fiscal_position or False

I'm about to propose a merge proposal factoring those two invoice line creation method in a single method with no such bug, so stay tuned.

Related branches

Revision history for this message
Ravish(OpenERP) (rmu-openerp) wrote :

Hello Raphael ,

I have checked your issue . It's working properly for me.
For your more reference ,I have attached video .Please go throw it.

If you still got the problem . Undoubtedly inform us.

Thanks!

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote : Re: [Bug 922427] Re: [6.1/trunk] invoice upon picking: re-attached service lines have wrong fiscal position

Hello well if you tried like with code newer than 4 days ago, it's normal
because my patch (see related branch has been merged). Can you confirm you
tried with recent code, so we can close the bug?

On Fri, Feb 3, 2012 at 8:40 AM, Ravish(OpenERP)
<email address hidden>wrote:

> Hello Raphael ,
>
> I have checked your issue . It's working properly for me.
> For your more reference ,I have attached video .Please go throw it.
>
> If you still got the problem . Undoubtedly inform us.
>
> Thanks!
>
>
> ** Attachment added: "Watch this video for more info"
>
> https://bugs.launchpad.net/openobject-addons/+bug/922427/+attachment/2709750/+files/Fiscal_position.ogv
>
> ** Changed in: openobject-addons
> Status: New => Incomplete
>
> --
> You received this bug notification because you are a member of OpenERP
> Drivers, which is subscribed to OpenERP Addons.
> https://bugs.launchpad.net/bugs/922427
>
> Title:
> [6.1/trunk] invoice upon picking: re-attached service lines have wrong
> fiscal position
>
> Status in OpenERP Addons (modules):
> Incomplete
>
> Bug description:
> Hello,
>
> in trunk addons, if you create a sale order with both stockable products
> and service. Set invoicing method as "from picking".
> Set some specific fiscal position.
> Then validate and create the picking.
> Then create an invoice from the picking.
>
> The invoice line corresponding to the service line will have the
> fiscal position of the sale order partner (if any), not the one
> specifically set on the sale order (can be different).
>
> This is because of the following code in sale/stock.py around line 188:
> account_id = fiscal_position_obj.map_account(cursor,
> user, picking.sale_id.partner_id.property_account_position, account_id)
>
>
> In fact, the fiscal position could have been set different on the sale
> order.
>
> On the contrary, the creation of an invoice line from a sale order gets
> it right, with the following code in sale/sale.py:
> fpos = line.order_id.fiscal_position or False
>
> I'm about to propose a merge proposal factoring those two invoice line
> creation method in a single method with no such bug, so stay tuned.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-addons/+bug/922427/+subscriptions
>

Revision history for this message
Ravish(OpenERP) (rmu-openerp) wrote :

Hello Raphael ,

I have checked with updated code . As per your comment #2, I am closing this issue.

Changed in openobject-addons:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.