[Trunk/7.0] Service article not invoiced by invoice on delivery
Bug #1167330 reported by
Christian Werner
This bug affects 9 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Medium
|
OpenERP R&D Addons Team 2 |
Bug Description
Service Products are not invoiced:
SO with:
Create Invoice: On Delivery Order
SOL:
Product A with Type: Stockable Product
Product B with Type: Service
If I confirm order and delivery and create Invoice, only Product A is in the invoice.
In Version 6.1 both products are invoiced.
I've tested it also with demo data. Same issue.
Related branches
lp:~openerp-dev/openobject-addons/7.0-invoice-ondelivery-with-service-product-tpa
- Joël Grand-Guillaume @ camptocamp (community): Approve (code review, tests)
- OpenERP Core Team: Pending requested
-
Diff: 57 lines (+24/-2)2 files modifiedsale_stock/stock.py (+13/-1)
sale_stock/test/picking_order_policy.yml (+11/-1)
summary: |
- Service article not invoiced by invoice on delivery + [Trunk/7.0] Service article not invoiced by invoice on delivery |
Changed in openobject-addons: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
assignee: | nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2) |
tags: | added: warehouse |
To post a comment you must log in.
I have solved this problem by using function invoice_hook:
def _invoice_hook(self, cr, uid, picking, invoice_id): get('account. invoice' ).browse( cr, uid, [invoice_id], context=context):
invoice_ vals = { 'type': inv.type,
'fiscal_ position' : inv.fiscal_position
}
context = {}
for inv in self.pool.
for line in picking. sale_id. order_line: vals['type' ] in ('out_invoice', 'out_refund'):
account_ id = line.product_ id.property_ account_ income. id
if not account_id:
account_ id = line.product_ id.categ_ id.property_ account_ income_ categ.id
else:
account_ id = line.product_ id.property_ account_ expense. id
if not account_id:
account_ id = line.product_ id.categ_ id.property_ account_ expense_ categ.id
if not line.invoiced and not line.move_ids and line.state == 'done':
if invoice_
if invoice_ vals['fiscal_ position' ]:
fp_obj = self.pool. get('account. fiscal. position' )
fiscal_ position = fp_obj.browse(cr, uid, invoice_ vals['fiscal_ position' ], context=context)
account_ id = fp_obj. map_account( cr, uid, fiscal_position, account_id)
else:
continue
return super(stock_ picking, self)._ invoice_ hook(cr, uid, picking, invoice_id)
So all products without move_ids in SOL will be invoiced by creating the invoice first delivery.