Skip to content

Commit 5f08deb

Browse files
committedJul 7, 2014
[MERGE] Fwd-port 8.0 up to 139d868
2 parents 7f9d1f4 + 139d868 commit 5f08deb

File tree

23 files changed

+167
-362
lines changed

23 files changed

+167
-362
lines changed
 

‎addons/account/account_invoice.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def _get_journal_analytic(self, inv_type):
9898
def _compute_reconciled(self):
9999
self.reconciled = self.test_paid()
100100
if not self.reconciled and self.state == 'paid':
101-
self.signal_open_test()
101+
self.signal_workflow('open_test')
102102

103103
@api.model
104104
def _get_reference_type(self):

‎addons/account/partner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def get_fiscal_position(self, cr, uid, company_id, partner_id, delivery_id=None,
104104

105105
# partner manually set fiscal position always win
106106
if partner.property_account_position:
107-
return part.property_account_position.id
107+
return partner.property_account_position.id
108108

109109
# if no delivery use invocing
110110
if delivery_id:
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.oe_systray #oe_attendance_sign_in_out_icon {
2-
font-color: white;
2+
color: white;
33
}

‎addons/im_chat/static/src/css/im_chat.css

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
/* button */
1515
.oe_systray #oe_topbar_imbutton_icon {
1616
color: white;
17-
margin-right: 10px;
1817
}
1918
.oe_topbar_item.oe_topbar_imbutton .oe_e {
2019
position: relative;

‎addons/mrp/mrp.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ def action_produce(self, cr, uid, production_id, production_qty, production_mode
884884
production = self.browse(cr, uid, production_id, context=context)
885885
if not production.move_lines and production.state == 'ready':
886886
# trigger workflow if not products to consume (eg: services)
887-
self.signal_button_produce(cr, uid, [production_id])
887+
self.signal_workflow(cr, uid, [production_id], 'button_produce')
888888

889889
produced_qty = self._get_produced_qty(cr, uid, production, context=context)
890890

@@ -944,7 +944,7 @@ def action_produce(self, cr, uid, production_id, production_qty, production_mode
944944
stock_mov_obj.action_done(cr, uid, [extra_move_id], context=context)
945945

946946
self.message_post(cr, uid, production_id, body=_("%s produced") % self._description, context=context)
947-
self.signal_button_produce_done(cr, uid, [production_id])
947+
self.signal_workflow(cr, uid, [production_id], 'button_produce_done')
948948
return True
949949

950950
def _costs_generate(self, cr, uid, production):

‎addons/mrp/procurement.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def make_mo(self, cr, uid, ids, context=None):
114114
procurement.refresh()
115115
self.production_order_create_note(cr, uid, procurement, context=context)
116116
production_obj.action_compute(cr, uid, [produce_id], properties=[x.id for x in procurement.property_ids])
117-
production_obj.signal_button_confirm(cr, uid, [produce_id])
117+
production_obj.signal_workflow(cr, uid, [produce_id], 'button_confirm')
118118
else:
119119
res[procurement.id] = False
120120
self.message_post(cr, uid, [procurement.id], body=_("No BoM exists for this product!"), context=context)

‎addons/mrp/stock.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def action_consume(self, cr, uid, ids, product_qty, location_id=False, restrict_
159159
'consumed_for': consumed_for}, context=context)
160160
self.action_done(cr, uid, res, context=context)
161161
production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])])
162-
production_obj.signal_button_produce(cr, uid, production_ids)
162+
production_obj.signal_workflow(cr, uid, production_ids, 'button_produce')
163163
for new_move in res:
164164
if new_move != move.id:
165165
#This move is not already there in move lines of production order
@@ -181,7 +181,7 @@ def action_scrap(self, cr, uid, ids, product_qty, location_id, restrict_lot_id=F
181181
#If we are not scrapping our whole move, tracking and lot references must not be removed
182182
production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])])
183183
for prod_id in production_ids:
184-
production_obj.signal_button_produce(cr, uid, [prod_id])
184+
production_obj.signal_workflow(cr, uid, [prod_id], 'button_produce')
185185
for new_move in new_moves:
186186
production_obj.write(cr, uid, production_ids, {'move_lines': [(4, new_move)]})
187187
res.append(new_move)

