|
@@ -5,7 +5,7 @@ from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DEFAULT_SERVER_DATE_FO
|
|
|
from datetime import datetime,timedelta
|
|
|
|
|
|
DATE_FORMAT = '%Y-%m-%d'
|
|
|
-
|
|
|
+# import web_pdb; web_pdb.set_trace()
|
|
|
class PurchaseOrder(models.Model):
|
|
|
_inherit = 'purchase.order'
|
|
|
_name = 'purchase.order'
|
|
@@ -41,11 +41,9 @@ class PurchaseOrder(models.Model):
|
|
|
Confirms order and creates and validates invoice, confirms pickings.
|
|
|
"""
|
|
|
for purchase in self:
|
|
|
- self.update_state()
|
|
|
inv_id = purchase.action_invoice_create()
|
|
|
if inv_id:
|
|
|
inv = self.env['account.invoice'].browse(inv_id)
|
|
|
- # import web_pdb; web_pdb.set_trace()
|
|
|
date = self._convert_str_to_datetime(purchase.date_order)
|
|
|
date = date.strftime(DATE_FORMAT)
|
|
|
inv.write({
|
|
@@ -61,12 +59,7 @@ class PurchaseOrder(models.Model):
|
|
|
picking.force_assign()
|
|
|
picking.action_done()
|
|
|
|
|
|
- @api.multi
|
|
|
- def update_state(self):
|
|
|
- for order in self:
|
|
|
- order.write({'state': 'approved'})
|
|
|
- return True
|
|
|
-
|
|
|
+ purchase.wkf_po_done()
|
|
|
|
|
|
class PurchaseOrderLine(models.Model):
|
|
|
_inherit = 'purchase.order.line'
|