-
-
-
-
-
-
No Stock
-
- Stock: on hand, available
- Public Price:
- Cost :
-
-
-
-
+
+
+
+
+
+
+
+ - Stock on hand:
+ - Stock available:
+ - Price:
+ - Cost:
+
+
+
diff --git a/addons/stock/static/src/css/stock.css b/addons/stock/static/src/css/stock.css
new file mode 100644
index 00000000000..6b84cd7a5b6
--- /dev/null
+++ b/addons/stock/static/src/css/stock.css
@@ -0,0 +1,68 @@
+.oe_product_vignette {
+ padding: 8px 0;
+ min-height: 100px;
+}
+
+.oe_product_img, .oe_product_desc {
+ display: inline-block;
+ vertical-align: top;
+}
+
+.oe_product_img {
+ width: 100px;
+ height: 100px;
+ text-align: center;
+ overflow: hidden;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ -o-border-radius: 3px;
+ -ms-border-radius: 3px;
+ border-radius: 3px;
+ -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
+ -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
+ -o-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
+ -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
+}
+
+.oe_product_photo {
+ width: 100px;
+ height: auto;
+ clip: rect(5px, 100px, 105px, 0px);
+}
+
+.oe_product_photo_wide {
+ height: 100px;
+ width: auto;
+ clip: rect(0px, 110px, 100px, 10px);
+}
+
+.oe_product_desc {
+ width: 220px;
+ font-size: 13px;
+ padding: 2px 5px;
+ color: #4c4c4c;
+ min-height: 120px;
+}
+
+.oe_product_desc h4 {
+ margin: 0;
+ font-size: 13px;
+}
+
+.oe_product_desc h4 a {
+ color: #4c4c4c;
+}
+
+.oe_product_desc h4 a:hover {
+ text-decoration: underline;
+}
+
+.oe_product_desc ul {
+ margin: 3px 0 5px;
+ padding: 0;
+ list-style: none;
+}
+
+.oe_product_desc li {
+ margin: 2px 0;
+}
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 461c863aaed..e3d3a3be1cb 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -167,7 +167,7 @@ class stock_location(osv.osv):
\n* Production: Virtual counterpart location for production operations: this location consumes the raw material and produces finished products
""", select = True),
# temporarily removed, as it's unused: 'allocation_method': fields.selection([('fifo', 'FIFO'), ('lifo', 'LIFO'), ('nearest', 'Nearest')], 'Allocation Method', required=True),
- 'complete_name': fields.function(_complete_name, type='char', size=100, string="Location Name", store=True),
+ 'complete_name': fields.function(_complete_name, type='char', size=256, string="Location Name", store=True),
'stock_real': fields.function(_product_value, type='float', string='Real Stock', multi="stock"),
'stock_virtual': fields.function(_product_value, type='float', string='Virtual Stock', multi="stock"),
@@ -1852,23 +1852,41 @@ class stock_move(osv.osv):
result[m.picking_id].append( (m, dest) )
return result
- def _create_chained_picking(self, cr, uid, pick_name, picking, ptype, move, context=None):
- res_obj = self.pool.get('res.company')
+ def _prepare_chained_picking(self, cr, uid, picking_name, picking, picking_type, moves_todo, context=None):
+ """Prepare the definition (values) to create a new chained picking.
+
+ :param str picking_name: desired new picking name
+ :param browse_record picking: source picking (being chained to)
+ :param str picking_type: desired new picking type
+ :param list moves_todo: specification of the stock moves to be later included in this
+ picking, in the form::
+
+ [[move, (dest_location, auto_packing, chained_delay, chained_journal,
+ chained_company_id, chained_picking_type)],
+ ...
+ ]
+
+ See also :meth:`stock_location.chained_location_get`.
+ """
+ res_company = self.pool.get('res.company')
+ return {
+ 'name': picking_name,
+ 'origin': tools.ustr(picking.origin or ''),
+ 'type': picking_type,
+ 'note': picking.note,
+ 'move_type': picking.move_type,
+ 'auto_picking': moves_todo[0][1][1] == 'auto',
+ 'stock_journal_id': moves_todo[0][1][3],
+ 'company_id': moves_todo[0][1][4] or res_company._company_default_get(cr, uid, 'stock.company', context=context),
+ 'address_id': picking.address_id.id,
+ 'invoice_state': 'none',
+ 'date': picking.date,
+ }
+
+ def _create_chained_picking(self, cr, uid, picking_name, picking, picking_type, moves_todo, context=None):
picking_obj = self.pool.get('stock.picking')
- pick_id= picking_obj.create(cr, uid, {
- 'name': pick_name,
- 'origin': tools.ustr(picking.origin or ''),
- 'type': ptype,
- 'note': picking.note,
- 'move_type': picking.move_type,
- 'auto_picking': move[0][1][1] == 'auto',
- 'stock_journal_id': move[0][1][3],
- 'company_id': move[0][1][4] or res_obj._company_default_get(cr, uid, 'stock.company', context=context),
- 'address_id': picking.address_id.id,
- 'invoice_state': 'none',
- 'date': picking.date,
- })
- return pick_id
+ return picking_obj.create(cr, uid, self._prepare_chained_picking(cr, uid, picking_name, picking, picking_type, moves_todo, context=context))
+
def create_chained_picking(self, cr, uid, moves, context=None):
res_obj = self.pool.get('res.company')
location_obj = self.pool.get('stock.location')
@@ -2271,7 +2289,7 @@ class stock_move(osv.osv):
return super(stock_move, self).unlink(
cr, uid, ids, context=ctx)
- # _create_lot function is not used anywhere
+ # _create_lot function is not used anywhere
def _create_lot(self, cr, uid, ids, product_id, prefix=False):
""" Creates production lot
@return: Production lot id
@@ -2314,10 +2332,10 @@ class stock_move(osv.osv):
for (id, name) in product_obj.name_get(cr, uid, [move.product_id.id]):
self.log(cr, uid, move.id, "%s x %s %s" % (quantity, name, _("were scrapped")))
- self.action_done(cr, uid, res)
+ self.action_done(cr, uid, res, context=context)
return res
- # action_split function is not used anywhere
+ # action_split function is not used anywhere
def action_split(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None):
""" Split Stock Move lines into production lot which specified split by quantity.
@param cr: the database cursor
@@ -2439,7 +2457,7 @@ class stock_move(osv.osv):
for (id, name) in product_obj.name_get(cr, uid, [new_move.product_id.id]):
message = _("Product '%s' is consumed with '%s' quantity.") %(name, new_move.product_qty)
self.log(cr, uid, new_move.id, message)
- self.action_done(cr, uid, res)
+ self.action_done(cr, uid, res, context=context)
return res
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index b489b8dd16e..730dc60b51f 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -116,7 +116,7 @@
-
+
diff --git a/addons/stock/wizard/stock_partial_picking.py b/addons/stock/wizard/stock_partial_picking.py
index f666bf1e367..60c524cef17 100644
--- a/addons/stock/wizard/stock_partial_picking.py
+++ b/addons/stock/wizard/stock_partial_picking.py
@@ -32,8 +32,8 @@ class stock_partial_picking_line(osv.TransientModel):
'quantity' : fields.float("Quantity", digits_compute=dp.get_precision('Product UoM'), required=True),
'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True, ondelete='CASCADE'),
'prodlot_id' : fields.many2one('stock.production.lot', 'Production Lot', ondelete='CASCADE'),
- 'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete='CASCADE'),
- 'location_dest_id': fields.many2one('stock.location', 'Dest. Location', required=True, ondelete='CASCADE'),
+ 'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete='CASCADE', domain = [('usage','<>','view')]),
+ 'location_dest_id': fields.many2one('stock.location', 'Dest. Location', required=True, ondelete='CASCADE',domain = [('usage','<>','view')]),
'move_id' : fields.many2one('stock.move', "Move", ondelete='CASCADE'),
'wizard_id' : fields.many2one('stock.partial.picking', string="Wizard", ondelete='CASCADE'),
'update_cost': fields.boolean('Need cost update'),
diff --git a/addons/stock/wizard/stock_partial_picking_view.xml b/addons/stock/wizard/stock_partial_picking_view.xml
index 39b993b7d7d..282f932b265 100644
--- a/addons/stock/wizard/stock_partial_picking_view.xml
+++ b/addons/stock/wizard/stock_partial_picking_view.xml
@@ -51,6 +51,8 @@
+
+
diff --git a/addons/stock_location/test/stock_location_pull_flow.yml b/addons/stock_location/test/stock_location_pull_flow.yml
index dec830b2d77..c5e134181f7 100644
--- a/addons/stock_location/test/stock_location_pull_flow.yml
+++ b/addons/stock_location/test/stock_location_pull_flow.yml
@@ -7,7 +7,6 @@
close_method: balance
code: asset_test
name: Asset For Tests
- sign: 1
-
I create a account type income.
-
@@ -15,7 +14,6 @@
close_method: unreconciled
code: income_test
name: Income For Tests
- sign: 1
-
I create a account type Expense.
-
@@ -23,7 +21,6 @@
close_method: unreconciled
code: expense_test
name: Expense For Tests
- sign: 1
-
I create a account type Receivable.
-
@@ -31,7 +28,6 @@
close_method: unreconciled
code: receivable_test
name: Receivable For Tests
- sign: 1
-
I create a account Receivable.
diff --git a/addons/survey/__openerp__.py b/addons/survey/__openerp__.py
index f522ff5a36f..07de550a4a8 100644
--- a/addons/survey/__openerp__.py
+++ b/addons/survey/__openerp__.py
@@ -48,7 +48,9 @@ Partners are also sent mails with user name and password for the invitation of t
'wizard/survey_send_invitation.xml'],
'demo_xml': ['survey_demo.xml'],
'test': [
- 'test/survey00.yml',
+ 'test/draft2open2close_survey.yml',
+ 'test/draft2open2close_request.yml',
+ 'test/survey_question_type.yml',
'test/survey_report.yml',
],
'installable': True,
diff --git a/addons/survey/survey_demo.xml b/addons/survey/survey_demo.xml
index 1d8eae17fb6..3bfac20d44b 100644
--- a/addons/survey/survey_demo.xml
+++ b/addons/survey/survey_demo.xml
@@ -6,6 +6,155 @@
+
+
+ Initial Partner Feedback
+
+ 20
+
+ open
+ 1
+ 1
+ 5
+
+
+
+
+ Who are you?
+
+
+
+
+
+ What is your company's name?
+
+ single_textbox
+ 1
+ 1
+
+ 1
+
+
+
+ What is your company's size?
+
+ multiple_choice_only_one_ans
+
+ 1
+
+
+
+ 1
+ 1 - 10
+
+
+
+
+ 1
+ 11 - 50
+
+
+
+
+ 1
+ 51 - 100
+
+
+
+
+ 1
+ 101 - 250
+
+
+
+
+ 1
+ 251 - 500
+
+
+
+
+ 1
+ 501 - 1000
+
+
+
+
+ 1
+ > 1000
+
+
+
+
+
+
+
+
+ Contracts
+
+
+
+
+
+ 1
+ Which maintenance contract do you sell to your customers?
+
+ multiple_choice_only_one_ans
+
+
+
+
+ 1
+ OpenERP maintenance contract
+
+
+
+
+ 1
+ Your own contract, but you buy an OpenERP one
+
+
+
+
+ 1
+ Your own contract without buying an OpenERP one
+
+
+
+
+
+ 1
+ When do you propose a maintenance contract to your customers?
+
+ multiple_choice_only_one_ans
+ text
+ Why?
+
+ True
+
+
+
+ 1
+ With each integration
+
+
+
+
+ 1
+ Sometimes
+
+
+
+
+ 1
+ Never...
+
+
+
+
+
+
+
OpenERP Partner Feedback
diff --git a/addons/survey/test/draft2open2close_request.yml b/addons/survey/test/draft2open2close_request.yml
new file mode 100644
index 00000000000..9d80952855b
--- /dev/null
+++ b/addons/survey/test/draft2open2close_request.yml
@@ -0,0 +1,50 @@
+-
+ In order to check Survey Request of the survey "Initial Partner Feedback" I create a Survey Request for survey "Initial Partner Feedback".
+-
+ !record {model: survey.request, id: survey_request_1}:
+ survey_id: survey_Initial_partner_feedback
+ user_id: base.user_demo
+-
+ !assert {model: survey.request, id: survey_request_1, string: Survey Request should be in draft state}:
+ - state == 'draft'
+-
+ I set Survey Request for the survey in waiting state.
+-
+ !python {model: survey.request}: |
+ self.survey_req_waiting_answer(cr, uid, [ref("survey_request_1")], context)
+-
+ I check that state of Survey Request for the survey is waiting or not.
+-
+ !assert {model: survey.request, id: survey_request_1, severity: error, string: Survey Request should be in waiting state}:
+ - state == 'waiting_answer'
+-
+ I cancel the Survey Request of the survey.
+-
+ !python {model: survey.request}: |
+ self.survey_req_cancel(cr, uid, [ref("survey_request_1")], context)
+-
+ I check that state of Survey Request of the survey is cancel or not.
+-
+ !assert {model: survey.request, id: survey_request_1, severity: error, string: Survey Request should be in cancel state}:
+ - state == 'cancel'
+-
+ I set Survey Request of the survey in draft state.
+-
+ !python {model: survey.request}: |
+ self.survey_req_draft(cr, uid, [ref("survey_request_1")], context)
+-
+ I check that state of Survey request of the survey is draft or not.
+-
+ !assert {model: survey.request, id: survey_request_1, severity: error, string: Survey Request should be in draft state}:
+ - state == 'draft'
+-
+ I set survey request of the survey in done state.
+-
+ !python {model: survey.request}: |
+ self.survey_req_waiting_answer(cr, uid, [ref("survey_request_1")], context)
+ self.survey_req_done(cr, uid, [ref("survey_request_1")], context)
+-
+ I check that state of Survey request of the survey is done or not.
+-
+ !assert {model: survey.request, id: survey_request_1, severity: error, string: Survey Request should be in done state}:
+ - state == 'done'
diff --git a/addons/survey/test/draft2open2close_survey.yml b/addons/survey/test/draft2open2close_survey.yml
new file mode 100644
index 00000000000..926810c1429
--- /dev/null
+++ b/addons/survey/test/draft2open2close_survey.yml
@@ -0,0 +1,111 @@
+-
+ In order to check the survey module in OpenERP I use the survey "Initial Partner Feedback".
+-
+ I set the survey in Open state.
+-
+ !python {model: survey}: |
+ sur = self.survey_open(cr, uid, [ref("survey_Initial_partner_feedback")], context)
+-
+ I check state of survey is open or not.
+-
+ !assert {model: survey, id: survey_Initial_partner_feedback, severity: error, string: Survey should be in open state}:
+ - state == 'open'
+-
+ I check that the survey is reopened or not.
+-
+ !python {model: survey}: |
+ self.survey_cancel(cr, uid, [ref('survey_Initial_partner_feedback')],context)
+ self.survey_open(cr, uid, [ref('survey_Initial_partner_feedback')],context)
+-
+ I check that state of survey is open or not.
+-
+ !assert {model: survey, id: survey_Initial_partner_feedback, severity: error, string: Survey should be in open state}:
+ - state == 'open'
+-
+ I set the state of the survey open.
+-
+ !python {model: survey}: |
+ sur = self.survey_open(cr, uid, [ref("survey_Initial_partner_feedback")], context)
+-
+ In order to print the survey I click on Print.
+-
+ !python {model: survey.print}: |
+ id = self.create(cr, uid, {'survey_ids': [(6,0,[ref('survey.survey_Initial_partner_feedback')])]})
+ self.action_next(cr, uid, [id], context)
+-
+ In order to answer the survey I click on "Answer a Survey" wizard.
+-
+ !python {model: survey.name.wiz}: |
+ id = self.create(cr, uid, {'survey_id': ref("survey_Initial_partner_feedback")})
+ self.action_next(cr, uid, [id], context)
+-
+ I give the answer of the first and second page of the survey.
+-
+ !python {model: survey.question.wiz}: |
+ ctx = {'active_model':'survey', 'active_id': ref('survey_Initial_partner_feedback'), 'active_ids': [ref('survey_Initial_partner_feedback')]}
+ self.fields_view_get(cr, uid, ref("survey.view_survey_question_message"),"form", context=ctx)
+ values = self.default_get(cr, uid, ['name'], ctx)
+ id = self.create(cr, uid, {str(ref("survey_initial_question_company_name")) +"_single" :'Tiny' , str(ref("survey_initial_question_company_size")) + "_selection" : int(ref("survey.survey_initial_question_company_size_51")), }, context)
+ self.action_next(cr, uid, [id], context)
+ id = self.create(cr, uid, {str(ref("survey_initial_question_contract_customers")) + "_selection" : int(ref("survey_initial_answer_sometimes")), str(ref("survey_initial_question_sell_to_your_customers")) + "_selection" : int(ref("survey_initial_answer_maintenance_contract")), }, context)
+ self.action_next(cr, uid, [id], context)
+-
+ I print the answers of the survey.
+-
+ !python {model: survey.browse.answer}: |
+ id = self.create(cr, uid, {'survey_id': ref('survey.survey_Initial_partner_feedback')})
+ self.action_next(cr, uid, [id], context)
+-
+ I edit questions of the survey as per requirement.
+-
+ !python {model: survey.question.wiz}: |
+ name_wiz_obj = self.pool.get('survey.name.wiz')
+ id = name_wiz_obj.create(cr, uid, {'survey_id': ref("survey_Initial_partner_feedback")})
+ ctx = {'active_model':'survey', 'active_id': ref('survey_Initial_partner_feedback'), 'active_ids': [ref('survey_Initial_partner_feedback')], 'question_id': ref('survey_initial_question_company_name'), 'page_number': -1,'sur_name_id': id}
+ self.action_edit_question(cr, uid, [ref('survey_initial_question_company_name')], context = ctx)
+ self.action_delete_question(cr, uid, [ref('survey_initial_question_company_name')], context = ctx)
+ self.action_new_question(cr, uid, [], context = ctx)
+-
+ I edit Page of the survey as per requirement.
+-
+ !python {model: survey.question.wiz}: |
+ name_wiz_obj = self.pool.get('survey.name.wiz')
+ id = name_wiz_obj.create(cr, uid, {'survey_id': ref("survey_Initial_partner_feedback")})
+ ctx = {'active_model':'survey', 'active_id': ref('survey_Initial_partner_feedback'), 'active_ids': [ref('survey_Initial_partner_feedback')], 'page_id': ref('survey_initial_page_Contracts'), 'sur_name_id': id}
+ self.action_edit_page(cr, uid, [ref('survey_initial_page_Contracts')], context = ctx)
+ self.action_delete_page(cr, uid, [ref('survey_initial_page_Contracts')], context = ctx)
+ self.action_new_page(cr, uid, [], context = ctx)
+-
+ In order to send invitation to the users I click on "Send Invitation" wizard.
+-
+ !python {model: survey.send.invitation}: |
+ context = {'active_model':'survey', 'active_id': ref('survey_Initial_partner_feedback'), 'active_ids': [ref('survey_Initial_partner_feedback')]}
+ values = self.default_get(cr, uid, ['mail_from', 'mail_subject', 'send_mail_existing', 'mail_subject_existing', 'mail', 'partner_ids', 'send_mail'], context)
+ values['mail_from'] = 'Surveyor'
+ new_id = self.create(cr, uid, values)
+ self.action_send(cr, uid, [new_id], context)
+-
+ I set the value in "Total start survey" field.
+-
+ !record {model: survey, id: survey_Initial_partner_feedback}:
+ tot_start_survey: 1
+-
+ I set the survey in Cancel state.
+-
+ !python {model: survey}: |
+ self.survey_cancel(cr, uid, [ref("survey_Initial_partner_feedback")], context)
+-
+ I check state of survey is cancel or not.
+-
+ !assert {model: survey, id: survey_Initial_partner_feedback, severity: error, string: Survey should be in cancel state}:
+ - state == 'cancel'
+-
+ I set the survey in close state.
+-
+ !python {model: survey}: |
+ self.survey_close(cr, uid, [ref("survey_Initial_partner_feedback")], context)
+-
+ I check state of Survey is close or not.
+-
+ !assert {model: survey, id: survey_Initial_partner_feedback, severity: error, string: Survey should be in close state}:
+ - state == 'close'
diff --git a/addons/survey/test/survey00.yml b/addons/survey/test/survey00.yml
deleted file mode 100644
index ab34f62f65e..00000000000
--- a/addons/survey/test/survey00.yml
+++ /dev/null
@@ -1,159 +0,0 @@
-- |
- Survey Scenario:
- In order to check the survey module in OpenERP.
--
- I Create the one survey and give survey title "Partner Feedback" and define the survey pages and survey question.
--
- I Create "Partner Feedback" survey.
--
- !record {model: 'survey', id: survey_partner_0}:
- title: 'Partner Feedback'
- max_response_limit: 20
--
- I Create "Who are you?" page in "Partner Feedback" survey with title .
--
- !record {model: 'survey.page', id: survey_partner_page_0}:
- title: 'Who are you?'
- survey_id: survey_partner_0
--
- I Create "What is your company name?" question in "Who are you" survey page.
--
- !record {model: 'survey.question', id: survey_p_question_0}:
- question: 'What is your company name?'
- type: single_textbox
- sequence: 1
- page_id: survey_partner_page_0
--
- I Create "What is your company size?" question in "Who are you" survey page.
--
- !record {model: 'survey.question', id: survey_p_question_1}:
- question: 'What is your company size?'
- type: multiple_choice_only_one_ans
- sequence: 2
- is_require_answer: true
- page_id: survey_partner_page_0
--
- I Create "1-50" answer in question "What is your company size?"
--
- !record {model: 'survey.answer', id: survey_p_1_1}:
- answer: '1 - 50'
- sequence: 1
- question_id : survey_p_question_1
--
- I Create "51 - 100" answer in question "What is your company size?"
--
- !record {model: 'survey.answer', id: survey_p_1_2}:
- answer: '51 - 100'
- sequence: 2
- question_id : survey_p_question_1
--
- I Create "100 - 500" answer in question "What is your company size?"
--
- !record {model: 'survey.answer', id: survey_p_1_3}:
- answer: '100 - 500'
- sequence: 3
- question_id : survey_p_question_1
--
- I Create "500 - 1000" answer in question "What is your company size?"
--
- !record {model: 'survey.answer', id: survey_p_1_4}:
- answer: '500 - 1000'
- sequence: 4
- question_id : survey_p_question_1
--
- I Create "> 1000" answer in question "What is your company size?"
--
- !record {model: 'survey.answer', id: survey_p_1_5}:
- answer: '> 1000'
- sequence: 5
- question_id : survey_p_question_1
--
- I Create another "Contract" page in "Partner Feedback" survey.
--
- !record {model: 'survey.page', id: survey_partner_page_1}:
- title: 'Contract'
- survey_id: survey_partner_0
--
- I Create "Which maintenance contract do you sell to your customers." question in "Contract" survey page.
--
- !record {model: 'survey.question', id: survey_p_question_3}:
- question: 'Which maintenance contract do you sell to your customers.'
- type: multiple_choice_only_one_ans
- sequence: 1
- page_id: survey_partner_page_1
--
- I Create "OpenERP maintenance contract" answer in question "Which maintenance contract do you sell to your customers."
--
- !record {model: 'survey.answer', id: survey_p_3_1}:
- answer: 'OpenERP maintenance contract'
- sequence: 1
- question_id : survey_p_question_3
--
- I Create "Your own contract, but you buy an OpenERP one" answer in question "Which maintenance contract do you sell to your customers."
--
- !record {model: 'survey.answer', id: survey_p_3_2}:
- answer: 'Your own contract, but you buy an OpenERP one'
- sequence: 2
- question_id : survey_p_question_3
--
- I Create "Your own contract without buying an OpenERP one" answer in question "Which maintenance contract do you sell to your customers."
--
- !record {model: 'survey.answer', id: survey_p_3_3}:
- answer: 'Your own contract without buying an OpenERP one'
- sequence: 3
- question_id : survey_p_question_3
--
- I Create "When do you propose a maintenance contract to your customers?" question in "Contract" survey page.
--
- !record {model: 'survey.question', id: survey_p_question_4}:
- question: When do you propose a maintenance contract to your customers?
- type: multiple_choice_only_one_ans
- sequence: 2
- comment_field_type: text
- comment_label: Why?
- is_require_answer: true
- is_comment_require: true
- page_id: survey_partner_page_1
--
- I Create "With each integration" answer in question "When do you propose a maintenance contract to your customers?"
--
- !record {model: 'survey.answer', id: survey_p_4_1}:
- answer: 'With each integration'
- sequence: 1
- question_id : survey_p_question_4
--
- I Create "Sometimes" answer in question "When do you propose a maintenance contract to your customers?"
--
- !record {model: 'survey.answer', id: survey_p_4_2}:
- answer: 'Sometimes'
- sequence: 2
- question_id : survey_p_question_4
--
- I Create "Never... " answer in question "When do you propose a maintenance contract to your customers?"
--
- !record {model: 'survey.answer', id: survey_p_4_3}:
- answer: 'Never... '
- sequence: 3
- question_id : survey_p_question_4
--
- Now Survey set in open state.
--
- !python {model: survey}: |
- self.survey_open(cr, uid, [ref("survey_partner_0")], context)
--
- Give answer of the survey, Run "Answer a Survey" wizard and select the survey and press on start button then run the selected survey.
--
- !python {model: survey.name.wiz}: |
- id = self.create(cr, uid, {'survey_id': ref("survey_partner_0")})
- self.action_next(cr, uid, [id], context)
--
- Give answer of the first and second page in "Partner Feedback" survey.
--
- !python {model: survey.question.wiz}: |
- ids = self.create(cr, uid, {str(ref("survey_p_question_0")) +"_single" :'Tiny' , str(ref("survey_p_question_1")) + "_selection" :int(ref("survey_p_1_1"))}, context)
- ids = self.create(cr, uid, {str(ref("survey_p_question_3")) +"_selection" : int(ref("survey_p_3_1")), str(ref("survey_p_question_4")) +"_selection": int(ref("survey_p_4_1"))},context)
--
- Set the value in "Total start survey" field.
--
- !python {model: survey}: |
- ids = self.write(cr, uid, ref("survey_partner_0"), {'tot_start_survey' : 1}, context)
diff --git a/addons/survey/test/survey_question_type.yml b/addons/survey/test/survey_question_type.yml
new file mode 100644
index 00000000000..e03d7710ea0
--- /dev/null
+++ b/addons/survey/test/survey_question_type.yml
@@ -0,0 +1,6 @@
+-
+ I check the question type of the survey "Initial Partner Feedback".
+-
+ !python {model: survey.question}: |
+ sur_question = self.on_change_type(cr, uid, [ref("survey_Initial_partner_feedback")], 'multiple_textboxes_diff_type')
+ assert sur_question
diff --git a/addons/survey/test/survey_report.yml b/addons/survey/test/survey_report.yml
index 3b54feb2354..cf225dfcf6e 100644
--- a/addons/survey/test/survey_report.yml
+++ b/addons/survey/test/survey_report.yml
@@ -1,29 +1,26 @@
-
- Print the Survey Browse Response Report through the wizard
+ I print the Survey Browse Response Report through the wizard.
-
!python {model: survey}: |
- ctx={}
- ctx.update({'model': 'survey','active_ids': [(6,0,[ref('survey.survey_partner_feedback')])]})
+ ctx = {'model': 'survey','active_ids': [(6,0,[ref('survey_partner_feedback')])]}
data_dict = {'response_ids' : [(6,0,[ref('survey.survey_partner_feedback')])], 'page_number' : True, 'without_pagebreak': True}
from tools import test_reports
test_reports.try_report_action(cr, uid, 'action_view_survey_print_answer',wiz_data=data_dict, context=ctx, our_module='survey')
-
- Print the Survey Analysis Report through the wizard
+ I print the Survey Analysis Report through the wizard.
-
!python {model: survey}: |
- ctx={}
- ctx.update({'model': 'survey','active_ids': [(6,0,[ref('survey.survey_partner_feedback')])]})
+ ctx = {'model': 'survey','active_ids': [(6,0,[ref('survey_partner_feedback')])]}
data_dict = {'survey_ids' : [(6,0,[ref('survey.survey_partner_feedback')])]}
from tools import test_reports
test_reports.try_report_action(cr, uid, 'action_view_survey_print_statistics',wiz_data=data_dict, context=ctx, our_module='survey')
-
- Print the Survey Form Report through the wizard
+ I print the Survey Form Report through the wizard.
-
!python {model: survey}: |
- ctx={}
- ctx.update({'model': 'survey','active_ids': [(6,0,[ref('survey.survey_partner_feedback')])]})
+ ctx = {'model': 'survey','active_ids': [(6,0,[ref('survey_partner_feedback')])]}
data_dict = {'survey_ids' : [(6,0,[ref('survey.survey_partner_feedback')])], 'page_number' : True, 'without_pagebreak': True}
from tools import test_reports
test_reports.try_report_action(cr, uid, 'action_view_survey_print',wiz_data=data_dict, context=ctx, our_module='survey')
diff --git a/addons/thunderbird/plugin/openerp_plugin.xpi b/addons/thunderbird/plugin/openerp_plugin.xpi
index 367a4faa049..167e7c589a5 100644
Binary files a/addons/thunderbird/plugin/openerp_plugin.xpi and b/addons/thunderbird/plugin/openerp_plugin.xpi differ
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar
index 28b70611a25..0d4cc3a4018 100644
Binary files a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar differ
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js
index fde29df4dbe..bbfad8634d6 100644
--- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js
@@ -169,6 +169,16 @@ function searchmail()
}
+function url_for(model, id) {
+ var base = getWebServerURL(),
+ db = getDbName(),
+ login = getusername(),
+ password = getPassword();
+
+ return base + '/web/webclient/login?db='+db+'&login='+login+'&key='+password+'#model='+model+'&id='+id;
+
+}
+
var openPartnerHandler = {
onResult: function(client, context, result) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
@@ -186,15 +196,11 @@ var openPartnerHandler = {
}
if(strlSearchResult=="partner_id"){
partner_id = strlSearchResultValue;
- weburl = getWebServerURL();
if (parseInt(partner_id) > 0){
- //Encode the url and form an url to have menu in webclient
- var encoded = encodeURIComponent("/openerp/form/view?model=res.partner&id="+partner_id)
- var t = weburl + "?next=" + encoded
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
- messenger.launchExternalURL(t);
+ messenger.launchExternalURL(url_for('res.partner', partner_id));
}
else{
alert("Partner is not Available.");
@@ -298,7 +304,6 @@ var listDocumentHandler = {
var res = result.QueryInterface(Components.interfaces.nsISupportsArray);
res_id = res.QueryElementAt(1, Components.interfaces.nsISupportsPRInt32);
model = res.QueryElementAt(0, Components.interfaces.nsISupportsCString);
- weburl = getWebServerURL();
if(res_id==0)
{
alert("Document is not available.");
@@ -307,11 +312,9 @@ var listDocumentHandler = {
else
{
- var encoded = encodeURIComponent("/openerp/form/view?model=" + model +"&id=" + res_id)
- var t = weburl + "?next=" + encoded
var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
- messenger.launchExternalURL(t);
+ messenger.launchExternalURL(url_for(model, res_id));
}
},