‎addons/point_of_sale/point_of_sale.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def _confirm_orders(self, cr, uid, ids, context=None):
497497
_('Error!'),
498498
_("You cannot confirm all orders of this session, because they have not the 'paid' status"))
499499
else:
500-
pos_order_obj.signal_done(cr, uid, [order.id])
500+
pos_order_obj.signal_workflow(cr, uid, [order.id], 'done')
501501

502502
return True
503503

@@ -581,14 +581,14 @@ def create_from_ui(self, cr, uid, orders, context=None):
581581
order_ids.append(order_id)
582582

583583
try:
584-
self.signal_paid(cr, uid, [order_id])
584+
self.signal_workflow(cr, uid, [order_id], 'paid')
585585
except Exception as e:
586586
_logger.error('Could not fully process the POS Order: %s', tools.ustr(e))
587587

588588
if to_invoice:
589589
self.action_invoice(cr, uid, [order_id], context)
590590
order_obj = self.browse(cr, uid, order_id, context)
591-
self.pool['account.invoice'].signal_invoice_open(cr, uid, [order_obj.invoice_id.id])
591+
self.pool['account.invoice'].signal_workflow(cr, uid, [order_obj.invoice_id.id], 'invoice_open')
592592

593593
return order_ids
594594

@@ -933,8 +933,8 @@ def action_invoice(self, cr, uid, ids, context=None):
933933
inv_line['invoice_line_tax_id'] = [(6, 0, [x.id for x in line.product_id.taxes_id] )]
934934
inv_line_ref.create(cr, uid, inv_line, context=context)
935935
inv_ref.button_reset_taxes(cr, uid, [inv_id], context=context)
936-
self.signal_invoice(cr, uid, [order.id])
937-
inv_ref.signal_validate(cr, uid, [inv_id])
936+
self.signal_workflow(cr, uid, [order.id], 'invoice')
937+
inv_ref.signal_workflow(cr, uid, [inv_id], 'validate')
938938

939939
if not inv_ids: return {}
940940

‎addons/purchase/purchase.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def unlink(self, cr, uid, ids, context=None):
328328
raise osv.except_osv(_('Invalid Action!'), _('In order to delete a purchase order, you must cancel it first.'))
329329

330330
# automatically sending subflow.delete upon deletion
331-
self.signal_purchase_cancel(cr, uid, unlink_ids)
331+
self.signal_workflow(cr, uid, unlink_ids, 'purchase_cancel')
332332

333333
return super(purchase_order, self).unlink(cr, uid, unlink_ids, context=context)
334334

