diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py
index 11e474bf16f..7bb6f3e5761 100644
--- a/addons/account/account_bank_statement.py
+++ b/addons/account/account_bank_statement.py
@@ -308,7 +308,7 @@ class account_bank_statement(osv.osv):
def balance_check(self, cr, uid, st_id, journal_type='bank', context=None):
st = self.browse(cr, uid, st_id, context=context)
- if not (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001):
+ if not ((abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001) or (abs((st.balance_end or 0.0) - st.balance_end_cash) < 0.0001)):
raise osv.except_osv(_('Error !'),
_('The statement balance is incorrect !\nThe expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end))
return True
@@ -358,7 +358,10 @@ class account_bank_statement(osv.osv):
st_line_number = self.get_next_st_line_number(cr, uid, st_number, st_line, context)
self.create_move_from_st_line(cr, uid, st_line.id, company_currency_id, st_line_number, context)
- self.write(cr, uid, [st.id], {'name': st_number}, context=context)
+ self.write(cr, uid, [st.id], {
+ 'name': st_number,
+ 'balance_end_real': st.balance_end
+ }, context=context)
self.log(cr, uid, st.id, _('Statement %s is confirmed, journal items are created.') % (st_number,))
return self.write(cr, uid, ids, {'state':'confirm'}, context=context)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 9ae59f62456..25faae589d5 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -477,7 +477,7 @@
-
+
diff --git a/addons/account/project/report/analytic_balance.rml b/addons/account/project/report/analytic_balance.rml
index 77182b5bb9f..0c488eac400 100644
--- a/addons/account/project/report/analytic_balance.rml
+++ b/addons/account/project/report/analytic_balance.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/project/report/analytic_journal.rml b/addons/account/project/report/analytic_journal.rml
index 47775ea9253..719851252b5 100644
--- a/addons/account/project/report/analytic_journal.rml
+++ b/addons/account/project/report/analytic_journal.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/project/report/cost_ledger.rml b/addons/account/project/report/cost_ledger.rml
index 90ff16be217..d53467b4e93 100644
--- a/addons/account/project/report/cost_ledger.rml
+++ b/addons/account/project/report/cost_ledger.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/project/report/inverted_analytic_balance.rml b/addons/account/project/report/inverted_analytic_balance.rml
index 25a79aa63f9..f112ec8fbd3 100644
--- a/addons/account/project/report/inverted_analytic_balance.rml
+++ b/addons/account/project/report/inverted_analytic_balance.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/project/report/quantity_cost_ledger.rml b/addons/account/project/report/quantity_cost_ledger.rml
index 8d83b9512ab..9f99f50ccc2 100644
--- a/addons/account/project/report/quantity_cost_ledger.rml
+++ b/addons/account/project/report/quantity_cost_ledger.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/report/account_balance.rml b/addons/account/report/account_balance.rml
index 0c4e633ec15..88980a9cd97 100644
--- a/addons/account/report/account_balance.rml
+++ b/addons/account/report/account_balance.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/report/account_central_journal.rml b/addons/account/report/account_central_journal.rml
index 8150871a6ef..6d350b5fe8f 100644
--- a/addons/account/report/account_central_journal.rml
+++ b/addons/account/report/account_central_journal.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/report/account_financial_report.rml b/addons/account/report/account_financial_report.rml
index e3b5f3663f9..4982c9b3bed 100644
--- a/addons/account/report/account_financial_report.rml
+++ b/addons/account/report/account_financial_report.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/report/account_general_journal.rml b/addons/account/report/account_general_journal.rml
index 61140331612..4ad086d6bd4 100644
--- a/addons/account/report/account_general_journal.rml
+++ b/addons/account/report/account_general_journal.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/report/account_general_ledger.rml b/addons/account/report/account_general_ledger.rml
index 7a6e2d485ca..0ba4e4b6a3c 100644
--- a/addons/account/report/account_general_ledger.rml
+++ b/addons/account/report/account_general_ledger.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/report/account_journal.rml b/addons/account/report/account_journal.rml
index 2ebdc29047d..122b195c1ef 100644
--- a/addons/account/report/account_journal.rml
+++ b/addons/account/report/account_journal.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/report/account_partner_balance.rml b/addons/account/report/account_partner_balance.rml
index cb3bbeb0921..a99a7f062ec 100644
--- a/addons/account/report/account_partner_balance.rml
+++ b/addons/account/report/account_partner_balance.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/report/account_partner_ledger.rml b/addons/account/report/account_partner_ledger.rml
index b81f6436a12..8fcb41d5ca6 100644
--- a/addons/account/report/account_partner_ledger.rml
+++ b/addons/account/report/account_partner_ledger.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/report/account_partner_ledger_other.rml b/addons/account/report/account_partner_ledger_other.rml
index ff68c083087..c61b8147a69 100644
--- a/addons/account/report/account_partner_ledger_other.rml
+++ b/addons/account/report/account_partner_ledger_other.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/report/account_print_invoice.rml b/addons/account/report/account_print_invoice.rml
index ff2a8e525be..36228942a31 100644
--- a/addons/account/report/account_print_invoice.rml
+++ b/addons/account/report/account_print_invoice.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/report/account_print_overdue.rml b/addons/account/report/account_print_overdue.rml
index 3cc993fb977..2c2b6f5954d 100644
--- a/addons/account/report/account_print_overdue.rml
+++ b/addons/account/report/account_print_overdue.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account/report/account_tax_report.rml b/addons/account/report/account_tax_report.rml
index f489ee1143e..c25f1fccd22 100644
--- a/addons/account/report/account_tax_report.rml
+++ b/addons/account/report/account_tax_report.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account_analytic_plans/report/crossovered_analytic.rml b/addons/account_analytic_plans/report/crossovered_analytic.rml
index f374aa5a2c2..766fb9f0d0d 100644
--- a/addons/account_analytic_plans/report/crossovered_analytic.rml
+++ b/addons/account_analytic_plans/report/crossovered_analytic.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account_budget/report/analytic_account_budget_report.rml b/addons/account_budget/report/analytic_account_budget_report.rml
index ba89c7ed1ea..837825aa4e3 100644
--- a/addons/account_budget/report/analytic_account_budget_report.rml
+++ b/addons/account_budget/report/analytic_account_budget_report.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account_budget/report/budget_report.rml b/addons/account_budget/report/budget_report.rml
index 4d82e8d8c1d..8b9835b6615 100644
--- a/addons/account_budget/report/budget_report.rml
+++ b/addons/account_budget/report/budget_report.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account_budget/report/crossovered_budget_report.rml b/addons/account_budget/report/crossovered_budget_report.rml
index b4e8e963b7d..50b7d267125 100644
--- a/addons/account_budget/report/crossovered_budget_report.rml
+++ b/addons/account_budget/report/crossovered_budget_report.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account_followup/report/account_followup_print.rml b/addons/account_followup/report/account_followup_print.rml
index 92eda92e9ee..ae581528a1e 100644
--- a/addons/account_followup/report/account_followup_print.rml
+++ b/addons/account_followup/report/account_followup_print.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account_invoice_layout/report/report_account_invoice_layout.rml b/addons/account_invoice_layout/report/report_account_invoice_layout.rml
index 6a8a286b66c..2cff52d4146 100644
--- a/addons/account_invoice_layout/report/report_account_invoice_layout.rml
+++ b/addons/account_invoice_layout/report/report_account_invoice_layout.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account_invoice_layout/report/special_message_invoice.rml b/addons/account_invoice_layout/report/special_message_invoice.rml
index bfef662db85..f474a44d161 100644
--- a/addons/account_invoice_layout/report/special_message_invoice.rml
+++ b/addons/account_invoice_layout/report/special_message_invoice.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account_payment/report/order.rml b/addons/account_payment/report/order.rml
index 9db71e5f3b0..973588e5410 100644
--- a/addons/account_payment/report/order.rml
+++ b/addons/account_payment/report/order.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account_voucher/report/account_voucher.rml b/addons/account_voucher/report/account_voucher.rml
index 61297eb9d7b..3892d281f5b 100644
--- a/addons/account_voucher/report/account_voucher.rml
+++ b/addons/account_voucher/report/account_voucher.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/account_voucher/report/account_voucher_print.rml b/addons/account_voucher/report/account_voucher_print.rml
index c4492ec6ed0..99935520b81 100644
--- a/addons/account_voucher/report/account_voucher_print.rml
+++ b/addons/account_voucher/report/account_voucher_print.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/auction_artists.rml b/addons/auction/report/auction_artists.rml
index 1a0688825d4..7dd4f2156a5 100644
--- a/addons/auction/report/auction_artists.rml
+++ b/addons/auction/report/auction_artists.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/auction_bids.rml b/addons/auction/report/auction_bids.rml
index 7de9cba0d1a..f1eeaad24ba 100644
--- a/addons/auction/report/auction_bids.rml
+++ b/addons/auction/report/auction_bids.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/auction_buyer_result.rml b/addons/auction/report/auction_buyer_result.rml
index bad772963ed..9c785beb899 100644
--- a/addons/auction/report/auction_buyer_result.rml
+++ b/addons/auction/report/auction_buyer_result.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/auction_catelog.rml b/addons/auction/report/auction_catelog.rml
index 8a98fcac918..e5bd7373cf5 100644
--- a/addons/auction/report/auction_catelog.rml
+++ b/addons/auction/report/auction_catelog.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/auction_objects.rml b/addons/auction/report/auction_objects.rml
index 988d9c1321f..bd9e429da5d 100644
--- a/addons/auction/report/auction_objects.rml
+++ b/addons/auction/report/auction_objects.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/auction_result.rml b/addons/auction/report/auction_result.rml
index 48ecd99d2e1..1c6a99b2259 100644
--- a/addons/auction/report/auction_result.rml
+++ b/addons/auction/report/auction_result.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/auction_total.rml b/addons/auction/report/auction_total.rml
index b7718a56b9c..46926f58eca 100644
--- a/addons/auction/report/auction_total.rml
+++ b/addons/auction/report/auction_total.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/auction_total_rml.rml b/addons/auction/report/auction_total_rml.rml
index 2d88e2ad2c5..0cb60f2915e 100644
--- a/addons/auction/report/auction_total_rml.rml
+++ b/addons/auction/report/auction_total_rml.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/bids_lots.rml b/addons/auction/report/bids_lots.rml
index c2cad707a57..8d37024b742 100644
--- a/addons/auction/report/bids_lots.rml
+++ b/addons/auction/report/bids_lots.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/bids_phones_details.rml b/addons/auction/report/bids_phones_details.rml
index adf9e6a63b3..36393e381e2 100644
--- a/addons/auction/report/bids_phones_details.rml
+++ b/addons/auction/report/bids_phones_details.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/buyer_form_report.rml b/addons/auction/report/buyer_form_report.rml
index 3421bf27d12..7f9a124e2d9 100644
--- a/addons/auction/report/buyer_form_report.rml
+++ b/addons/auction/report/buyer_form_report.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/buyer_list.rml b/addons/auction/report/buyer_list.rml
index c5e9ef9ca7b..ac46e654ff6 100644
--- a/addons/auction/report/buyer_list.rml
+++ b/addons/auction/report/buyer_list.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/catelogwithpictures.rml b/addons/auction/report/catelogwithpictures.rml
index 6348f139fed..41738145b11 100644
--- a/addons/auction/report/catelogwithpictures.rml
+++ b/addons/auction/report/catelogwithpictures.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/deposit_seller.rml b/addons/auction/report/deposit_seller.rml
index 518f1f441df..7259ef005d3 100644
--- a/addons/auction/report/deposit_seller.rml
+++ b/addons/auction/report/deposit_seller.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/lots_list.rml b/addons/auction/report/lots_list.rml
index ff3621f90e4..5d9946d87c1 100644
--- a/addons/auction/report/lots_list.rml
+++ b/addons/auction/report/lots_list.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/lots_list_inventory.rml b/addons/auction/report/lots_list_inventory.rml
index 561c90c5240..8978ebbcbb5 100644
--- a/addons/auction/report/lots_list_inventory.rml
+++ b/addons/auction/report/lots_list_inventory.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/lots_list_landscape.rml b/addons/auction/report/lots_list_landscape.rml
index 250d21ca497..05bbe83d09b 100644
--- a/addons/auction/report/lots_list_landscape.rml
+++ b/addons/auction/report/lots_list_landscape.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/auction/report/seller_form_report.rml b/addons/auction/report/seller_form_report.rml
index d9cc1adaadf..5d1669802b4 100644
--- a/addons/auction/report/seller_form_report.rml
+++ b/addons/auction/report/seller_form_report.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py
index 2d239adada2..51661f9eb00 100644
--- a/addons/base_action_rule/base_action_rule.py
+++ b/addons/base_action_rule/base_action_rule.py
@@ -171,6 +171,8 @@ the rule to mark CC(mail to any other person defined in actions)."),
`post_action`, in that order.
"""
def wrapper(cr, uid, vals, context=context):
+ if context is None:
+ context = {}
new_id = old_create(cr, uid, vals, context=context)
if not context.get('action'):
self.post_action(cr, uid, [new_id], model, context=context)
@@ -183,6 +185,8 @@ the rule to mark CC(mail to any other person defined in actions)."),
`post_action`, in that order.
"""
def wrapper(cr, uid, ids, vals, context=context):
+ if context is None:
+ context = {}
if isinstance(ids, (str, int, long)):
ids = [ids]
old_write(cr, uid, ids, vals, context=context)
diff --git a/addons/base_module_doc_rst/report/ir_module_reference_graph.rml b/addons/base_module_doc_rst/report/ir_module_reference_graph.rml
index 9d24bf1be86..40f631fc9c8 100644
--- a/addons/base_module_doc_rst/report/ir_module_reference_graph.rml
+++ b/addons/base_module_doc_rst/report/ir_module_reference_graph.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index 03cdb31832d..7629d929635 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -154,7 +154,7 @@ class crm_case_categ(osv.osv):
def _find_object_id(self, cr, uid, context=None):
"""Finds id for case object"""
object_id = context and context.get('object_id', False) or False
- ids = self.pool.get('ir.model').search(cr, uid, [('model', '=', object_id)])
+ ids = self.pool.get('ir.model').search(cr, uid, [('id', '=', object_id)])
return ids and ids[0] or False
_defaults = {
diff --git a/addons/crm/res_partner.py b/addons/crm/res_partner.py
index e2016f6d8aa..2bccdeed235 100644
--- a/addons/crm/res_partner.py
+++ b/addons/crm/res_partner.py
@@ -68,7 +68,7 @@ class res_partner(osv.osv):
'categ_id' : categ_ids and categ_ids[0] or '',
'state' :'draft',
'type': 'opportunity'
- })
+ }, context=context)
opportunity_ids[partner_id] = opportunity_id
return opportunity_ids
res_partner()
diff --git a/addons/crm/res_partner_view.xml b/addons/crm/res_partner_view.xml
index 79b8bebb55d..bcb11fe6b11 100644
--- a/addons/crm/res_partner_view.xml
+++ b/addons/crm/res_partner_view.xml
@@ -86,6 +86,7 @@
+
diff --git a/addons/crm/wizard/crm_partner_to_opportunity.py b/addons/crm/wizard/crm_partner_to_opportunity.py
index 6322d0341c1..a1e1f0f2914 100644
--- a/addons/crm/wizard/crm_partner_to_opportunity.py
+++ b/addons/crm/wizard/crm_partner_to_opportunity.py
@@ -58,6 +58,7 @@ class crm_partner2opportunity(osv.osv_memory):
def make_opportunity(self, cr, uid, ids, context=None):
partner_ids = context and context.get('active_ids', []) or []
+ partner_id = partner_ids[0] if partner_ids else None
partner = self.pool.get('res.partner')
lead = self.pool.get('crm.lead')
data = self.browse(cr, uid, ids, context=context)[0]
@@ -65,6 +66,8 @@ class crm_partner2opportunity(osv.osv_memory):
data.name,
data.planned_revenue,
data.probability,
+ partner_id,
+ context=context,
)
opportunity_id = opportunity_ids[partner_ids[0]]
return lead.redirect_opportunity_view(cr, uid, opportunity_id, context=context)
diff --git a/addons/delivery/report/shipping.rml b/addons/delivery/report/shipping.rml
index 1ed7e7098bc..3709c465e66 100644
--- a/addons/delivery/report/shipping.rml
+++ b/addons/delivery/report/shipping.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/edi/__openerp__.py b/addons/edi/__openerp__.py
index 07b189e501d..ac0ced155ab 100644
--- a/addons/edi/__openerp__.py
+++ b/addons/edi/__openerp__.py
@@ -50,6 +50,9 @@ technical OpenERP documentation at http://doc.openerp.com
"css": [
"static/src/css/edi.css"
],
+ 'qweb': [
+ "static/src/xml/*.xml",
+ ],
'installable': True,
'active': False,
'certificate': '002046536359186',
diff --git a/addons/edi/static/src/js/edi.js b/addons/edi/static/src/js/edi.js
index ea7f55f1a82..cef30842362 100644
--- a/addons/edi/static/src/js/edi.js
+++ b/addons/edi/static/src/js/edi.js
@@ -1,7 +1,4 @@
openerp.edi = function(openerp) {
-openerp.web.qweb.add_template("/edi/static/src/xml/edi.xml");
-openerp.web.qweb.add_template("/edi/static/src/xml/edi_account.xml");
-openerp.web.qweb.add_template("/edi/static/src/xml/edi_sale_purchase.xml");
openerp.edi = {}
openerp.edi.EdiView = openerp.web.Widget.extend({
diff --git a/addons/hr_attendance/report/attendance_errors.rml b/addons/hr_attendance/report/attendance_errors.rml
index 9ad71c84476..6806c02c422 100644
--- a/addons/hr_attendance/report/attendance_errors.rml
+++ b/addons/hr_attendance/report/attendance_errors.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py
index e1d451c9f7f..58ad9d9b3e0 100644
--- a/addons/hr_evaluation/hr_evaluation.py
+++ b/addons/hr_evaluation/hr_evaluation.py
@@ -240,7 +240,7 @@ class hr_evaluation(osv.osv):
request_obj = self.pool.get('hr.evaluation.interview')
self.write(cr, uid, ids, {'state':'progress'}, context=context)
for id in self.browse(cr, uid, ids, context=context):
- if len(id.survey_request_ids) != len(request_obj.search(cr, uid, [('evaluation_id', '=', id.id),('state', '=', 'done')], context=context)):
+ if len(id.survey_request_ids) != len(request_obj.search(cr, uid, [('evaluation_id', '=', id.id),('state', 'in', ['done','cancel'])], context=context)):
raise osv.except_osv(_('Warning !'),_("You cannot change state, because some appraisal in waiting answer or draft state"))
return True
@@ -250,6 +250,9 @@ class hr_evaluation(osv.osv):
return True
def button_cancel(self, cr, uid, ids, context=None):
+ interview_obj=self.pool.get('hr.evaluation.interview')
+ evaluation = self.browse(cr, uid, ids[0], context)
+ interview_obj.survey_req_cancel(cr, uid, [r.id for r in evaluation.survey_request_ids])
self.write(cr, uid, ids,{'state':'cancel'}, context=context)
return True
diff --git a/addons/hr_expense/report/expense.rml b/addons/hr_expense/report/expense.rml
index cce2025f17f..d0d73aa5ca4 100644
--- a/addons/hr_expense/report/expense.rml
+++ b/addons/hr_expense/report/expense.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py
index 22e0df5f6b0..d97552a3dbc 100644
--- a/addons/hr_holidays/hr_holidays.py
+++ b/addons/hr_holidays/hr_holidays.py
@@ -21,7 +21,7 @@
#
##############################################################################
-import datetime
+import datetime, time
from itertools import groupby
from operator import itemgetter
@@ -396,8 +396,28 @@ class hr_employee(osv.osv):
remaining[employee_id] = 0.0
return remaining
+ def _get_leave_status(self, cr, uid, ids, name, args, context=None):
+ holidays_id = self.pool.get('hr.holidays').search(cr, uid,
+ [('employee_id', 'in', ids), ('date_from','<=',time.strftime('%Y-%m-%d %H:%M:%S')),
+ ('date_to','>=',time.strftime('%Y-%m-%d %H:%M:%S')),('type','=','remove')],
+ context=context)
+ result = {}
+ for id in ids:
+ result[id] = {
+ 'current_leave_state': False,
+ 'current_leave_id': False
+ }
+ for holiday in self.pool.get('hr.holidays').browse(cr, uid, holidays_id, context=context):
+ result[holiday.employee_id.id]['current_leave_state'] = holiday.state
+ result[holiday.employee_id.id]['current_leave_id'] = holiday.holiday_status_id.id
+ return result
+
_columns = {
'remaining_leaves': fields.function(_get_remaining_days, string='Remaining Legal Leaves', fnct_inv=_set_remaining_days, type="float", help='Total number of legal leaves allocated to this employee, change this value to create allocation/leave requests.'),
+ 'current_leave_state': fields.function(_get_leave_status, multi="leave_status", string="Current Leave Status", type="selection",
+ selection=[('draft', 'New'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'),
+ ('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')]),
+ 'current_leave_id': fields.function(_get_leave_status, multi="leave_status", string="Current Leave Type",type='many2one', relation='hr.holidays.status')
}
hr_employee()
diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml
index a989ea50222..0a484ebf4b4 100644
--- a/addons/hr_holidays/hr_holidays_view.xml
+++ b/addons/hr_holidays/hr_holidays_view.xml
@@ -492,7 +492,9 @@
-
+
+
+
diff --git a/addons/hr_payroll/report/report_contribution_register.rml b/addons/hr_payroll/report/report_contribution_register.rml
index efe2955b22d..b3a5de9753d 100644
--- a/addons/hr_payroll/report/report_contribution_register.rml
+++ b/addons/hr_payroll/report/report_contribution_register.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/hr_payroll/report/report_payslip.rml b/addons/hr_payroll/report/report_payslip.rml
index ab509072c63..4d96e4b5ef7 100644
--- a/addons/hr_payroll/report/report_payslip.rml
+++ b/addons/hr_payroll/report/report_payslip.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/hr_payroll/report/report_payslip_details.rml b/addons/hr_payroll/report/report_payslip_details.rml
index c344389648d..fe6a10dd1f5 100644
--- a/addons/hr_payroll/report/report_payslip_details.rml
+++ b/addons/hr_payroll/report/report_payslip_details.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml
index 010ebdc3d7c..57ca806061a 100644
--- a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml
+++ b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/hr_timesheet_invoice/report/cost_ledger.rml b/addons/hr_timesheet_invoice/report/cost_ledger.rml
index 3fa2f8239e1..d014dd49927 100644
--- a/addons/hr_timesheet_invoice/report/cost_ledger.rml
+++ b/addons/hr_timesheet_invoice/report/cost_ledger.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/l10n_fr/report/bilan_report.rml b/addons/l10n_fr/report/bilan_report.rml
index 0881b40916c..f448d63a81a 100644
--- a/addons/l10n_fr/report/bilan_report.rml
+++ b/addons/l10n_fr/report/bilan_report.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/l10n_fr/report/compute_resultant_report.rml b/addons/l10n_fr/report/compute_resultant_report.rml
index c77be9534cb..b3897c8a839 100644
--- a/addons/l10n_fr/report/compute_resultant_report.rml
+++ b/addons/l10n_fr/report/compute_resultant_report.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/lunch/report/order.rml b/addons/lunch/report/order.rml
index 47ea19b26d5..30c16ad4894 100644
--- a/addons/lunch/report/order.rml
+++ b/addons/lunch/report/order.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/marketing_campaign_crm_demo/crm_lead_mc_demo_report.rml b/addons/marketing_campaign_crm_demo/crm_lead_mc_demo_report.rml
index 6944f3b22d2..1f1df2c713e 100644
--- a/addons/marketing_campaign_crm_demo/crm_lead_mc_demo_report.rml
+++ b/addons/marketing_campaign_crm_demo/crm_lead_mc_demo_report.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/mrp/report/bom_structure.rml b/addons/mrp/report/bom_structure.rml
index b3930f9d51a..cdc27c08d87 100644
--- a/addons/mrp/report/bom_structure.rml
+++ b/addons/mrp/report/bom_structure.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/mrp/report/order.rml b/addons/mrp/report/order.rml
index 5e650740de5..8833d08e596 100644
--- a/addons/mrp/report/order.rml
+++ b/addons/mrp/report/order.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml
index 0c970d7d196..539b9fe2ca6 100644
--- a/addons/mrp/test/order_process.yml
+++ b/addons/mrp/test/order_process.yml
@@ -54,6 +54,9 @@
Now I check workcenter lines.
-
!python {model: mrp.production}: |
+ from tools import float_compare
+ def assert_equals(value1, value2, msg, float_compare=float_compare):
+ assert float_compare(value1, value2, precision_digits=2) == 0, msg
order = self.browse(cr, uid, ref("mrp_production_shelf100cm"), context=context)
assert len(order.workcenter_lines), "Workcenter lines are not generated proper."
for line in order.workcenter_lines:
@@ -63,25 +66,20 @@
d, m = divmod(factor, wc.capacity_per_cycle)
cycle = (d + (m and 1.0 or 0.0))
if line.name == "Short time assembly - Assembly Section":
- assert line.sequence, "Sequence is not correspond: %s" % (line.name)
- assert line.cycle == (4*cycle), "Cycle is not correspond: %s" % (line.name)
- assert line.hour == (2*cycle*4 + hours), "Hours is not correspond: %s"% (line.name)
+ assert_equals(line.cycle, (4*cycle), "Computed cycles mismatch: %s" % (line.name))
+ assert_equals(line.hour, (2*cycle*4 + hours), "Computed hours mismatch: %s"% (line.name))
elif line.name == "Short time assembly - Rear Panel SHE100":
- assert line.sequence, "Sequence is not correspond: %s" % (line.name)
- assert line.cycle == (1*cycle), "Cycle is not correspond: %s" % (line.name)
- assert line.hour == (2*cycle + hours), "Hours is not correspond: %s"% (line.name)
+ assert_equals(line.cycle, (1*cycle), "Computed cycles mismatch: %s" % (line.name))
+ assert_equals(line.hour, (2*cycle + hours), "Computed hours mismatch: %s"% (line.name))
elif line.name == "long time assembly - Shelf of 100cm":
- assert line.sequence, "Sequence is not correspond: %s" % (line.name)
- assert line.cycle == (2*cycle), "Cycle is not correspond: %s" % (line.name)
- assert line.hour == (5*cycle + hours), "Hours is not correspond: %s"% (line.name)
+ assert_equals(line.cycle, (2*cycle), "Computed cycles mismatch: %s" % (line.name))
+ assert_equals(line.hour, (5*cycle + hours), "Computed hours mismatch: %s"% (line.name))
elif line.name == "Testing - Shelf of 100cm":
- assert line.sequence, "Sequence is not correspond: %s" % (line.name)
- assert line.cycle == (1*cycle), "Cycle is not correspond: %s" % (line.name)
- assert line.hour == (1*cycle + hours), "Hours is not correspond: %s"% (line.name)
+ assert_equals(line.cycle, (1*cycle), "Computed cycles mismatch: %s" % (line.name))
+ assert_equals(line.hour, (1*cycle + hours), "Computed hours mismatch: %s"% (line.name))
elif line.name == "Packing - Shelf of 100cm":
- assert line.sequence, "Sequence is not correspond: %s" % (line.name)
- assert line.cycle == (1*cycle), "Cycle is not correspond: %s" % (line.name)
- assert line.hour == (0.5*cycle + hours), "Hours is not correspond: %s"% (line.name)
+ assert_equals(line.cycle, (1*cycle), "Computed cycles mismatch: %s" % (line.name))
+ assert_equals(line.hour, (0.5*cycle + hours), "Computed hours mismatch: %s"% (line.name))
else:
raise AssertionError('unknown workcenter line: %s' % line)
-
diff --git a/addons/mrp_repair/__openerp__.py b/addons/mrp_repair/__openerp__.py
index 39f5a51e92c..d5cd855e823 100644
--- a/addons/mrp_repair/__openerp__.py
+++ b/addons/mrp_repair/__openerp__.py
@@ -48,8 +48,12 @@ The aim is to have a complete module to manage all products repairs. The followi
'mrp_repair_workflow.xml',
'mrp_repair_report.xml',
],
- 'demo_xml': [],
- 'test': ['test/test_mrp_repair.yml', 'test/mrp_repair_report.yml','test/mrp_repair_cancel.yml'],
+ 'demo_xml': ['mrp_repair_demo.yml'],
+ 'test': ['test/test_mrp_repair_noneinv.yml',
+ 'test/test_mrp_repair_b4inv.yml',
+ 'test/test_mrp_repair_afterinv.yml',
+ 'test/test_mrp_repair_cancel.yml',
+ 'test/mrp_repair_report.yml'],
'installable': True,
'active': False,
'certificate': '0060814381277',
diff --git a/addons/mrp_repair/mrp_repair_demo.yml b/addons/mrp_repair/mrp_repair_demo.yml
new file mode 100644
index 00000000000..56aad9ae16d
--- /dev/null
+++ b/addons/mrp_repair/mrp_repair_demo.yml
@@ -0,0 +1,123 @@
+-
+ !record {model: stock.move, id: stock_move_pcbasicpc0}:
+ company_id: base.main_company
+ date: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
+ date_expected: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
+ location_dest_id: stock.stock_location_14
+ location_id: stock.stock_location_stock
+ name: '[PC1] Basic PC'
+ product_id: product.product_product_pc1
+ product_qty: 1.0
+ product_uom: product.product_uom_unit
+ product_uos_qty: 1.0
+-
+ !record {model: mrp.repair, id: mrp_repair_rmrp1}:
+ address_id: base.res_partner_address_1
+ guarantee_limit: !eval datetime.today().strftime("%Y-%m-%d")
+ invoice_method: 'none'
+ partner_invoice_id: base.res_partner_address_1
+ location_dest_id: stock.stock_location_14
+ location_id: stock.stock_location_14
+ move_id: 'stock_move_pcbasicpc0'
+ name: RMA00004
+ operations:
+ - location_dest_id: stock.location_production
+ location_id: stock.stock_location_stock
+ name: '[HDD1] HDD Seagate 7200.8 80GB'
+ price_unit: 50.0
+ product_id: product.product_product_hdd1
+ product_uom: product.product_uom_unit
+ product_uom_qty: 1.0
+ state: draft
+ to_invoice: 1
+ type: add
+ fees_lines:
+ - name: 'HDD1 Seagate repair fees'
+ product_id: product.product_product_hdd1
+ product_uom_qty: 1.0
+ product_uom: product.product_uom_unit
+ price_unit: 50.0
+ partner_id: base.res_partner_9
+ product_id: product.product_product_pc1
+-
+ !record {model: stock.move, id: stock.stock_move_stockmvmrp1}:
+ company_id: base.main_company
+ date: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
+ date_expected: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
+ location_dest_id: stock.stock_location_14
+ location_id: stock.stock_location_stock
+ name: '[PC3] Medium PC'
+ product_id: product.product_product_pc3
+ product_qty: 1.0
+ product_uom: product.product_uom_unit
+ product_uos_qty: 1.0
+-
+ !record {model: mrp.repair, id: mrp_repair_rmrp0}:
+ address_id: base.res_partner_address_1
+ guarantee_limit: !eval datetime.today().strftime("%Y-%m-%d")
+ invoice_method: 'after_repair'
+ partner_invoice_id: base.res_partner_address_1
+ location_dest_id: stock.stock_location_14
+ location_id: stock.stock_location_14
+ move_id: 'stock.stock_move_stockmvmrp1'
+ name: RMA-00007
+ operations:
+ - location_dest_id: stock.location_production
+ location_id: stock.stock_location_stock
+ name: '[HDD2] HDD Seagate 7200.8 120GB'
+ price_unit: 50.0
+ product_id: product.product_product_hdd2
+ product_uom: product.product_uom_unit
+ product_uom_qty: 1.0
+ state: draft
+ to_invoice: 1
+ type: add
+ fees_lines:
+ - name: 'HDD2 Seagate repair fees'
+ product_id: product.product_product_hdd2
+ product_uom_qty: 1.0
+ product_uom: product.product_uom_unit
+ price_unit: 50.0
+ partner_id: base.res_partner_9
+ product_id: product.product_product_pc3
+-
+ !record {model: stock.move, id: stock.stock_move_stockmvmrp2}:
+ company_id: base.main_company
+ date: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
+ date_expected: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
+ location_dest_id: stock.stock_location_14
+ location_id: stock.stock_location_stock
+ name: '[PC4] Customizable PC'
+ product_id: product.product_product_pc4
+ product_qty: 1.0
+ product_uom: product.product_uom_unit
+ product_uos_qty: 1.0
+-
+ !record {model: mrp.repair, id: mrp_repair_rmrp2}:
+ address_id: base.res_partner_address_1
+ guarantee_limit: !eval datetime.today().strftime("%Y-%m-%d")
+ invoice_method: 'b4repair'
+ partner_invoice_id: base.res_partner_address_1
+ location_dest_id: stock.stock_location_14
+ location_id: stock.stock_location_14
+ move_id: 'stock.stock_move_stockmvmrp2'
+ name: RMA-00011
+ operations:
+ - location_dest_id: stock.location_production
+ location_id: stock.stock_location_stock
+ name: '[HDD3] HDD Seagate 7200.8 160GB'
+ price_unit: 50.0
+ product_id: product.product_product_hdd3
+ product_uom: product.product_uom_unit
+ product_uom_qty: 1.0
+ state: draft
+ to_invoice: 1
+ type: add
+ fees_lines:
+ - name: 'HDD3 Seagate repair fees'
+ product_id: product.product_product_hdd3
+ product_uom_qty: 1.0
+ product_uom: product.product_uom_unit
+ price_unit: 50.0
+ partner_id: base.res_partner_9
+ product_id: product.product_product_pc4
diff --git a/addons/mrp_repair/report/order.rml b/addons/mrp_repair/report/order.rml
index ecec220edbb..539ea69ba63 100644
--- a/addons/mrp_repair/report/order.rml
+++ b/addons/mrp_repair/report/order.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/mrp_repair/test/mrp_repair_cancel.yml b/addons/mrp_repair/test/mrp_repair_cancel.yml
deleted file mode 100644
index 682a70fde5f..00000000000
--- a/addons/mrp_repair/test/mrp_repair_cancel.yml
+++ /dev/null
@@ -1,100 +0,0 @@
--
- In order to test repair orders I have created stock move line record.
--
- !record {model: stock.move, id: stock_move_pcbasicpc0}:
- company_id: base.main_company
- date: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
- date_expected: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
- location_dest_id: stock.stock_location_14
- location_id: stock.stock_location_stock
- name: '[PC1] Basic PC'
- product_id: product.product_product_pc1
- product_qty: 1.0
- product_uom: product.product_uom_unit
- product_uos_qty: 1.0
-
--
- I start by creating new Repair order for "Basic PC" product and Invoice Method is "No Invoice".
--
- !record {model: mrp.repair, id: mrp_repair_rma2}:
- address_id: base.res_partner_address_1
- guarantee_limit: !eval datetime.today().strftime("%Y-%m-%d")
- invoice_method: 'none'
- partner_invoice_id: base.res_partner_address_1
- location_dest_id: stock.stock_location_14
- location_id: stock.stock_location_14
- move_id: 'stock_move_pcbasicpc0'
- name: RMA000055
- operations:
- - location_dest_id: stock.location_production
- location_id: stock.stock_location_stock
- name: '[HDD1] HDD Seagate 7200.8 80GB'
- price_unit: 50.0
- product_id: product.product_product_hdd1
- product_uom: product.product_uom_unit
- product_uom_qty: 1.0
- state: draft
- to_invoice: 1
- type: add
- fees_lines:
- - name: 'HDD1 Seagate repair fees'
- product_id: product.product_product_hdd1
- product_uom_qty: 1.0
- product_uom: product.product_uom_unit
- price_unit: 50.0
- partner_id: base.res_partner_9
- product_id: product.product_product_pc1
--
- I confirm this Repair order.
--
- !workflow {model: mrp.repair, action: repair_confirm, ref: mrp_repair_rma2}
--
- I Cancel this Repair order.
--
- !python {model: mrp.repair.cancel}: |
- context = {"lang": 'en_US', "active_model":"mrp.repair", "active_ids": [ref("mrp_repair_rma2")], "tz": False, "active_id":ref('mrp_repair_rma2')}
- self.fields_view_get(cr, uid, False, "form", context)
- self.cancel_repair(cr, uid, [ref("mrp_repair_rma2")], context=context)
--
- I check that Repair order is in "Cancel" state.
--
- !assert {model: mrp.repair, id: mrp_repair_rma2}:
- - state == 'cancel'
--
- I Reopen the repair order as new.
--
- !python {model: mrp.repair}: |
- self.action_cancel_draft(cr, uid, [ref('mrp_repair_rma2')])
--
- I change the Invoice method of the repair order to Before repair.
--
- !python {model: mrp.repair}: |
- self.write(cr, uid, [ref('mrp_repair_rma2')], {'invoice_method': 'b4repair'})
--
- I confirm the Repair order again.
--
- !workflow {model: mrp.repair, action: repair_confirm, ref: mrp_repair_rma2}
--
- Repair order state to 'Ready'.
--
- !python {model: mrp.repair}: |
- self.action_repair_ready(cr, uid, [ref('mrp_repair_rma2')], context=None)
--
- I click on "Create Invoice" button of this wizard to make invoice.
--
- !workflow {model: mrp.repair, action: action_invoice_create, ref: mrp_repair_rma2}
--
- I check that Invoice is created for this repair order.
--
- !python {model: mrp.repair}: |
- repair_id = self.browse(cr, uid, [ref('mrp_repair_rma2')], context=context)[0]
- assert repair_id.invoice_id.id, _("No invoice exists for this repair order.")
--
- I start the repairing process by click on "Start Repair" Button.
--
- !workflow {model: mrp.repair, action: action_repair_start, ref: mrp_repair_rma2}
--
- Repairing Process for product is Done and I End Repair process by click on "End Repair" button For Invoice Type b4repair.
--
- !workflow {model: mrp.repair, action: action_repair_end, ref: mrp_repair_rma2}
-
diff --git a/addons/mrp_repair/test/mrp_repair_report.yml b/addons/mrp_repair/test/mrp_repair_report.yml
index cc6600c6704..3b8e05108c8 100644
--- a/addons/mrp_repair/test/mrp_repair_report.yml
+++ b/addons/mrp_repair/test/mrp_repair_report.yml
@@ -3,6 +3,6 @@
-
!python {model: mrp.repair}: |
import netsvc, tools, os
- (data, format) = netsvc.LocalService('report.repair.order').create(cr, uid, [ref('mrp_repair.mrp_repair_rma0')], {}, {})
+ (data, format) = netsvc.LocalService('report.repair.order').create(cr, uid, [ref('mrp_repair.mrp_repair_rmrp0')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'mrp_repair-order_report.'+format), 'wb+').write(data)
diff --git a/addons/mrp_repair/test/test_mrp_repair.yml b/addons/mrp_repair/test/test_mrp_repair.yml
deleted file mode 100644
index 27cc94da3a8..00000000000
--- a/addons/mrp_repair/test/test_mrp_repair.yml
+++ /dev/null
@@ -1,118 +0,0 @@
--
- In order to test "mrp_repair" module, I start with creating repair order, confirm it, and start repair.
--
- Given that I have already stock move line created.
--
- !record {model: stock.move, id: stock_move_pcbasicpc0}:
- company_id: base.main_company
- date: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
- date_expected: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
- location_dest_id: stock.stock_location_14
- location_id: stock.stock_location_stock
- name: '[PC1] Basic PC'
- product_id: product.product_product_pc1
- product_qty: 1.0
- product_uom: product.product_uom_unit
- product_uos_qty: 1.0
-
--
- I start by creating new Repair order for "Basic PC" product.
--
- !record {model: mrp.repair, id: mrp_repair_rma0}:
- address_id: base.res_partner_address_1
- guarantee_limit: !eval datetime.today().strftime("%Y-%m-%d")
- invoice_method: 'after_repair'
- partner_invoice_id: base.res_partner_address_1
- location_dest_id: stock.stock_location_14
- location_id: stock.stock_location_14
- move_id: 'stock_move_pcbasicpc0'
- name: RMA00004
- operations:
- - location_dest_id: stock.location_production
- location_id: stock.stock_location_stock
- name: '[HDD1] HDD Seagate 7200.8 80GB'
- price_unit: 50.0
- product_id: product.product_product_hdd1
- product_uom: product.product_uom_unit
- product_uom_qty: 1.0
- state: draft
- to_invoice: 1
- type: add
- fees_lines:
- - name: 'HDD1 Seagate repair fees'
- product_id: product.product_product_hdd1
- product_uom_qty: 1.0
- product_uom: product.product_uom_unit
- price_unit: 50.0
- partner_id: base.res_partner_9
- product_id: product.product_product_pc1
--
- On change of product sets some values
--
- !python {model: mrp.repair}: |
- self.onchange_product_id(cr, uid, [ref('mrp_repair_rma0')], product_id=False)
--
- On change of move id sets values of guarantee limit, source location, destination location, partner and partner address.
--
- !python {model: mrp.repair}: |
- repair_id = self.browse(cr, uid, [ref('mrp_repair_rma0')], context=context)[0]
- self.onchange_move_id(cr, uid, [ref('mrp_repair_rma0')], False, repair_id.move_id)
--
- On change of operation type it sets source location, destination location and to invoice field
--
- !python {model: mrp.repair.line}: |
- self.onchange_operation_type(cr, uid, [ref('mrp_repair_rma0')], type, False, ref('base.main_company'), {})
--
- On change of partner sets the values of partner address, partner invoice address and pricelist.
--
- !python {model: mrp.repair}: |
- repair_id = self.browse(cr, uid, [ref('mrp_repair_rma0')], context=context)[0]
- self.onchange_partner_id(cr, uid, [ref('mrp_repair_rma0')], False, repair_id.address_id)
--
- On change of production lot sets the values of source location, destination location, move and guarantee limit
--
- !python {model: mrp.repair}: |
- repair_id = self.browse(cr, uid, [ref('mrp_repair_rma0')], context=context)[0]
- self.onchange_lot_id(cr, uid, [ref('mrp_repair_rma0')], False, repair_id.product_id)
--
- I check that Repair order is in "Draft" state.
--
- !assert {model: mrp.repair, id: mrp_repair_rma0}:
- - state == 'draft'
--
- I confirm This Repair order.
--
- !workflow {model: mrp.repair, action: repair_confirm, ref: mrp_repair_rma0}
-
--
- I start the repairing process by click on "Start Repair" Button For Invoice Type After repair.
--
- !workflow {model: mrp.repair, action: repair_ready, ref: mrp_repair_rma0}
-
--
- I check that state is "Under Repair".
--
- !assert {model: mrp.repair, id: mrp_repair_rma0}:
- - state == 'under_repair'
--
- Repairing Process for product is Done and I End Repair process by click on "End Repair" button.
--
- !workflow {model: mrp.repair, action: action_repair_end, ref: mrp_repair_rma0}
-
--
- I select invoiced after repair option in this "RMA00004" Repair order.
- so I create Invoice by click on "Make Invoice" wizard.
--
- !record {model: mrp.repair.make_invoice, id: mrp_repair_make_invoice_0}:
- group: 1
--
- I click on "Create Invoice" button of this wizard to make invoice.
--
- !python {model: mrp.repair.make_invoice}: |
- self.make_invoices(cr, uid, [ref("mrp_repair_make_invoice_0")], {"active_ids": [ref("mrp_repair.mrp_repair_rma0")]})
--
- I check that Invoice is created for this repair order.
--
- !python {model: mrp.repair}: |
- repair_id = self.browse(cr, uid, [ref('mrp_repair_rma0')], context=context)[0]
- assert repair_id.invoice_id.id, _("No invoice exists for this repair order")
diff --git a/addons/mrp_repair/test/test_mrp_repair_afterinv.yml b/addons/mrp_repair/test/test_mrp_repair_afterinv.yml
new file mode 100644
index 00000000000..0d4eb9b1c7c
--- /dev/null
+++ b/addons/mrp_repair/test/test_mrp_repair_afterinv.yml
@@ -0,0 +1,36 @@
+-
+ In order to test invoice type after repair.
+-
+ I Confirm Repair order For Invoice Type After repair.
+-
+ !workflow {model: mrp.repair, action: repair_confirm, ref: mrp_repair_rmrp0}
+-
+ I start the repairing process by click on "Start Repair" Button For Invoice Type After repair.
+-
+ !workflow {model: mrp.repair, action: repair_ready, ref: mrp_repair_rmrp0}
+-
+ I check that state is "Under Repair".
+-
+ !assert {model: mrp.repair, id: mrp_repair_rmrp0}:
+ - state == 'under_repair'
+-
+ Repairing Process for product is Done and I End Repair process by click on "End Repair" button.
+-
+ !workflow {model: mrp.repair, action: action_repair_end, ref: mrp_repair_rmrp0}
+-
+ I define invoiced after repair option in this Repair order.
+ so I create Invoice by click on "Make Invoice" wizard.
+-
+ !record {model: mrp.repair.make_invoice, id: mrp_repair_make_invoice_0}:
+ group: 1
+-
+ I click on "Create Invoice" button of this wizard to make invoice.
+-
+ !python {model: mrp.repair.make_invoice}: |
+ self.make_invoices(cr, uid, [ref("mrp_repair_make_invoice_0")], {"active_ids": [ref("mrp_repair.mrp_repair_rmrp0")]})
+-
+ I check that Invoice is created for this repair order.
+-
+ !python {model: mrp.repair}: |
+ repair_id = self.browse(cr, uid, [ref('mrp_repair_rmrp0')], context=context)[0]
+ assert repair_id.invoice_id.id, _("No invoice exists for this repair order")
diff --git a/addons/mrp_repair/test/test_mrp_repair_b4inv.yml b/addons/mrp_repair/test/test_mrp_repair_b4inv.yml
new file mode 100644
index 00000000000..bfe717ecdd6
--- /dev/null
+++ b/addons/mrp_repair/test/test_mrp_repair_b4inv.yml
@@ -0,0 +1,29 @@
+-
+ Now test invoice type before repair.
+-
+ I Confirm Repair order For Invoice Type Before Repair.
+-
+ !workflow {model: mrp.repair, action: repair_confirm, ref: mrp_repair_rmrp2}
+-
+ Repair order state to 'Ready'.
+-
+ !python {model: mrp.repair}: |
+ self.action_repair_ready(cr, uid, [ref('mrp_repair_rmrp2')], context=None)
+-
+ I click on "Create Invoice" button of this wizard to make invoice.
+-
+ !workflow {model: mrp.repair, action: action_invoice_create, ref: mrp_repair_rmrp2}
+-
+ I check that Invoice is created for this repair order.
+-
+ !python {model: mrp.repair}: |
+ repair_id = self.browse(cr, uid, [ref('mrp_repair_rmrp2')], context=context)[0]
+ assert repair_id.invoice_id.id, _("No invoice exists for this repair order.")
+-
+ I start the repairing process by click on "Start Repair" Button.
+-
+ !workflow {model: mrp.repair, action: action_repair_start, ref: mrp_repair_rmrp2}
+-
+ Repairing Process for product is Done and I End Repair process by click on "End Repair" button For Invoice Type before repair.
+-
+ !workflow {model: mrp.repair, action: action_repair_end, ref: mrp_repair_rmrp2}
diff --git a/addons/mrp_repair/test/test_mrp_repair_cancel.yml b/addons/mrp_repair/test/test_mrp_repair_cancel.yml
new file mode 100644
index 00000000000..6a355f35b41
--- /dev/null
+++ b/addons/mrp_repair/test/test_mrp_repair_cancel.yml
@@ -0,0 +1,28 @@
+-
+ In order to test the cancel flow of mrp_repair module,
+ I start by creating new copy Repair order for "Basic PC" product.
+-
+ !python {model: mrp.repair}: |
+ copy_id = self.copy(cr, uid, ref("mrp_repair_rmrp1"))
+ context.update({'new_id':copy_id})
+-
+ I Cancel this Repair order.
+-
+ !python {model: mrp.repair.cancel}: |
+ new_id = context.get('new_id')
+ context.update({"active_model":"mrp.repair", "active_ids": [new_id],"active_id": new_id})
+ self.fields_view_get(cr, uid, False, "form", context)
+ self.cancel_repair(cr, uid, [new_id], context)
+-
+ I check that Repair order is in "Cancel" state.
+-
+ !python {model: mrp.repair}: |
+ new_id = context.get('new_id')
+ order = self.browse(cr, uid, [new_id])[0]
+ assert order.state == 'cancel',"Repair order should be in Cancel state."
+-
+ I Reopen the repair order as new.
+-
+ !python {model: mrp.repair}: |
+ new_id = context.get('new_id')
+ self.action_cancel_draft(cr, uid, [new_id])
diff --git a/addons/mrp_repair/test/test_mrp_repair_noneinv.yml b/addons/mrp_repair/test/test_mrp_repair_noneinv.yml
new file mode 100644
index 00000000000..66d5017e840
--- /dev/null
+++ b/addons/mrp_repair/test/test_mrp_repair_noneinv.yml
@@ -0,0 +1,27 @@
+-
+ In order to test "mrp_repair" module, I start from confirm it, and start repair.
+-
+ I Confirm Repair order for Invoice Type 'None'.
+-
+ !workflow {model: mrp.repair, action: repair_confirm, ref: mrp_repair_rmrp1}
+-
+ I start the repairing process by click on "Start Repair" Button For Invoice Type None.
+-
+ !workflow {model: mrp.repair, action: repair_ready, ref: mrp_repair_rmrp1}
+-
+ I check that state is "Under Repair".
+-
+ !assert {model: mrp.repair, id: mrp_repair_rmrp1}:
+ - state == 'under_repair'
+-
+ Repairing Process for product is Done and I End Repair process by click on "End Repair" button.
+-
+ !workflow {model: mrp.repair, action: action_repair_end, ref: mrp_repair_rmrp1}
+-
+ I define invoiced none option in this Repair order.
+ So, I check that Invoice should not be created for this repair order.
+-
+ !python {model: mrp.repair}: |
+ repair_id = self.browse(cr, uid, [ref('mrp_repair_rmrp1')], context=context)[0]
+ assert not repair_id.invoice_id.id, _("Invoice should not be exists for this repair order")
+
diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py
index 1eb9a0865f7..cf152131f99 100644
--- a/addons/point_of_sale/point_of_sale.py
+++ b/addons/point_of_sale/point_of_sale.py
@@ -453,12 +453,9 @@ class pos_order(osv.osv):
# Search for the income account
if line.product_id.property_account_income.id:
- income_account = line.\
- product_id.property_account_income.id
- elif line.product_id.categ_id.\
- property_account_income_categ.id:
- income_account = line.product_id.categ_id.\
- property_account_income_categ.id
+ income_account = line.product_id.property_account_income.id
+ elif line.product_id.categ_id.property_account_income_categ.id:
+ income_account = line.product_id.categ_id.property_account_income_categ.id
else:
raise osv.except_osv(_('Error !'), _('There is no income '\
'account defined for this product: "%s" (id:%d)') \
diff --git a/addons/point_of_sale/point_of_sale_demo.xml b/addons/point_of_sale/point_of_sale_demo.xml
index 95270721b8e..418066ec148 100644
--- a/addons/point_of_sale/point_of_sale_demo.xml
+++ b/addons/point_of_sale/point_of_sale_demo.xml
@@ -64,6 +64,20 @@
+
+ POS/019
+
+
+ direct
+
+ POS notes
+ done
+ out
+
+
+ none
+
+
@@ -76,7 +90,7 @@
POS/019
-
+
@@ -102,21 +116,6 @@
-
- POS/019
-
-
- direct
-
- POS notes
- done
- out
-
-
- OUT/00019
- none
-
-
POS/019
@@ -135,7 +134,7 @@
-
+
No Discount
diff --git a/addons/point_of_sale/report/account_statement.rml b/addons/point_of_sale/report/account_statement.rml
index 33c6c62cd6e..dc6e6c5e64c 100644
--- a/addons/point_of_sale/report/account_statement.rml
+++ b/addons/point_of_sale/report/account_statement.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml
index 7013ddcfb6f..bb58c5e823d 100644
--- a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml
+++ b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/point_of_sale/report/pos_details.rml b/addons/point_of_sale/report/pos_details.rml
index 12e8618accb..54ceba4104f 100644
--- a/addons/point_of_sale/report/pos_details.rml
+++ b/addons/point_of_sale/report/pos_details.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/point_of_sale/report/pos_details_summary.rml b/addons/point_of_sale/report/pos_details_summary.rml
index 2c119c103f1..d12cdec2598 100644
--- a/addons/point_of_sale/report/pos_details_summary.rml
+++ b/addons/point_of_sale/report/pos_details_summary.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/point_of_sale/report/pos_lines.rml b/addons/point_of_sale/report/pos_lines.rml
index 22ff18e0231..48eaca6c73b 100644
--- a/addons/point_of_sale/report/pos_lines.rml
+++ b/addons/point_of_sale/report/pos_lines.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/point_of_sale/report/pos_payment_report.rml b/addons/point_of_sale/report/pos_payment_report.rml
index 56e9982c080..757de687ee0 100644
--- a/addons/point_of_sale/report/pos_payment_report.rml
+++ b/addons/point_of_sale/report/pos_payment_report.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/point_of_sale/report/pos_payment_report_user.rml b/addons/point_of_sale/report/pos_payment_report_user.rml
index 18ed5b73d84..3105441aa0c 100644
--- a/addons/point_of_sale/report/pos_payment_report_user.rml
+++ b/addons/point_of_sale/report/pos_payment_report_user.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/point_of_sale/report/pos_sales_user.rml b/addons/point_of_sale/report/pos_sales_user.rml
index d2fefc379fd..6374a09da02 100644
--- a/addons/point_of_sale/report/pos_sales_user.rml
+++ b/addons/point_of_sale/report/pos_sales_user.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/point_of_sale/report/pos_sales_user_today.rml b/addons/point_of_sale/report/pos_sales_user_today.rml
index 6e633d375d8..5b0bc2a1dcb 100644
--- a/addons/point_of_sale/report/pos_sales_user_today.rml
+++ b/addons/point_of_sale/report/pos_sales_user_today.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/point_of_sale/report/pos_users_product.rml b/addons/point_of_sale/report/pos_users_product.rml
index 9e58423ba7d..f3a8cfd77e8 100644
--- a/addons/point_of_sale/report/pos_users_product.rml
+++ b/addons/point_of_sale/report/pos_users_product.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js
index 90a6b03f330..ccb9b0442e0 100644
--- a/addons/point_of_sale/static/src/js/pos.js
+++ b/addons/point_of_sale/static/src/js/pos.js
@@ -615,6 +615,8 @@ openerp.point_of_sale = function(db) {
this.$element.find('button').click(_.bind(this.performPayment, this));
},
performPayment: function(event) {
+ if (this.shop.get('selectedOrder').get('step') === 'receipt')
+ return;
var cashRegister, cashRegisterCollection, cashRegisterId;
/* set correct view */
this.shop.get('selectedOrder').set({'step': 'payment'});
diff --git a/addons/point_of_sale/wizard/pos_box_entries.py b/addons/point_of_sale/wizard/pos_box_entries.py
index 8313b345834..eff86611278 100644
--- a/addons/point_of_sale/wizard/pos_box_entries.py
+++ b/addons/point_of_sale/wizard/pos_box_entries.py
@@ -100,7 +100,8 @@ class pos_box_entries(osv.osv_memory):
if not statement_id:
raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox'))
- acc_id = product_obj.browse(cr, uid, int(data['product_id'])).property_account_income
+ product = product_obj.browse(cr, uid, int(data['product_id']))
+ acc_id = product.property_account_income or product.categ_id.property_account_income_categ
if not acc_id:
raise osv.except_osv(_('Error !'), _('Please check that income account is set to %s')%(product_obj.browse(cr, uid, data['product_id']).name))
if statement_id:
diff --git a/addons/point_of_sale/wizard/pos_box_out.py b/addons/point_of_sale/wizard/pos_box_out.py
index 2a8037dbdc7..4fdc79738ae 100644
--- a/addons/point_of_sale/wizard/pos_box_out.py
+++ b/addons/point_of_sale/wizard/pos_box_out.py
@@ -82,7 +82,7 @@ class pos_box_out(osv.osv_memory):
stat_done = statement_obj.browse(cr, uid, done_statmt, context=context)
am = 0.0
product = product_obj.browse(cr, uid, data['product_id'], context=context)
- acc_id = product.property_account_income or product.categ_id.property_account_income_categ
+ acc_id = product.property_account_expense or product.categ_id.property_account_expense_categ
if not acc_id:
raise osv.except_osv(_('Error !'), _('please check that account is set to %s')%(product.name))
if not statement_ids:
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index 38b9d2d0ed1..709f7ee2a98 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -26,7 +26,7 @@
-
+
diff --git a/addons/product/report/product_pricelist.rml b/addons/product/report/product_pricelist.rml
index 40ae456224d..14bf02300bc 100644
--- a/addons/product/report/product_pricelist.rml
+++ b/addons/product/report/product_pricelist.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/project_planning/report/report_planning.rml b/addons/project_planning/report/report_planning.rml
index 7d46de5e025..0f656d96967 100644
--- a/addons/project_planning/report/report_planning.rml
+++ b/addons/project_planning/report/report_planning.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml
index dfd93f0d45a..ffea456d77f 100644
--- a/addons/purchase/report/order.rml
+++ b/addons/purchase/report/order.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/purchase/report/request_quotation.rml b/addons/purchase/report/request_quotation.rml
index 866e3e9003b..e75d062542c 100644
--- a/addons/purchase/report/request_quotation.rml
+++ b/addons/purchase/report/request_quotation.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/purchase_requisition/report/purchase_requisition.rml b/addons/purchase_requisition/report/purchase_requisition.rml
index da9ec19492f..56e4c1ae0af 100644
--- a/addons/purchase_requisition/report/purchase_requisition.rml
+++ b/addons/purchase_requisition/report/purchase_requisition.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/report_intrastat/report/invoice.rml b/addons/report_intrastat/report/invoice.rml
index 0c635a611c8..497fa6b44ba 100644
--- a/addons/report_intrastat/report/invoice.rml
+++ b/addons/report_intrastat/report/invoice.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/sale/report/sale_order.rml b/addons/sale/report/sale_order.rml
index cef286653e1..29951d41e05 100644
--- a/addons/sale/report/sale_order.rml
+++ b/addons/sale/report/sale_order.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index a1adaa62c7f..c359c2f5822 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -1274,7 +1274,7 @@ class sale_order_line(osv.osv):
res = self.product_id_change(cursor, user, ids, pricelist, product,
qty=qty, uom=uom, qty_uos=qty_uos, uos=uos, name=name,
partner_id=partner_id, lang=lang, update_tax=update_tax,
- date_order=date_order)
+ date_order=date_order, context=context)
if 'product_uom' in res['value']:
del res['value']['product_uom']
if not uom:
diff --git a/addons/sale/test/picking_order_policy.yml b/addons/sale/test/picking_order_policy.yml
index 33b23dbd5d0..a4f88c8c7ae 100644
--- a/addons/sale/test/picking_order_policy.yml
+++ b/addons/sale/test/picking_order_policy.yml
@@ -110,18 +110,18 @@
order = self.browse(cr, uid, ref("order"))
assert order.invoice_ids, "Invoice is not created."
ac = order.partner_id.property_account_receivable.id
- journal_ids = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'sale'), ('company_id', '=', order.company_id.id)], limit=1)
+ journal_ids = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'sale'), ('company_id', '=', order.company_id.id)])
for invoice in order.invoice_ids:
- assert invoice.type == 'out_invoice',"Invoice should be Customer Invoice."
- assert invoice.account_id.id == ac,"Invoice account is not correspond."
- assert invoice.reference == order.client_order_ref or order.name,"Reference is not correspond."
- assert invoice.partner_id.id == order.partner_id.id,"Customer is not correspond."
- assert invoice.address_invoice_id.id == order.partner_invoice_id.id,"Invoice Address is not correspond."
- assert invoice.currency_id.id == order.pricelist_id.currency_id.id, "Currency is not correspond."
- assert invoice.comment == order.note or '',"Note is not correspond."
- assert invoice.journal_id.id == journal_ids[0],"Sales Journal is not link on Invoice."
- assert invoice.payment_term.id == order.payment_term.id, "Payment term is not correspond."
- for so_line in order.order_line:
+ assert invoice.type == 'out_invoice',"Invoice should be Customer Invoice."
+ assert invoice.account_id.id == ac,"Invoice account is not correspond."
+ assert invoice.reference == order.client_order_ref or order.name,"Reference is not correspond."
+ assert invoice.partner_id.id == order.partner_id.id,"Customer is not correspond."
+ assert invoice.address_invoice_id.id == order.partner_invoice_id.id,"Invoice Address is not correspond."
+ assert invoice.currency_id.id == order.pricelist_id.currency_id.id, "Currency is not correspond."
+ assert invoice.comment == order.note or '',"Note is not correspond."
+ assert invoice.journal_id.id in journal_ids,"Sales Journal is not link on Invoice."
+ assert invoice.payment_term.id == order.payment_term.id, "Payment term is not correspond."
+ for so_line in order.order_line:
inv_line = so_line.invoice_lines[0]
ac = so_line.product_id.product_tmpl_id.property_account_income.id or so_line.product_id.categ_id.property_account_income_categ.id
assert inv_line.product_id.id == so_line.product_id.id or False,"Product is not correspond"
diff --git a/addons/sale_crm/test/sale_crm.yml b/addons/sale_crm/test/sale_crm.yml
index e85cf2cb7ba..8c62b19346b 100644
--- a/addons/sale_crm/test/sale_crm.yml
+++ b/addons/sale_crm/test/sale_crm.yml
@@ -1,3 +1,16 @@
+-
+ Make sure the main company has at least one shop.
+-
+ !python {model: sale.shop}: |
+ company_id = self.pool.get('res.users')._get_company(cr, uid, context=context)
+ shop_ids = self.search(cr, uid, [('company_id', '=', company_id)])
+ if not shop_ids:
+ # take a shop, and assign it to the user's company
+ shop_ids = self.search(cr, uid, [])
+ if shop_ids:
+ self.write(cr, uid, [shop_ids[0]], {'company_id': company_id})
+-
+ I open the wizard "Make sales".
-
!record {model: crm.make.sale, id: crm_make_sale_0}:
partner_id: base.res_partner_4
diff --git a/addons/sale_layout/report/report_sale_layout.rml b/addons/sale_layout/report/report_sale_layout.rml
index c10279cc44b..bd142f123bd 100644
--- a/addons/sale_layout/report/report_sale_layout.rml
+++ b/addons/sale_layout/report/report_sale_layout.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py
index efbe679fe3b..0a5035647e5 100644
--- a/addons/share/wizard/share_wizard.py
+++ b/addons/share/wizard/share_wizard.py
@@ -71,15 +71,6 @@ class share_wizard(osv.osv_memory):
def has_share(self, cr, uid, context=None):
return self.has_group(cr, uid, module='share', group_xml_id='group_share_user', context=context)
- def has_email(self, cr, uid, context=None):
- return bool(self.pool.get('res.users').browse(cr, uid, uid, context=context).user_email)
-
- def view_init(self, cr, uid, fields_list, context=None):
- if not self.has_email(cr, uid, context=context):
- raise osv.except_osv(_('No e-mail address configured'),
- _('You must configure your e-mail address in the user preferences before using the Share button.'))
- return super(share_wizard, self).view_init(cr, uid, fields_list, context=context)
-
def _user_type_selection(self, cr, uid, context=None):
"""Selection values may be easily overridden/extended via inheritance"""
return [('embedded', 'Direct link or embed code'), ('emails','Emails'), ]
@@ -198,7 +189,14 @@ class share_wizard(osv.osv_memory):
'embed_option_search': True,
}
+ def has_email(self, cr, uid, context=None):
+ return bool(self.pool.get('res.users').browse(cr, uid, uid, context=context).user_email)
+
def go_step_1(self, cr, uid, ids, context=None):
+ user_type = self.browse(cr,uid,ids,context)[0].user_type
+ if user_type == 'emails' and not self.has_email(cr, uid, context=context):
+ raise osv.except_osv(_('No e-mail address configured'),
+ _('You must configure your e-mail address in the user preferences before using the Share button.'))
model, res_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'share', 'action_share_wizard_step1')
action = self.pool.get(model).read(cr, uid, res_id, context=context)
action['res_id'] = ids[0]
@@ -263,6 +261,7 @@ class share_wizard(osv.osv_memory):
'name': new_login,
'groups_id': [(6,0,[group_id])],
'share': True,
+ 'menu_tips' : False,
'company_id': current_user.company_id.id
}, context)
new_line = { 'user_id': user_id,
diff --git a/addons/stock/report/lot_overview.rml b/addons/stock/report/lot_overview.rml
index 1bb1b5990ca..9662eede03b 100644
--- a/addons/stock/report/lot_overview.rml
+++ b/addons/stock/report/lot_overview.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/stock/report/lot_overview_all.rml b/addons/stock/report/lot_overview_all.rml
index d2e628152f0..3b2dc5f7751 100644
--- a/addons/stock/report/lot_overview_all.rml
+++ b/addons/stock/report/lot_overview_all.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/stock/report/picking.rml b/addons/stock/report/picking.rml
index a71a6221656..96c12ceb404 100644
--- a/addons/stock/report/picking.rml
+++ b/addons/stock/report/picking.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/stock/report/stock_inventory_move.rml b/addons/stock/report/stock_inventory_move.rml
index d7bbc2cbd2a..a7c06988d47 100644
--- a/addons/stock/report/stock_inventory_move.rml
+++ b/addons/stock/report/stock_inventory_move.rml
@@ -1,6 +1,6 @@
-
+
diff --git a/addons/stock/wizard/stock_change_product_qty.py b/addons/stock/wizard/stock_change_product_qty.py
index a2b4b6ebae4..9d3de5692f0 100644
--- a/addons/stock/wizard/stock_change_product_qty.py
+++ b/addons/stock/wizard/stock_change_product_qty.py
@@ -35,17 +35,14 @@ class stock_change_product_qty(osv.osv_memory):
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
- result = super(stock_change_product_qty, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu)
+ fvg = super(stock_change_product_qty, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu)
product_id = context and context.get('active_id', False) or False
- if (context.get('active_model') == 'product.product') and product_id:
+ if view_type == 'form' and (context.get('active_model') == 'product.product') and product_id:
prod_obj = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
- fields = result.get('fields', {})
- if fields and (prod_obj.track_production == True) and (fields.get('prodlot_id')):
- result['fields']['prodlot_id']['required'] = True
- else:
- result['fields']['prodlot_id']['required'] = False
- return result
+ fvg['fields']['prodlot_id']['required'] = prod_obj.track_production
+
+ return fvg
def default_get(self, cr, uid, fields, context):
""" To get default values for the object.