diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2015-08-27 11:02:50 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2015-08-27 18:10:18 +0200 |
| commit | 0320523a8ebf1b05b2ae6099c5aa116f0e9d9611 (patch) | |
| tree | bc21ebff996f92e0c6f72714a2c25c679fa7207a | |
| parent | 758cca3899780fa08c30ce42c5a71ac1ae4ae983 (diff) | |
[DEL] stock_invoice_directly: deprecated module
Reason: complete rewrite of the Sale module. Invoicing is now managed
completely from the Sale module.
| -rw-r--r-- | addons/stock_invoice_directly/__init__.py | 5 | ||||
| -rw-r--r-- | addons/stock_invoice_directly/__openerp__.py | 23 | ||||
| -rw-r--r-- | addons/stock_invoice_directly/stock_invoice_directly.py | 33 | ||||
| -rw-r--r-- | addons/stock_invoice_directly/test/stock_invoice_directly.yml | 57 | ||||
| -rw-r--r-- | addons/stock_invoice_directly/wizards.py | 58 |
5 files changed, 0 insertions, 176 deletions
diff --git a/addons/stock_invoice_directly/__init__.py b/addons/stock_invoice_directly/__init__.py deleted file mode 100644 index 815313c1bc5..00000000000 --- a/addons/stock_invoice_directly/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -import stock_invoice_directly -import wizards
\ No newline at end of file diff --git a/addons/stock_invoice_directly/__openerp__.py b/addons/stock_invoice_directly/__openerp__.py deleted file mode 100644 index 8137e53bf20..00000000000 --- a/addons/stock_invoice_directly/__openerp__.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - - -{ - 'name': 'Invoice Picking Directly', - 'version': '1.0', - 'category' : 'Warehouse Management', - 'description': """ -Invoice Wizard for Delivery. -============================ - -When you send or deliver goods, this module automatically launch the invoicing -wizard if the delivery is to be invoiced. - """, - 'website': 'https://www.odoo.com/page/warehouse', - 'depends': ['delivery', 'stock'], - 'data': [], - 'demo': [], - 'test': ['../account/test/account_minimal_test.xml', 'test/stock_invoice_directly.yml'], - 'installable': True, - 'auto_install': False, -} diff --git a/addons/stock_invoice_directly/stock_invoice_directly.py b/addons/stock_invoice_directly/stock_invoice_directly.py deleted file mode 100644 index a07cba9e1af..00000000000 --- a/addons/stock_invoice_directly/stock_invoice_directly.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from openerp import api -from openerp.osv import osv -from openerp.tools.translate import _ - - -class stock_picking(osv.osv): - _inherit = 'stock.picking' - - def do_new_transfer(self, cr, uid, ids, context=None): - """Launch Create invoice wizard if invoice state is To be Invoiced, - after processing the picking. - """ - if context is None: - context = {} - res = super(stock_picking, self).do_new_transfer(cr, uid, ids, context=context) - if res: #If it is already returning a wizard - return res - pick_ids = [p.id for p in self.browse(cr, uid, ids, context) if p.invoice_state == '2binvoiced'] - if pick_ids: - context = dict(context, active_model='stock.picking', active_ids=pick_ids) - return { - 'name': _('Create Invoice'), - 'view_type': 'form', - 'view_mode': 'form', - 'res_model': 'stock.invoice.onshipping', - 'type': 'ir.actions.act_window', - 'target': 'new', - 'context': context - } - return res
\ No newline at end of file diff --git a/addons/stock_invoice_directly/test/stock_invoice_directly.yml b/addons/stock_invoice_directly/test/stock_invoice_directly.yml deleted file mode 100644 index 2431a7be255..00000000000 --- a/addons/stock_invoice_directly/test/stock_invoice_directly.yml +++ /dev/null @@ -1,57 +0,0 @@ -- - In order to test the stock_invoice_directly module. I will create an outgoing - picking order which creates an invoice from the picking order itself. -- - I create an Outgoing Picking order. -- - !record {model: stock.picking, id: stock_picking_out0}: - partner_id: base.res_partner_address_22 - move_lines: - - company_id: base.main_company - location_id: stock.stock_location_stock - product_id: product.product_product_3 - product_uom_qty: 3.0 - product_uom: product.product_uom_unit - location_dest_id: stock.stock_location_customers - invoice_state: 2binvoiced - move_type: direct - picking_type_id: stock.picking_type_out -- - I need to check the availability of the product so I make my picking order for processing later. -- - !python {model: stock.picking}: | - self.action_confirm(cr, uid, [ref("stock_picking_out0")], {"lang": "en_US", "search_default_available": - 1, "tz": False, "active_model": "ir.ui.menu", "contact_display": "partner", - }) -- - I check the product availability. Product is available in the stock and ready to be sent. -- - !python {model: stock.picking}: | - self.action_assign(cr, uid, [ref("stock_picking_out0")], {"lang": "en_US", "search_default_available": - 1, "tz": False, "active_model": "ir.ui.menu", "contact_display": "partner", - }) -- - I process the delivery -- - !python {model: stock.picking}: | - partial_id = ref("stock_picking_out0") - self.do_transfer(cr, uid, [partial_id]) - -- - As the Invoice state of the picking order is To be invoiced. I create invoice for my outgoing picking order. -- - !python {model: stock.invoice.onshipping}: | - wiz_id = self.create(cr, uid, {'invoice_date': '2010-08-04', 'journal_id': ref('sales_journal')}, - {'active_ids': [ref("stock_picking_out0")], "active_model": "stock.picking"}) - self.create_invoice(cr, uid, [wiz_id], {"lang": "en_US", - "search_default_available": 1, "tz": False, "active_model": "stock.picking", - "contact_display": "partner", "active_ids": [ref("stock_picking_out0")], "active_id": ref("stock_picking_out0")}) -- - I check that the customer invoice is created successfully. -- - !python {model: account.invoice}: | - picking_obj = self.pool.get('stock.picking') - picking = picking_obj.browse(cr, uid, [ref('stock_picking_out0')], context=context) - partner = picking[0].partner_id.id - inv_ids = self.search(cr, uid, [('type','=','out_invoice'),('partner_id','=',partner)], context=context) - assert inv_ids, 'No Invoice is generated!' diff --git a/addons/stock_invoice_directly/wizards.py b/addons/stock_invoice_directly/wizards.py deleted file mode 100644 index 680c92eb8e2..00000000000 --- a/addons/stock_invoice_directly/wizards.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from openerp import models, fields, api -from openerp.tools.translate import _ - -class stock_immediate_transfer(models.TransientModel): - _inherit = 'stock.immediate.transfer' - - @api.multi - def process(self): - super(stock_immediate_transfer, self).process() - pick = self.pick_id.id - if self.pick_id.invoice_state == "2binvoiced": - context = dict(self.env.context, active_model='stock.picking', active_id=pick, active_ids=[pick]) - return { - 'name': _('Create Invoice'), - 'view_type': 'form', - 'view_mode': 'form', - 'res_model': 'stock.invoice.onshipping', - 'type': 'ir.actions.act_window', - 'target': 'new', - 'context': context - } - - -class stock_backorder_confirmation(models.TransientModel): - _inherit = 'stock.backorder.confirmation' - - @api.multi - def process(self): - super(stock_backorder_confirmation, self).process() - if self.pick_id.invoice_state == "2binvoiced": - context = dict(self.env.context, active_model='stock.picking', active_id=self.pick_id.id, active_ids=[self.pick_id.id]) - return { - 'name': _('Create Invoice'), - 'view_type': 'form', - 'view_mode': 'form', - 'res_model': 'stock.invoice.onshipping', - 'type': 'ir.actions.act_window', - 'target': 'new', - 'context': context - } - - @api.multi - def process_cancel_backorder(self): - super(stock_backorder_confirmation, self).process_cancel_backorder() - if self.pick_id.invoice_state == "2binvoiced": - context = dict(self.env.context, active_model='stock.picking', active_id=self.pick_id.id, active_ids=[self.pick_id.id]) - return { - 'name': _('Create Invoice'), - 'view_type': 'form', - 'view_mode': 'form', - 'res_model': 'stock.invoice.onshipping', - 'type': 'ir.actions.act_window', - 'target': 'new', - 'context': context - }
\ No newline at end of file |