@@ -519,7 +519,7 @@ def print_quotation(self, cr, uid, ids, context=None):
519519
This function prints the request for quotation and mark it as sent, so that we can see more easily the next step of the workflow
520520
'''
521521
assert len(ids) == 1, 'This option should only be used for a single id at a time'
522-
self.signal_send_rfq(cr, uid, ids)
522+
self.signal_workflow(cr, uid, ids, 'send_rfq')
523523
return self.pool['report'].get_action(cr, uid, ids, 'purchase.report_purchasequotation', context=context)
524524

525525
def wkf_confirm_order(self, cr, uid, ids, context=None):
@@ -680,19 +680,19 @@ def action_cancel(self, cr, uid, ids, context=None):
680680
_('Unable to cancel the purchase order %s.') % (purchase.name),
681681
_('First cancel all receptions related to this purchase order.'))
682682
self.pool.get('stock.picking') \
683-
.signal_button_cancel(cr, uid, map(attrgetter('id'), purchase.picking_ids))
683+
.signal_workflow(cr, uid, map(attrgetter('id'), purchase.picking_ids), 'button_cancel')
684684
for inv in purchase.invoice_ids:
685685
if inv and inv.state not in ('cancel', 'draft'):
686686
raise osv.except_osv(
687687
_('Unable to cancel this purchase order.'),
688688
_('You must first cancel all invoices related to this purchase order.'))
689689
self.pool.get('account.invoice') \
690-
.signal_invoice_cancel(cr, uid, map(attrgetter('id'), purchase.invoice_ids))
690+
.signal_workflow(cr, uid, map(attrgetter('id'), purchase.invoice_ids), 'invoice_cancel')
691691
self.pool['purchase.order.line'].write(cr, uid, [l.id for l in purchase.order_line],
692692
{'state': 'cancel'})
693693
self.write(cr, uid, ids, {'state': 'cancel'})
694694
self.set_order_line_status(cr, uid, ids, 'cancel', context=context)
695-
self.signal_purchase_cancel(cr, uid, ids)
695+
self.signal_workflow(cr, uid, ids, 'purchase_cancel')
696696
return True
697697

698698
def _prepare_order_line_move(self, cr, uid, order, order_line, picking_id, group_id, context=None):
@@ -933,7 +933,7 @@ def make_key(br, fields):
933933
# make triggers pointing to the old orders point to the new order
934934
for old_id in old_ids:
935935
self.redirect_workflow(cr, uid, [(old_id, neworder_id)])
936-
self.signal_purchase_cancel(cr, uid, [old_id])
936+
self.signal_workflow(cr, uid, [old_id], 'purchase_cancel')
937937

938938
return orders_info
939939

@@ -1370,7 +1370,7 @@ def _postprocess_sent_message(self, cr, uid, mail, context=None, mail_sent=True)
13701370
if mail_sent and mail.model == 'purchase.order':
13711371
obj = self.pool.get('purchase.order').browse(cr, uid, mail.res_id, context=context)
13721372
if obj.state == 'draft':
1373-
self.pool.get('purchase.order').signal_send_rfq(cr, uid, [mail.res_id])
1373+
self.pool.get('purchase.order').signal_workflow(cr, uid, [mail.res_id], 'send_rfq')
13741374
return super(mail_mail, self)._postprocess_sent_message(cr, uid, mail=mail, context=context, mail_sent=mail_sent)
13751375

13761376

@@ -1423,7 +1423,7 @@ def send_mail(self, cr, uid, ids, context=None):
14231423
context = context or {}
14241424
if context.get('default_model') == 'purchase.order' and context.get('default_res_id'):
14251425
context = dict(context, mail_post_autofollow=True)
1426-
self.pool.get('purchase.order').signal_send_rfq(cr, uid, [context['default_res_id']])
1426+
self.pool.get('purchase.order').signal_workflow(cr, uid, [context['default_res_id']], 'send_rfq')
14271427
return super(mail_compose_message, self).send_mail(cr, uid, ids, context=context)
14281428

14291429

‎addons/purchase_requisition/purchase_requisition.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def generate_po(self, cr, uid, ids, context=None):
245245
for quotation in tender.purchase_ids:
246246
if (self.check_valid_quotation(cr, uid, quotation, context=context)):
247247
#use workflow to set PO state to confirm
248-
po.signal_purchase_confirm(cr, uid, [quotation.id])
248+
po.signal_workflow(cr, uid, [quotation.id], 'purchase_confirm')
249249

250250
#get other confirmed lines per supplier
251251
for po_line in tender.po_line_ids:
@@ -268,21 +268,21 @@ def generate_po(self, cr, uid, ids, context=None):
268268
vals = self._prepare_po_line_from_tender(cr, uid, tender, line, new_po, context=context)
269269
poline.copy(cr, uid, line.id, default=vals, context=context)
270270
#use workflow to set new PO state to confirm
271-
po.signal_purchase_confirm(cr, uid, [new_po])
271+
po.signal_workflow(cr, uid, [new_po], 'purchase_confirm')
272272

273273
#cancel other orders
274274
self.cancel_unconfirmed_quotations(cr, uid, tender, context=context)
275275

276276
#set tender to state done
277-
self.signal_done(cr, uid, [tender.id])
277+
self.signal_workflow(cr, uid, [tender.id], 'done')
278278
return True
279279

280280
def cancel_unconfirmed_quotations(self, cr, uid, tender, context=None):
281281
#cancel other orders
282282
po = self.pool.get('purchase.order')
283283
for quotation in tender.purchase_ids:
284284
if quotation.state in ['draft', 'sent', 'bid']:
285-
self.pool.get('purchase.order').signal_purchase_cancel(cr, uid, [quotation.id])
285+
self.pool.get('purchase.order').signal_workflow(cr, uid, [quotation.id], 'purchase_cancel')
286286
po.message_post(cr, uid, [quotation.id], body=_('Cancelled by the call for bids associated to this request for quotation.'), context=context)
287287
return True
288288

0 commit comments

Comments
 (0)
Please sign in to comment.