summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorPrakash Prajapati <ppr@odoo.com>2019-07-01 09:15:55 +0000
committerYannick Tivisse <yti@odoo.com>2019-08-01 11:39:51 +0000
commit1a33056557be7b5696854d3056ea79204f36eae4 (patch)
tree9a6bc539c0f9ddbd3175477af80b7f497be0eeac /addons
parent0c808a082f30fde781d3b5fb1da405eb00409842 (diff)
[IMP] various: Clean stat buttons across all modules.
Purpose ======= Make them consistent. Make sure context is correctly set. Prevent creation when necessary. Specification ============= See https://www.odoo.com/web#id=2024467&action=333&active_id=1251&model=project.task&view_type=form&menu_id=4720 for the detailed list of all the requested improvements. TaskID: 2024467 closes odoo/odoo#34561 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/partner.py6
-rw-r--r--addons/account/views/account_move_views.xml2
-rw-r--r--addons/account/views/account_payment_view.xml2
-rw-r--r--addons/account/views/partner_view.xml23
-rw-r--r--addons/crm_iap_lead_website/models/crm_reveal_rule.py2
-rw-r--r--addons/hr_attendance/views/hr_attendance_view.xml4
-rw-r--r--addons/hr_attendance/views/hr_employee_view.xml2
-rw-r--r--addons/hr_expense/views/hr_expense_views.xml14
-rw-r--r--addons/hr_fleet/models/employee.py1
-rw-r--r--addons/hr_holidays/views/hr_leave_allocation_views.xml5
-rw-r--r--addons/hr_holidays/views/hr_views.xml3
-rw-r--r--addons/hr_maintenance/views/hr_views.xml2
-rw-r--r--addons/hr_recruitment/models/hr_recruitment.py16
-rw-r--r--addons/hr_recruitment/views/hr_recruitment_views.xml48
-rw-r--r--addons/link_tracker/models/link_tracker.py1
-rw-r--r--addons/mail/views/mail_message_views.xml16
-rw-r--r--addons/mail/views/res_partner_views.xml10
-rw-r--r--addons/maintenance/views/maintenance_views.xml8
-rw-r--r--addons/mass_mailing/models/mailing.py1
-rw-r--r--addons/mass_mailing_crm/models/mailing_mailing.py4
-rw-r--r--addons/mass_mailing_event/views/event_views.xml13
-rw-r--r--addons/mass_mailing_event_track/views/event_views.xml11
-rw-r--r--addons/mass_mailing_sale/models/mailing_mailing.py3
-rw-r--r--addons/mass_mailing_sale/views/mailing_mailing_views.xml4
-rw-r--r--addons/mrp/models/mrp_production.py2
-rw-r--r--addons/mrp/views/mrp_production_views.xml6
-rw-r--r--addons/mrp/views/mrp_workcenter_views.xml6
-rw-r--r--addons/mrp/views/product_views.xml12
-rw-r--r--addons/payment/views/res_partner_views.xml4
-rw-r--r--addons/product/views/product_views.xml2
-rw-r--r--addons/project/models/project.py3
-rw-r--r--addons/project/views/project_views.xml2
-rw-r--r--addons/purchase/views/res_partner_views.xml4
-rw-r--r--addons/purchase_stock/models/purchase.py2
-rw-r--r--addons/purchase_stock/models/stock.py1
-rw-r--r--addons/purchase_stock/views/stock_production_lot_views.xml2
-rw-r--r--addons/repair/views/repair_views.xml7
-rw-r--r--addons/resource/views/resource_views.xml2
-rw-r--r--addons/sale/models/sale.py8
-rw-r--r--addons/sale/views/res_partner_views.xml2
-rw-r--r--addons/sale/views/sale_views.xml10
-rw-r--r--addons/sale_coupon/models/sale_coupon_program.py3
-rw-r--r--addons/sale_crm/models/crm_lead.py29
-rw-r--r--addons/sale_crm/views/crm_lead_views.xml15
-rw-r--r--addons/sale_crm/views/sale_order_views.xml21
-rw-r--r--addons/sale_expense/views/hr_expense_views.xml1
-rw-r--r--addons/sale_quotation_builder/views/sale_order_template_views.xml7
-rw-r--r--addons/sale_stock/models/sale_order.py2
-rw-r--r--addons/sale_stock/models/stock.py1
-rw-r--r--addons/sale_stock/views/stock_production_lot_views.xml2
-rw-r--r--addons/sale_timesheet/models/sale_order.py1
-rw-r--r--addons/sale_timesheet/views/sale_order_views.xml30
-rw-r--r--addons/stock/models/stock_picking.py1
-rw-r--r--addons/stock/models/stock_production_lot.py2
-rw-r--r--addons/stock/models/stock_warehouse.py3
-rw-r--r--addons/stock/views/product_views.xml62
-rw-r--r--addons/stock/views/stock_location_views.xml6
-rw-r--r--addons/stock/views/stock_picking_views.xml2
-rw-r--r--addons/stock/views/stock_production_lot_views.xml4
-rw-r--r--addons/stock/views/stock_scrap_views.xml2
-rw-r--r--addons/stock_account/models/stock_inventory.py1
-rw-r--r--addons/website_sale_digital/views/website_sale_digital_view.xml4
62 files changed, 225 insertions, 250 deletions
diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py
index e47598aec29..8ec3fc77875 100644
--- a/addons/account/models/partner.py
+++ b/addons/account/models/partner.py
@@ -318,11 +318,6 @@ class ResPartner(models.Model):
for partner in self:
partner.journal_item_count = AccountMoveLine.search_count([('partner_id', '=', partner.id)])
- def _compute_contracts_count(self):
- AccountAnalyticAccount = self.env['account.analytic.account']
- for partner in self:
- partner.contracts_count = AccountAnalyticAccount.search_count([('partner_id', '=', partner.id)])
-
def get_followup_lines_domain(self, date, overdue_only=False, only_unblocked=False):
domain = [('reconciled', '=', False), ('account_id.deprecated', '=', False), ('account_id.internal_type', '=', 'receivable'), '|', ('debit', '!=', 0), ('credit', '!=', 0), ('company_id', '=', self.env.company.id)]
if only_unblocked:
@@ -394,7 +389,6 @@ class ResPartner(models.Model):
groups='account.group_account_invoice')
currency_id = fields.Many2one('res.currency', compute='_get_company_currency', readonly=True,
string="Currency", help='Utility field to express amount currency')
- contracts_count = fields.Integer(compute='_compute_contracts_count', string="Contracts Count", type='integer')
journal_item_count = fields.Integer(compute='_compute_journal_item_count', string="Journal Items", type="integer")
property_account_payable_id = fields.Many2one('account.account', company_dependent=True,
string="Account Payable", oldname="property_account_payable",
diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml
index 778718e3421..2e1ddf8c48f 100644
--- a/addons/account/views/account_move_views.xml
+++ b/addons/account/views/account_move_views.xml
@@ -490,7 +490,7 @@
icon="fa-bars"
type="object"
attrs="{'invisible': ['|', '|', ('type', '!=', 'entry'), ('id', '=', False), ('has_reconciled_entries', '=', False)]}"
- string="Reconciled entries">
+ string="Reconciled Entries">
</button>
</div>
diff --git a/addons/account/views/account_payment_view.xml b/addons/account/views/account_payment_view.xml
index 430f2316517..5752b11e2de 100644
--- a/addons/account/views/account_payment_view.xml
+++ b/addons/account/views/account_payment_view.xml
@@ -136,7 +136,7 @@
<button class="oe_stat_button" name="open_payment_matching_screen"
string="Payment Matching" type="object"
groups="account.group_account_user"
- attrs="{'invisible':[('move_reconciled','=',True)]}" icon="fa-university"/>
+ attrs="{'invisible':[('move_reconciled','=',True)]}" icon="fa-dollar"/>
<field name="has_invoices" invisible="1"/>
<field name="move_reconciled" invisible="1"/>
</div>
diff --git a/addons/account/views/partner_view.xml b/addons/account/views/partner_view.xml
index ffe487836f7..5dc317e5ed0 100644
--- a/addons/account/views/partner_view.xml
+++ b/addons/account/views/partner_view.xml
@@ -92,12 +92,6 @@
</field>
</record>
- <record id="action_open_partner_analytic_accounts" model="ir.actions.act_window">
- <field name="context">{'search_default_partner_id': [active_id], 'default_partner_id': active_id}</field>
- <field name="name">Analytic Accounts</field>
- <field name="res_model">account.analytic.account</field>
- </record>
-
<record model="ir.ui.view" id="partner_view_short_extra">
<field name="name">partner.short.view.account</field>
<field name="model">res.partner</field>
@@ -143,23 +137,6 @@
</field>
</record>
- <record model="ir.ui.view" id="partner_view_button_contracts_count">
- <field name="name">partner.view.button.contracts_count</field>
- <field name="model">res.partner</field>
- <field name="inherit_id" ref="base.view_partner_form" />
- <field name="priority" eval="14"/>
- <field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]"/>
- <field name="arch" type="xml">
- <div name="button_box" position="inside">
- <button class="oe_stat_button" type="action" name="%(account.action_open_partner_analytic_accounts)d"
- groups="account.group_account_invoice"
- icon="fa-book" title="Analytic Accounts" attrs="{'invisible': [('contracts_count', '=', 0)]}">
- <field string="Analytic Accounts" name="contracts_count" widget="statinfo"/>
- </button>
- </div>
- </field>
- </record>
-
<record id="action_account_fiscal_position_form" model="ir.actions.act_window">
<field name="name">Fiscal Positions</field>
<field name="res_model">account.fiscal.position</field>
diff --git a/addons/crm_iap_lead_website/models/crm_reveal_rule.py b/addons/crm_iap_lead_website/models/crm_reveal_rule.py
index b1d6fd23cfb..bcc4be65333 100644
--- a/addons/crm_iap_lead_website/models/crm_reveal_rule.py
+++ b/addons/crm_iap_lead_website/models/crm_reveal_rule.py
@@ -112,11 +112,13 @@ class CRMRevealRule(models.Model):
def action_get_lead_tree_view(self):
action = self.env.ref('crm.crm_lead_all_leads').read()[0]
action['domain'] = [('id', 'in', self.lead_ids.ids), ('type', '=', 'lead')]
+ action['context'] = dict(self._context, create=False)
return action
def action_get_opportunity_tree_view(self):
action = self.env.ref('crm.crm_lead_opportunities').read()[0]
action['domain'] = [('id', 'in', self.lead_ids.ids), ('type', '=', 'opportunity')]
+ action['context'] = dict(self._context, create=False)
return action
@api.model
diff --git a/addons/hr_attendance/views/hr_attendance_view.xml b/addons/hr_attendance/views/hr_attendance_view.xml
index 040f94f03fa..ca875baafeb 100644
--- a/addons/hr_attendance/views/hr_attendance_view.xml
+++ b/addons/hr_attendance/views/hr_attendance_view.xml
@@ -112,7 +112,7 @@
<field name="name">Attendances</field>
<field name="res_model">hr.attendance</field>
<field name="view_mode">tree,kanban,form</field>
- <field name="context">{"search_default_today":1}</field>
+ <field name="context">{"search_default_today":1, 'create': False}</field>
<field name="search_view_id" ref="hr_attendance_view_filter" />
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
@@ -127,7 +127,7 @@
<field name="name">Attendances</field>
<field name="res_model">hr.attendance</field>
<field name="view_mode">tree,form</field>
- <field name="context">{'search_default_employee_id': active_id, 'default_employee_id': active_id}</field>
+ <field name="context">{'search_default_employee_id': active_id, 'default_employee_id': active_id, 'create': False}</field>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder" type="html">
No attendance records to display
diff --git a/addons/hr_attendance/views/hr_employee_view.xml b/addons/hr_attendance/views/hr_employee_view.xml
index e9d134dbfbb..c13e8848b61 100644
--- a/addons/hr_attendance/views/hr_employee_view.xml
+++ b/addons/hr_attendance/views/hr_employee_view.xml
@@ -37,7 +37,7 @@
</div>
</button>
<button name="%(hr_attendance_action)d"
- class="oe_stat_button"
+ class="fa-clock-o"
icon="fa-calendar"
type="action"
context="{'search_default_employee_id': active_id, 'search_default_check_in_filter': '1'}"
diff --git a/addons/hr_expense/views/hr_expense_views.xml b/addons/hr_expense/views/hr_expense_views.xml
index 076827fa3bd..1c4cf524228 100644
--- a/addons/hr_expense/views/hr_expense_views.xml
+++ b/addons/hr_expense/views/hr_expense_views.xml
@@ -60,12 +60,11 @@
<button name="action_view_sheet" type="object" string="View Report" class="oe_highlight" attrs="{'invisible': [('sheet_id', '=', False)]}"/>
</header>
<sheet>
- <div class="oe_button_box">
+ <div class="oe_button_box" name="button_box">
<button name="action_get_attachment_view"
class="oe_stat_button"
- icon="fa-book"
- type="object"
- attrs="{'invisible': [('attachment_number', '=', 0)]}">
+ icon="fa-file-text-o"
+ type="object">
<field name="attachment_number" widget="statinfo" string="Documents" options="{'reload_on_button': true}"/>
</button>
</div>
@@ -475,12 +474,11 @@
<field name="state" widget="statusbar" statusbar_visible="draft,submit,approve,post,done"/>
</header>
<sheet>
- <div class="oe_button_box">
+ <div class="oe_button_box" name="button_box">
<button name="action_get_attachment_view"
class="oe_stat_button"
- icon="fa-book"
- type="object"
- attrs="{'invisible': [('attachment_number', '=', 0)]}">
+ icon="fa-file-text-o"
+ type="object">
<field name="attachment_number" widget="statinfo" string="Documents"/>
</button>
</div>
diff --git a/addons/hr_fleet/models/employee.py b/addons/hr_fleet/models/employee.py
index 1e80a6569f1..304a576d792 100644
--- a/addons/hr_fleet/models/employee.py
+++ b/addons/hr_fleet/models/employee.py
@@ -19,6 +19,7 @@ class Employee(models.Model):
"res_model": "fleet.vehicle",
"views": [[False, "kanban"], [False, "form"], [False, "tree"]],
"domain": [("id", "in", cars.ids)],
+ "context": dict(self._context, create=False),
"name": "History Employee Cars",
}
diff --git a/addons/hr_holidays/views/hr_leave_allocation_views.xml b/addons/hr_holidays/views/hr_leave_allocation_views.xml
index bce6851f157..c48b31c7970 100644
--- a/addons/hr_holidays/views/hr_leave_allocation_views.xml
+++ b/addons/hr_holidays/views/hr_leave_allocation_views.xml
@@ -68,12 +68,11 @@
type="action"
attrs="{'invisible': [('holiday_type', '!=', 'employee')]}"
name="%(hr_leave_action_all)d"
- context="{'search_default_employee_id': [employee_id], 'search_default_holiday_status_id': [holiday_status_id]}"
+ context="{'search_default_employee_id': [employee_id], 'search_default_holiday_status_id': [holiday_status_id], 'default_holiday_status_id': holiday_status_id}"
help="Leaves Taken/Total Allocated">
<div class="o_stat_info">
<span class="o_stat_value">
- <field name="leaves_taken" digits="[42,1]"/>/
- <field name="max_leaves" digits="[42,1]"/>
+ <field name="leaves_taken" digits="[42,1]"/>/<field name="max_leaves" digits="[42,1]"/>
</span>
<span class="o_stat_text">
Time Off
diff --git a/addons/hr_holidays/views/hr_views.xml b/addons/hr_holidays/views/hr_views.xml
index 6799345cd75..1b5d9dcd824 100644
--- a/addons/hr_holidays/views/hr_views.xml
+++ b/addons/hr_holidays/views/hr_views.xml
@@ -171,8 +171,7 @@
help="Remaining leaves">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
- <field name="allocation_used_display"/>/
- <field name="allocation_display"/>
+ <field name="allocation_used_display"/>/<field name="allocation_display"/>
</span>
<span class="o_stat_text">
Time Off
diff --git a/addons/hr_maintenance/views/hr_views.xml b/addons/hr_maintenance/views/hr_views.xml
index 516fbce5da1..eeef59184b9 100644
--- a/addons/hr_maintenance/views/hr_views.xml
+++ b/addons/hr_maintenance/views/hr_views.xml
@@ -7,7 +7,7 @@
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button name="%(maintenance.hr_equipment_action)d"
- context="{'search_default_employee_id': id}"
+ context="{'search_default_employee_id': id, 'default_employee_id': id}"
groups="maintenance.group_equipment_manager"
class="o_stat_button"
icon="fa-cubes"
diff --git a/addons/hr_recruitment/models/hr_recruitment.py b/addons/hr_recruitment/models/hr_recruitment.py
index f22147d873a..97d41598526 100644
--- a/addons/hr_recruitment/models/hr_recruitment.py
+++ b/addons/hr_recruitment/models/hr_recruitment.py
@@ -162,7 +162,7 @@ class Applicant(models.Model):
legend_done = fields.Char(related='stage_id.legend_done', string='Kanban Valid', readonly=False)
legend_normal = fields.Char(related='stage_id.legend_normal', string='Kanban Ongoing', readonly=False)
application_count = fields.Integer(compute='_compute_application_count', help='Applications with the same email')
-
+ meeting_count = fields.Integer(compute='_compute_meeting_count', help='Meeting Count')
@api.depends('date_open', 'date_closed')
def _compute_day(self):
@@ -185,6 +185,10 @@ class Applicant(models.Model):
for applicant in self.filtered(lambda applicant: applicant.email_from):
applicant.application_count = application_data_mapped.get(applicant.email_from, 1) - 1
+ def _compute_meeting_count(self):
+ for applicant in self:
+ applicant.meeting_count = self.env['calendar.event'].search_count([('applicant_id', '=', applicant.id)])
+
def _get_attachment_number(self):
read_group_res = self.env['ir.attachment'].read_group(
[('res_model', '=', 'hr.applicant'), ('res_id', 'in', self.ids)],
@@ -309,12 +313,6 @@ class Applicant(models.Model):
empty_list_help_id=self.env.context.get('default_job_id'),
empty_list_help_document_name=_("job applicant"))).get_empty_list_help(help)
- def action_get_created_employee(self):
- self.ensure_one()
- action = self.env['ir.actions.act_window'].for_xml_id('hr', 'open_view_employee_list')
- action['res_id'] = self.mapped('emp_id').ids[0]
- return action
-
def action_makeMeeting(self):
""" This opens Meeting's calendar view to schedule meeting on current applicant
@return: Dictionary value for created Meeting view
@@ -366,9 +364,7 @@ class Applicant(models.Model):
def _track_subtype(self, init_values):
record = self[0]
- if 'emp_id' in init_values and record.emp_id and record.emp_id.active:
- return self.env.ref('hr_recruitment.mt_applicant_hired')
- elif 'stage_id' in init_values and record.stage_id:
+ if 'stage_id' in init_values and record.stage_id:
return self.env.ref('hr_recruitment.mt_applicant_stage_changed')
return super(Applicant, self)._track_subtype(init_values)
diff --git a/addons/hr_recruitment/views/hr_recruitment_views.xml b/addons/hr_recruitment/views/hr_recruitment_views.xml
index 2043eda9d41..3b49ef198b7 100644
--- a/addons/hr_recruitment/views/hr_recruitment_views.xml
+++ b/addons/hr_recruitment/views/hr_recruitment_views.xml
@@ -79,29 +79,26 @@
<div class="oe_button_box" name="button_box">
<button name="action_applications_email"
class="oe_stat_button"
- icon="fa-file-o"
+ icon="fa-pencil"
type="object"
attrs="{'invisible': [('application_count', '=', 0)]}">
<field name="application_count" widget="statinfo" string="Other Applications"/>
</button>
<button name="action_makeMeeting" class="oe_stat_button" icon="fa-calendar" type="object"
help="Schedule interview with this applicant">
- <div class="o_field_widget o_stat_info">
- <span class="o_stat_text">Meetings</span>
- </div>
+ <field name="meeting_count" widget="statinfo" string="Meetings"/>
</button>
<button name="action_get_attachment_tree_view"
class="oe_stat_button"
- icon="fa-book"
+ icon="fa-file-text-o"
type="object">
<field name="attachment_number" widget="statinfo" string="Documents"/>
</button>
- <button name="action_get_created_employee"
- class="oe_stat_button"
- icon="fa-user"
- type="object"
- attrs="{'invisible': [('emp_id', '=', False)]}">
- <field name="employee_name" widget="statinfo" string="Employee"/>
+ <button name="toggle_active" type="object"
+ class="oe_stat_button" icon="fa-archive"
+ attrs="{'invisible': [('active', '=', True)]}">
+ <field name="active" widget="boolean_button"
+ options='{"terminology": "archive"}'/>
</button>
</div>
<field name="kanban_state" widget="kanban_state_selection"/>
@@ -423,23 +420,6 @@
</field>
</record>
- <!-- Action for the stat button of the no_employee -->
- <record model="ir.actions.act_window" id="action_hr_job_no_employee">
- <field name="name">Employees</field>
- <field name="res_model">hr.employee</field>
- <field name="view_mode">kanban,tree,form</field>
- <field name="context">{'search_default_job_id': active_id}</field>
- <field name="help" type="html">
- <p class="o_view_nocontent_smiling_face">
- Add a new employee
- </p><p>
- With just a quick glance on the Odoo employee screen, you
- can easily find all the information you need for each person;
- contact data, job position, availability, etc.
- </p>
- </field>
- </record>
-
<record id="hr_job_simple_form" model="ir.ui.view">
<field name="name">hr.job.simple.form</field>
<field name="model">hr.job</field>
@@ -493,26 +473,20 @@
</xpath>
<div name="button_box" position="inside">
<button class="oe_stat_button"
- icon="fa-file-o"
+ icon="fa-pencil"
name="%(action_hr_job_applications)d"
context="{'default_user_id': user_id}"
type="action">
<field name="application_count" widget="statinfo" string="Applications"/>
</button>
<button class="oe_stat_button"
- icon="fa-users"
- name="%(action_hr_job_no_employee)d"
- type="action">
- <field name="no_of_employee" widget="statinfo" string="Employees"/>
- </button>
- <button class="oe_stat_button"
- icon="fa-paperclip"
+ icon="fa-file-text-o"
name="action_get_attachment_tree_view"
type="object">
<field name="documents_count" widget="statinfo" string="Documents"/>
</button>
<button class="oe_stat_button" type="action"
- name="%(action_hr_job_sources)d" icon="fa-share"
+ name="%(action_hr_job_sources)d" icon="fa-bar-chart-o"
context="{'default_job_id': active_id}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Trackers</span>
diff --git a/addons/link_tracker/models/link_tracker.py b/addons/link_tracker/models/link_tracker.py
index 32d4bfb487a..4adb4ce5b3a 100644
--- a/addons/link_tracker/models/link_tracker.py
+++ b/addons/link_tracker/models/link_tracker.py
@@ -167,6 +167,7 @@ class LinkTracker(models.Model):
def action_view_statistics(self):
action = self.env['ir.actions.act_window'].for_xml_id('link_tracker', 'link_tracker_click_action_statistics')
action['domain'] = [('link_id', '=', self.id)]
+ action['context'] = dict(self._context, create=False)
return action
def action_visit_page(self):
diff --git a/addons/mail/views/mail_message_views.xml b/addons/mail/views/mail_message_views.xml
index 14c48dc4738..6839b357611 100644
--- a/addons/mail/views/mail_message_views.xml
+++ b/addons/mail/views/mail_message_views.xml
@@ -134,7 +134,7 @@
<field name="name">ir.attachment kanban</field>
<field name="model">ir.attachment</field>
<field name="arch" type="xml">
- <kanban>
+ <kanban edit="false" import="false">
<field name="id"/>
<field name="mimetype"/>
<field name="type"/>
@@ -146,7 +146,19 @@
<field name="res_name"/>
<templates>
<t t-name="kanban-box">
- <div class="oe_kanban_global_area o_kanban_attachment oe_kanban_global_click">
+ <div class="oe_kanban_global_area o_kanban_attachment">
+ <div class="row">
+ <div class="offset-10">
+ <div class="o_dropdown_kanban dropdown" groups="base.group_user">
+ <a role="button" class="dropdown-toggle o-no-caret btn" data-toggle="dropdown" href="#" aria-label="Dropdown menu" title="Dropdown menu">
+ <span class="fa fa-ellipsis-v"/>
+ </a>
+ <div class="dropdown-menu" role="menu">
+ <a t-if="widget.deletable" role="menuitem" type="delete" class="dropdown-item">Delete</a>
+ </div>
+ </div>
+ </div>
+ </div>
<div class="o_kanban_image">
<div class="o_kanban_image_wrapper">
<t t-set="webimage" t-value="new RegExp('image.*(gif|jpeg|jpg|png)').test(record.mimetype.value)"/>
diff --git a/addons/mail/views/res_partner_views.xml b/addons/mail/views/res_partner_views.xml
index f7308674470..a620c261b44 100644
--- a/addons/mail/views/res_partner_views.xml
+++ b/addons/mail/views/res_partner_views.xml
@@ -16,16 +16,6 @@
<field name="email" widget="email"/>
</div>
</xpath>
- <div name="button_box" position="inside">
- <button class="oe_stat_button" icon="fa-envelope" groups="base.group_no_one" attrs="{'invisible':[('message_bounce', '=', 0)]}">
- <div class="o_form_field o_stat_info">
- <span class="o_stat_value">
- <field name="message_bounce" widget="statinfo" nolabel="1"/>
- </span>
- <span class="o_stat_text">Bounce(s)</span>
- </div>
- </button>
- </div>
<xpath expr="//sheet" position="after">
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
diff --git a/addons/maintenance/views/maintenance_views.xml b/addons/maintenance/views/maintenance_views.xml
index 204a50adc56..400607c118a 100644
--- a/addons/maintenance/views/maintenance_views.xml
+++ b/addons/maintenance/views/maintenance_views.xml
@@ -338,7 +338,7 @@
<button name="%(hr_equipment_request_action_from_equipment)d"
type="action"
class="oe_stat_button"
- icon="fa-ticket">
+ icon="fa-wrench">
<field string="Maintenance" name="maintenance_count" widget="statinfo"/>
</button>
</div>
@@ -583,14 +583,14 @@
<div class="oe_button_box" name="button_box">
<button name="%(hr_equipment_action_from_category_form)d"
class="oe_stat_button"
- icon="fa-laptop"
+ icon="fa-cubes"
type="action">
- <field string="Equipments" name="equipment_count" widget="statinfo"/>
+ <field string="Equipment" name="equipment_count" widget="statinfo"/>
</button>
<button name="%(hr_equipment_request_action_link)d"
type="action"
class="oe_stat_button"
- icon="fa-ticket">
+ icon="fa-wrench">
<field string="Maintenance" name="maintenance_count" widget="statinfo"/>
</button>
</div>
diff --git a/addons/mass_mailing/models/mailing.py b/addons/mass_mailing/models/mailing.py
index ec8731dd2de..919890d4e0c 100644
--- a/addons/mass_mailing/models/mailing.py
+++ b/addons/mass_mailing/models/mailing.py
@@ -482,6 +482,7 @@ class MassMailing(models.Model):
'view_mode': 'tree',
'res_model': self.mailing_model_real,
'domain': [('id', 'in', res_ids)],
+ 'context': dict(self._context, create=False)
}
def update_opt_out(self, email, list_ids, value):
diff --git a/addons/mass_mailing_crm/models/mailing_mailing.py b/addons/mass_mailing_crm/models/mailing_mailing.py
index a740a79968c..e4c23086bb4 100644
--- a/addons/mass_mailing_crm/models/mailing_mailing.py
+++ b/addons/mass_mailing_crm/models/mailing_mailing.py
@@ -34,14 +34,14 @@ class MassMailing(models.Model):
def action_redirect_to_leads(self):
action = self.env.ref('crm.crm_lead_all_leads').read()[0]
action['domain'] = self._get_crm_utm_domain()
- action['context'] = {'default_type': 'lead', 'active_test': False}
+ action['context'] = {'default_type': 'lead', 'active_test': False, 'create': False}
return action
def action_redirect_to_opportunities(self):
action = self.env.ref('crm.crm_lead_opportunities').read()[0]
action['view_mode'] = 'tree,kanban,graph,pivot,form,calendar'
action['domain'] = self._get_crm_utm_domain()
- action['context'] = {'active_test': False}
+ action['context'] = {'active_test': False, 'create': False}
return action
def _get_crm_utm_domain(self):
diff --git a/addons/mass_mailing_event/views/event_views.xml b/addons/mass_mailing_event/views/event_views.xml
index 480c0dddf21..b056ed18577 100644
--- a/addons/mass_mailing_event/views/event_views.xml
+++ b/addons/mass_mailing_event/views/event_views.xml
@@ -5,16 +5,9 @@
<field name="model">event.event</field>
<field name="inherit_id" ref="event.view_event_form"/>
<field name="arch" type="xml">
- <button name="%(event.act_event_registration_from_event)d" position="after">
- <button class="oe_stat_button" type="object"
- name="action_mass_mailing_attendees"
- icon="fa-envelope-o"
- attrs="{'invisible': [('seats_expected', '=', 0)]}">
- <div class="o_field_widget o_stat_info">
- <span class="o_stat_text">Mail Attendees</span>
- </div>
- </button>
- </button>
+ <xpath expr="//button[@name='button_cancel']" position="after">
+ <button name="action_mass_mailing_attendees" string="Mail Attendees" type="object" attrs="{'invisible': [('seats_expected', '=', 0)]}"/>
+ </xpath>
</field>
</record>
</odoo>
diff --git a/addons/mass_mailing_event_track/views/event_views.xml b/addons/mass_mailing_event_track/views/event_views.xml
index 6e3e60fc781..d82be2f9f0a 100644
--- a/addons/mass_mailing_event_track/views/event_views.xml
+++ b/addons/mass_mailing_event_track/views/event_views.xml
@@ -5,14 +5,9 @@
<field name="model">event.event</field>
<field name="inherit_id" ref="website_event_track.view_event_form"/>
<field name="arch" type="xml">
- <button name="%(website_event_track.action_event_track_from_event)d" position="after">
- <button class="oe_stat_button" type="object"
- name="action_mass_mailing_track_speakers"
- string="Mail Track Speakers"
- icon="fa-envelope-o"
- attrs="{'invisible': [('track_count', '=', 0)]}">
- </button>
- </button>
+ <xpath expr="//button[@name='button_cancel']" position="after">
+ <button name="action_mass_mailing_track_speakers" string="Mail Track Speakers" type="object" attrs="{'invisible': [('track_count', '=', 0)]}"/>
+ </xpath>
</field>
</record>
</odoo>
diff --git a/addons/mass_mailing_sale/models/mailing_mailing.py b/addons/mass_mailing_sale/models/mailing_mailing.py
index 559cca1a760..2a347a3694a 100644
--- a/addons/mass_mailing_sale/models/mailing_mailing.py
+++ b/addons/mass_mailing_sale/models/mailing_mailing.py
@@ -36,7 +36,7 @@ class MassMailing(models.Model):
def action_redirect_to_quotations(self):
action = self.env.ref('sale.action_quotations_with_onboarding').read()[0]
action['domain'] = self._get_sale_utm_domain()
- action['context'] = {'default_type': 'lead'}
+ action['context'] = {'default_type': 'lead', 'create': False}
return action
def action_redirect_to_invoiced(self):
@@ -48,6 +48,7 @@ class MassMailing(models.Model):
('type', '=', 'posted'),
('partner_id', 'child_of', self.id),
]
+ action['context'] = {'create': False}
return action
def _get_sale_utm_domain(self):
diff --git a/addons/mass_mailing_sale/views/mailing_mailing_views.xml b/addons/mass_mailing_sale/views/mailing_mailing_views.xml
index 3486adbf1b2..38d5baf8926 100644
--- a/addons/mass_mailing_sale/views/mailing_mailing_views.xml
+++ b/addons/mass_mailing_sale/views/mailing_mailing_views.xml
@@ -8,7 +8,7 @@
<xpath expr="//button[hasclass('o_mass_mailing_button')]" position="before">
<button name="action_redirect_to_quotations"
type="object"
- icon="fa-usd"
+ icon="fa-pencil"
class="oe_stat_button"
groups="sales_team.group_sale_salesman"
attrs="{'invisible': [('state', '=', 'draft')]}">
@@ -16,7 +16,7 @@
</button>
<button name="action_redirect_to_invoiced"
type="object"
- icon="fa-money"
+ icon="fa-dollar"
class="oe_stat_button"
groups="sales_team.group_sale_salesman"
attrs="{'invisible': [('state', '=', 'draft')]}" >
diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py
index 90783f311d1..0bee6fc9137 100644
--- a/addons/mrp/models/mrp_production.py
+++ b/addons/mrp/models/mrp_production.py
@@ -246,6 +246,7 @@ class MrpProduction(models.Model):
elif pickings:
action['views'] = [(self.env.ref('stock.view_picking_form').id, 'form')]
action['res_id'] = pickings.id
+ action['context'] = dict(self._context, default_origin=self.name, create=False)
return action
@api.depends('product_uom_id', 'product_qty', 'product_id.uom_id')
@@ -916,6 +917,7 @@ class MrpProduction(models.Model):
self.ensure_one()
action = self.env.ref('stock.action_stock_scrap').read()[0]
action['domain'] = [('production_id', '=', self.id)]
+ action['context'] = dict(self._context, default_origin=self.name)
return action
@api.model
diff --git a/addons/mrp/views/mrp_production_views.xml b/addons/mrp/views/mrp_production_views.xml
index c7858c2f2ba..93b84457fc8 100644
--- a/addons/mrp/views/mrp_production_views.xml
+++ b/addons/mrp/views/mrp_production_views.xml
@@ -66,7 +66,7 @@
<field name="post_visible" invisible="1"/>
<field name="unreserve_visible" invisible="1"/>
<div class="oe_button_box" name="button_box">
- <button name="%(stock.action_stock_report)d" icon="fa-arrow-up" class="oe_stat_button" string="Traceability Report" type="action" states="done" groups="stock.group_production_lot"/>
+ <button name="%(stock.action_stock_report)d" icon="fa-arrow-up" class="oe_stat_button" string="Traceability" type="action" states="done" groups="stock.group_production_lot"/>
<button name="%(action_mrp_workorder_production_specific)d" type="action" attrs="{'invisible': [('workorder_count', '=', 0)]}" class="oe_stat_button" icon="fa-play-circle-o">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="workorder_done_count" widget="statinfo" nolabel="1"/> / <field name="workorder_count" widget="statinfo" nolabel="1"/></span>
@@ -74,8 +74,8 @@
</div>
</button>
<button name="%(action_mrp_production_moves)d" type="action" string="Product Moves" class="oe_stat_button" icon="fa-exchange" attrs="{'invisible': [('state', 'not in', ('progress', 'done'))]}"/>
- <button type="object" name="action_view_mo_delivery" class="oe_stat_button" icon="fa-truck" attrs="{'invisible': [('delivery_count', '=', 0)]}" groups="base.group_user">
- <field name="delivery_count" widget="statinfo" string="Picking"/>
+ <button type="object" name="action_view_mo_delivery" class="oe_stat_button" icon="fa-truck" groups="base.group_user">
+ <field name="delivery_count" widget="statinfo" string="Pickings"/>
</button>
<button class="oe_stat_button" name="action_see_move_scrap" type="object" icon="fa-arrows-v" attrs="{'invisible': [('scrap_count', '=', 0)]}">
<div class="o_field_widget o_stat_info">
diff --git a/addons/mrp/views/mrp_workcenter_views.xml b/addons/mrp/views/mrp_workcenter_views.xml
index 58b5f93176d..024ed07bb9f 100644
--- a/addons/mrp/views/mrp_workcenter_views.xml
+++ b/addons/mrp/views/mrp_workcenter_views.xml
@@ -300,14 +300,14 @@
</button>
<button name="%(mrp_workcenter_productivity_report_blocked)d" type="action" class="oe_stat_button" icon="fa-bar-chart">
<div class="o_field_widget o_stat_info">
- <span class="o_stat_value"><field name="blocked_time" widget="statinfo" nolabel="1"/> hours</span>
+ <span class="o_stat_value"><field name="blocked_time" widget="statinfo" nolabel="1"/> Hours</span>
<span class="o_stat_text">Lost</span>
</div>
</button>
<button name="%(action_mrp_workcenter_load_report_graph)d" type="action" class="oe_stat_button" icon="fa-bar-chart" context="{'search_default_workcenter_id': active_id}">
<div class="o_field_widget o_stat_info">
- <span class="o_stat_value"><field name="workcenter_load" widget="statinfo" nolabel="1"/> minutes</span>
- <span class="o_stat_text">Work Center Load</span>
+ <span class="o_stat_value"><field name="workcenter_load" widget="statinfo" nolabel="1"/> Minutes</span>
+ <span class="o_stat_text">Load</span>
</div>
</button>
<button name="%(mrp_workorder_report)d" type="action" class="oe_stat_button" icon="fa-bar-chart" context="{'search_default_workcenter_id': active_id, 'search_default_thisyear': True}">
diff --git a/addons/mrp/views/product_views.xml b/addons/mrp/views/product_views.xml
index a32370b40c5..51f542f50a0 100644
--- a/addons/mrp/views/product_views.xml
+++ b/addons/mrp/views/product_views.xml
@@ -75,7 +75,7 @@
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="groups_id" eval="[(4, ref('mrp.group_mrp_user'))]"/>
<field name="arch" type="xml">
- <div name="button_box" position="inside">
+ <xpath expr="//button[@name='action_open_product_lot']" position="after">
<button class="oe_stat_button" name="%(template_open_bom)d" type="action"
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}" icon="fa-flask">
<field string="Bill of Materials" name="bom_count" widget="statinfo" />
@@ -85,7 +85,7 @@
<field string="Used In" name="used_in_bom_count" widget="statinfo" />
</button>
<button class="oe_stat_button" name="action_view_mos" type="object"
- attrs="{'invisible': ['|', ('type', 'not in', ['product', 'consu']), ('bom_count', '=', 0)]}" icon="fa-list-alt" help="Manufactured in the last 365 days">
+ attrs="{'invisible': ['|', '|', ('type', 'not in', ['product', 'consu']), ('bom_count', '=', 0), ('mrp_product_qty', '=', 0)]}" icon="fa-list-alt" help="Manufactured in the last 365 days">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="mrp_product_qty" widget="statinfo" nolabel="1" class="mr4"/>
@@ -94,7 +94,7 @@
<span class="o_stat_text">Manufactured</span>
</div>
</button>
- </div>
+ </xpath>
</field>
</record>
@@ -104,7 +104,7 @@
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="groups_id" eval="[(4, ref('mrp.group_mrp_user'))]"/>
<field name="arch" type="xml">
- <div name="button_box" position="inside">
+ <xpath expr="//button[@name='action_open_product_lot']" position="after">
<button class="oe_stat_button" name="action_view_bom" type="object"
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}" icon="fa-flask">
<field string="Bill of Materials" name="bom_count" widget="statinfo" />
@@ -114,7 +114,7 @@
<field string="Used In" name="used_in_bom_count" widget="statinfo" />
</button>
<button class="oe_stat_button" name="action_view_mos" type="object"
- attrs="{'invisible': ['|', ('type', 'not in', ['product', 'consu']), ('bom_count', '=', 0)]}" icon="fa-list-alt" help="Manufactured in the last 365 days">
+ attrs="{'invisible': ['|', '|', ('type', 'not in', ['product', 'consu']), ('bom_count', '=', 0), ('mrp_product_qty', '=', 0)]}" icon="fa-list-alt" help="Manufactured in the last 365 days">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="mrp_product_qty" widget="statinfo" nolabel="1" class="mr4"/>
@@ -123,7 +123,7 @@
<span class="o_stat_text">Manufactured</span>
</div>
</button>
- </div>
+ </xpath>
</field>
</record>
</data>
diff --git a/addons/payment/views/res_partner_views.xml b/addons/payment/views/res_partner_views.xml
index bd936c8340d..7657ad09cea 100644
--- a/addons/payment/views/res_partner_views.xml
+++ b/addons/payment/views/res_partner_views.xml
@@ -13,13 +13,13 @@
<button type="action" class="oe_stat_button"
icon="fa-credit-card"
name="%(payment.payment_token_action)d"
- context="{'search_default_partner_id': active_id}"
+ context="{'search_default_partner_id': active_id, 'create': False, 'edit': False}"
attrs="{'invisible': [('payment_token_count', '=', 0)]}">
<div class="o_form_field o_stat_info">
<span class="o_stat_value">
<field name="payment_token_count" widget="statinfo" nolabel="1"/>
</span>
- <span class="o_stat_text">Credit card(s)</span>
+ <span class="o_stat_text">Credit Cards</span>
</div>
</button>
</div>
diff --git a/addons/product/views/product_views.xml b/addons/product/views/product_views.xml
index 5a134ceb6c2..b495635b7cd 100644
--- a/addons/product/views/product_views.xml
+++ b/addons/product/views/product_views.xml
@@ -511,7 +511,7 @@
name="%(product_template_action_all)d"
icon="fa-th-list"
type="action"
- context="{'search_default_categ_id': active_id}">
+ context="{'search_default_categ_id': active_id, 'default_categ_id': active_id}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="product_count"/></span>
<span class="o_stat_text"> Products</span>
diff --git a/addons/project/models/project.py b/addons/project/models/project.py
index e5e67c382bd..4d5918075ab 100644
--- a/addons/project/models/project.py
+++ b/addons/project/models/project.py
@@ -910,7 +910,8 @@ class Task(models.Model):
'view_mode': 'form',
'res_model': 'project.task',
'res_id': self.parent_id.id,
- 'type': 'ir.actions.act_window'
+ 'type': 'ir.actions.act_window',
+ 'context': dict(self._context, create=False)
}
def action_subtask(self):
diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml
index f9d2d7e2529..6bdc873c97c 100644
--- a/addons/project/views/project_views.xml
+++ b/addons/project/views/project_views.xml
@@ -97,7 +97,7 @@
<sheet string="Project">
<widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<div class="oe_button_box" name="button_box" groups="base.group_user">
- <button class="oe_stat_button" name="attachment_tree_view" type="object" icon="fa-files-o">
+ <button class="oe_stat_button" name="attachment_tree_view" type="object" icon="fa-file-text-o">
<field string="Documents" name="doc_count" widget="statinfo"/>
</button>
<button class="oe_stat_button" type="action"
diff --git a/addons/purchase/views/res_partner_views.xml b/addons/purchase/views/res_partner_views.xml
index 58acf001c03..1415c783e71 100644
--- a/addons/purchase/views/res_partner_views.xml
+++ b/addons/purchase/views/res_partner_views.xml
@@ -17,7 +17,7 @@
<field name="name">RFQs and Purchases</field>
<field name="res_model">purchase.order</field>
<field name="view_mode">tree,form,graph</field>
- <field name="context">{'search_default_partner_id': active_id}</field>
+ <field name="context">{'search_default_partner_id': active_id, 'default_partner_id': active_id}</field>
<field name="groups_id" eval="[(4, ref('purchase.group_purchase_user'))]"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
@@ -51,7 +51,7 @@
<field name="res_model">account.move</field>
<field name="view_mode">tree,form,graph</field>
<field name="domain">[('type','in',('in_invoice', 'in_refund'))]</field>
- <field name="context">{'search_default_partner_id': active_id, 'default_type': 'in_invoice'}</field>
+ <field name="context">{'search_default_partner_id': active_id, 'default_type': 'in_invoice', 'default_partner_id': active_id}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Record a new vendor bill
diff --git a/addons/purchase_stock/models/purchase.py b/addons/purchase_stock/models/purchase.py
index 16f5fdbe121..7837c3984d7 100644
--- a/addons/purchase_stock/models/purchase.py
+++ b/addons/purchase_stock/models/purchase.py
@@ -117,7 +117,7 @@ class PurchaseOrder(models.Model):
action = self.env.ref('stock.action_picking_tree_all')
result = action.read()[0]
# override the context to get rid of the default filtering on operation type
- result['context'] = {}
+ result['context'] = {'default_partner_id': self.partner_id.id, 'default_origin': self.name, 'default_picking_type_id': self.picking_type_id.id}
pick_ids = self.mapped('picking_ids')
# choose the view_mode accordingly
if not pick_ids or len(pick_ids) > 1:
diff --git a/addons/purchase_stock/models/stock.py b/addons/purchase_stock/models/stock.py
index 5622b784604..b54abba7fd2 100644
--- a/addons/purchase_stock/models/stock.py
+++ b/addons/purchase_stock/models/stock.py
@@ -205,4 +205,5 @@ class ProductionLot(models.Model):
self.ensure_one()
action = self.env.ref('purchase.purchase_form_action').read()[0]
action['domain'] = [('id', 'in', self.mapped('purchase_order_ids.id'))]
+ action['context'] = dict(self._context, create=False)
return action
diff --git a/addons/purchase_stock/views/stock_production_lot_views.xml b/addons/purchase_stock/views/stock_production_lot_views.xml
index 2ef9179af37..152117560d8 100644
--- a/addons/purchase_stock/views/stock_production_lot_views.xml
+++ b/addons/purchase_stock/views/stock_production_lot_views.xml
@@ -13,7 +13,7 @@
<span class="o_stat_value">
<field name="purchase_order_count" widget="statinfo" nolabel="1" class="mr4"/>
</span>
- <span class="o_stat_text">Purchase Orders</span>
+ <span class="o_stat_text">Purchases</span>
</div>
</button>
</xpath>
diff --git a/addons/repair/views/repair_views.xml b/addons/repair/views/repair_views.xml
index cecd336973a..c076f19a463 100644
--- a/addons/repair/views/repair_views.xml
+++ b/addons/repair/views/repair_views.xml
@@ -44,8 +44,13 @@
<button name="action_created_invoice"
type="object"
class="oe_stat_button"
- icon="fa-pencil-square-o" string="Invoice" attrs="{'invisible': ['|',('invoice_method','=','none'), ('state','in',('confirmed','2binvoiced','draft'))]}"
+ icon="fa-pencil-square-o"
+ attrs="{'invisible': ['|',('invoice_method','=','none'), ('state','in',('confirmed','2binvoiced','draft'))]}"
groups="account.group_account_invoice">
+ <div class="o_field_widget o_stat_info">
+ <span class="o_stat_text">1</span>
+ <span class="o_stat_text">Invoices</span>
+ </div>
</button>
</div>
<label for="name"/>
diff --git a/addons/resource/views/resource_views.xml b/addons/resource/views/resource_views.xml
index 2a709e95163..039f1a7548f 100644
--- a/addons/resource/views/resource_views.xml
+++ b/addons/resource/views/resource_views.xml
@@ -247,7 +247,7 @@
<sheet string="Working Time">
<div class="oe_button_box" name="button_box">
<button name="%(resource_calendar_leaves_action_from_calendar)d" type="action"
- string="Time Off" icon="fa-calendar-times-o"
+ string="Time Off" icon="fa-plane"
class="oe_stat_button"
groups="base.group_no_one"/>
<button name="%(resource_resource_action_from_calendar)d" type="action"
diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py
index 70c9c036092..17e0d632cba 100644
--- a/addons/sale/models/sale.py
+++ b/addons/sale/models/sale.py
@@ -494,6 +494,14 @@ class SaleOrder(models.Model):
action['res_id'] = invoices.id
else:
action = {'type': 'ir.actions.act_window_close'}
+ action['context'] = {
+ 'default_type': 'out_invoice',
+ 'default_partner_id': self.partner_id.id,
+ 'default_partner_shipping_id': self.partner_shipping_id.id,
+ 'default_invoice_payment_term_id': self.payment_term_id.id,
+ 'default_invoice_origin': self.name,
+ 'default_user_id': self.user_id.id,
+ }
return action
def _create_invoices(self, grouped=False, final=False):
diff --git a/addons/sale/views/res_partner_views.xml b/addons/sale/views/res_partner_views.xml
index f7dd6257c69..b96265e62fa 100644
--- a/addons/sale/views/res_partner_views.xml
+++ b/addons/sale/views/res_partner_views.xml
@@ -4,7 +4,7 @@
<field name="name">Quotations and Sales</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form,graph</field>
- <field name="context">{'search_default_partner_id': active_id}</field>
+ <field name="context">{'search_default_partner_id': active_id, 'default_partner_id': active_id}</field>
<field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
diff --git a/addons/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml
index 3d2857b78e4..416daf68bce 100644
--- a/addons/sale/views/sale_views.xml
+++ b/addons/sale/views/sale_views.xml
@@ -259,7 +259,6 @@
<button name="action_confirm"
string="Confirm" type="object"
attrs="{'invisible': [('state', 'not in', ['draft'])]}"/>
- <button name="preview_sale_order" type="object" string="Preview"/>
<button name="action_quotation_send" type="object" string="Send PRO-FORMA Invoice" groups="sale.group_proforma_sales" attrs="{'invisible': ['|', ('state', '=', 'draft'), ('invoice_count','&gt;=',1)]}" context="{'proforma': True}"/>
<button name="print_quotation" string="Print" type="object" states="sent,sale" class="o_sale_print"/>
<button name="action_quotation_send" string="Send by Email" type="object" states="sent,sale"/>
@@ -272,6 +271,15 @@
</header>
<sheet>
<div class="oe_button_box" name="button_box">
+ <button name="preview_sale_order"
+ type="object"
+ class="oe_stat_button"
+ icon="fa-globe icon">
+ <div class="o_field_widget o_stat_info">
+ <span class="o_stat_text">Customer</span>
+ <span class="o_stat_text">Preview</span>
+ </div>
+ </button>
<button name="action_view_invoice"
type="object"
class="oe_stat_button"
diff --git a/addons/sale_coupon/models/sale_coupon_program.py b/addons/sale_coupon/models/sale_coupon_program.py
index f306954073b..8ce426ee98c 100644
--- a/addons/sale_coupon/models/sale_coupon_program.py
+++ b/addons/sale_coupon/models/sale_coupon_program.py
@@ -136,7 +136,8 @@ class SaleCouponProgram(models.Model):
'view_mode': 'tree,form',
'res_model': 'sale.order',
'type': 'ir.actions.act_window',
- 'domain': [('id', 'in', orders.ids)]
+ 'domain': [('id', 'in', orders.ids), ('state', 'not in', ('draft', 'sent', 'cancel'))],
+ 'context': dict(self._context, create=False)
}
def _is_global_discount_program(self):
diff --git a/addons/sale_crm/models/crm_lead.py b/addons/sale_crm/models/crm_lead.py
index f89a509c74b..097e5f8e281 100644
--- a/addons/sale_crm/models/crm_lead.py
+++ b/addons/sale_crm/models/crm_lead.py
@@ -83,3 +83,32 @@ class CrmLead(models.Model):
'default_source_id': self.source_id.id
}
return action
+
+ def action_view_sale_quotation(self):
+ action = self.env.ref('sale.action_quotations_with_onboarding').read()[0]
+ action['context'] = {
+ 'search_default_draft': 1,
+ 'search_default_partner_id': self.partner_id.id,
+ 'default_partner_id': self.partner_id.id,
+ 'default_opportunity_id': self.id
+ }
+ action['domain'] = [('opportunity_id', '=', self.id), ('state', 'in', ['draft', 'sent'])]
+ quotations = self.mapped('order_ids').filtered(lambda l: l.state in ('draft', 'sent'))
+ if len(quotations) == 1:
+ action['views'] = [(self.env.ref('sale.view_order_form').id, 'form')]
+ action['res_id'] = quotations.id
+ return action
+
+ def action_view_sale_order(self):
+ action = self.env.ref('sale.action_orders').read()[0]
+ action['context'] = {
+ 'search_default_partner_id': self.partner_id.id,
+ 'default_partner_id': self.partner_id.id,
+ 'default_opportunity_id': self.id,
+ }
+ action['domain'] = [('opportunity_id', '=', self.id), ('state', 'not in', ('draft', 'sent', 'cancel'))]
+ orders = self.mapped('order_ids').filtered(lambda l: l.state not in ('draft', 'sent', 'cancel'))
+ if len(orders) == 1:
+ action['views'] = [(self.env.ref('sale.view_order_form').id, 'form')]
+ action['res_id'] = orders.id
+ return action
diff --git a/addons/sale_crm/views/crm_lead_views.xml b/addons/sale_crm/views/crm_lead_views.xml
index d0c79228246..0544fd481a8 100644
--- a/addons/sale_crm/views/crm_lead_views.xml
+++ b/addons/sale_crm/views/crm_lead_views.xml
@@ -11,17 +11,12 @@
attrs="{'invisible': ['&amp;', ('probability', '=', 0), ('active', '=', False)]}"/>
</xpath>
<button name="action_schedule_meeting" position="after">
- <button class="oe_stat_button" type="action"
- name="%(sale_action_quotations)d" icon="fa-pencil-square-o"
- context="{'default_partner_id': partner_id, 'search_default_draft': 1, 'search_default_sent': 1}">
- <div class="o_stat_info">
- <field name="quotation_count" class="o_stat_value"/>
- <span class="o_stat_text"> Quotations </span>
- </div>
+ <button class="oe_stat_button" type="object"
+ name="action_view_sale_quotation" icon="fa-pencil-square-o">
+ <field name="quotation_count" widget="statinfo" string="Quotations"/>
</button>
- <button class="oe_stat_button" type="action" attrs="{'invisible': [('sale_order_count', '=', 0)]}"
- name="%(sale_action_orders)d" icon="fa-usd"
- context="{'search_default_partner_id': partner_id, 'default_partner_id': partner_id, 'search_default_sales': 1}">
+ <button class="oe_stat_button" type="object" attrs="{'invisible': [('sale_order_count', '=', 0)]}"
+ name="action_view_sale_order" icon="fa-usd">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="sale_amount_total" widget="monetary" options="{'currency_field': 'company_currency'}"/></span>
<span class="o_stat_text"> Orders</span>
diff --git a/addons/sale_crm/views/sale_order_views.xml b/addons/sale_crm/views/sale_order_views.xml
index 2428a1bb037..5a2a134a73a 100644
--- a/addons/sale_crm/views/sale_order_views.xml
+++ b/addons/sale_crm/views/sale_order_views.xml
@@ -9,27 +9,6 @@
<field name="context">{'search_default_opportunity_id': active_id, 'default_opportunity_id': active_id}</field>
</record>
- <record id="sale_action_quotations" model="ir.actions.act_window">
- <field name="name">Quotations</field>
- <field name="res_model">sale.order</field>
- <field name="search_view_id" ref="sale.sale_order_view_search_inherit_quotation"/>
- <field name="view_id" ref="sale.view_quotation_tree"/>
- <field name="domain">[('opportunity_id', '=', active_id)]</field>
- <field name="context">{'search_default_opportunity_id': [active_id], 'default_opportunity_id': active_id}</field>
- <field name="help" type="html">
- <p class="o_view_nocontent_smiling_face">
- Create a new quotation
- </p>
- </field>
- </record>
-
- <record id="sale_action_orders" model="ir.actions.act_window">
- <field name="name">Sale orders</field>
- <field name="res_model">sale.order</field>
- <field name="domain">[('opportunity_id', '=', active_id), ('state', 'not in', ('draft', 'sent', 'cancel'))]</field>
- <field name="context">{'search_default_opportunity_id': [active_id], 'default_opportunity_id': active_id}</field>
- </record>
-
<record id="sale_view_inherit123" model="ir.ui.view">
<field name="name">sale.order.form.inherit.sale</field>
<field name="model">sale.order</field>
diff --git a/addons/sale_expense/views/hr_expense_views.xml b/addons/sale_expense/views/hr_expense_views.xml
index ca46f6a58f7..ab1a8fc0eb2 100644
--- a/addons/sale_expense/views/hr_expense_views.xml
+++ b/addons/sale_expense/views/hr_expense_views.xml
@@ -27,6 +27,7 @@
<field name="res_model">hr.expense</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('sale_order_id', '=', active_id), ('state', '=', 'done')]</field>
+ <field name="context">{'default_sale_order_id': active_id}</field>
</record>
</odoo>
diff --git a/addons/sale_quotation_builder/views/sale_order_template_views.xml b/addons/sale_quotation_builder/views/sale_order_template_views.xml
index 0a14385bfa6..09256a7ec17 100644
--- a/addons/sale_quotation_builder/views/sale_order_template_views.xml
+++ b/addons/sale_quotation_builder/views/sale_order_template_views.xml
@@ -7,9 +7,10 @@
<field name="model">sale.order.template</field>
<field name="type">form</field>
<field name="arch" type="xml">
-
- <xpath expr="//div[@name='button_box']" position="inside">
- <button string="Edit Template" type="object" name="open_template" class="oe_stat_button" icon="fa-pencil"/>
+ <xpath expr="//sheet" position='before'>
+ <header>
+ <button name="open_template" class="oe_highlight" string="Design Template" type="object"/>
+ </header>
</xpath>
<xpath expr="//notebook[@name='description']" position="inside">
diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py
index 45c2bf5432c..a8795ddf8e9 100644
--- a/addons/sale_stock/models/sale_order.py
+++ b/addons/sale_stock/models/sale_order.py
@@ -134,6 +134,8 @@ class SaleOrder(models.Model):
elif pickings:
action['views'] = [(self.env.ref('stock.view_picking_form').id, 'form')]
action['res_id'] = pickings.id
+ picking_id = pickings.filtered(lambda l: l.picking_type_id.code == 'outgoing')[0]
+ action['context'] = dict(self._context, default_partner_id=self.partner_id.id, default_picking_id=picking_id.id, default_picking_type_id=picking_id.picking_type_id.id, default_origin=self.name, default_group_id=picking_id.group_id.id)
return action
def action_cancel(self):
diff --git a/addons/sale_stock/models/stock.py b/addons/sale_stock/models/stock.py
index 21972630368..325650aedd9 100644
--- a/addons/sale_stock/models/stock.py
+++ b/addons/sale_stock/models/stock.py
@@ -132,4 +132,5 @@ class ProductionLot(models.Model):
self.ensure_one()
action = self.env.ref('sale.action_orders').read()[0]
action['domain'] = [('id', 'in', self.mapped('sale_order_ids.id'))]
+ action['context'] = dict(self._context, create=False)
return action
diff --git a/addons/sale_stock/views/stock_production_lot_views.xml b/addons/sale_stock/views/stock_production_lot_views.xml
index 593dd856779..7bc4ab22f3c 100644
--- a/addons/sale_stock/views/stock_production_lot_views.xml
+++ b/addons/sale_stock/views/stock_production_lot_views.xml
@@ -13,7 +13,7 @@
<span class="o_stat_value">
<field name="sale_order_count" widget="statinfo" nolabel="1" class="mr4"/>
</span>
- <span class="o_stat_text">Sale Orders</span>
+ <span class="o_stat_text">Sales</span>
</div>
</button>
</xpath>
diff --git a/addons/sale_timesheet/models/sale_order.py b/addons/sale_timesheet/models/sale_order.py
index 3582e706b18..d3de544a857 100644
--- a/addons/sale_timesheet/models/sale_order.py
+++ b/addons/sale_timesheet/models/sale_order.py
@@ -23,6 +23,7 @@ class SaleOrder(models.Model):
readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]},
help='Select a non billable project on which tasks can be created.')
project_ids = fields.Many2many('project.project', compute="_compute_project_ids", string='Projects', copy=False, groups="project.group_project_user", help="Projects used in this sales order.")
+ timesheet_encode_uom_id = fields.Many2one('uom.uom', related='company_id.timesheet_encode_uom_id')
@api.depends('analytic_account_id.line_ids')
def _compute_timesheet_ids(self):
diff --git a/addons/sale_timesheet/views/sale_order_views.xml b/addons/sale_timesheet/views/sale_order_views.xml
index 72b42ad4e29..016e0ce66de 100644
--- a/addons/sale_timesheet/views/sale_order_views.xml
+++ b/addons/sale_timesheet/views/sale_order_views.xml
@@ -6,36 +6,40 @@
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<data>
- <xpath expr="//button[@name='action_view_invoice']" position="before">
- <button type="object"
- name="action_view_timesheet"
- class="oe_stat_button"
- icon="fa-clock-o"
- attrs="{'invisible': [('timesheet_count', '=', 0)]}"
- groups="hr_timesheet.group_hr_timesheet_user">
- <field name="timesheet_count" widget="statinfo" string="Timesheets"/>
- </button>
- </xpath>
<xpath expr="//button[@name='action_view_invoice']" position="before">
<button type="object"
name="action_view_project_ids"
class="oe_stat_button"
icon="fa-puzzle-piece"
- string="Project(s) Overview"
+ string="Project Overview"
attrs="{'invisible': [('project_ids', '=', [])]}"
groups="project.group_project_manager">
<field name="project_ids" invisible="1"/>
</button>
</xpath>
<xpath expr="//button[@name='action_view_invoice']" position="before">
- <button type="object"
+ <button type="object"
name="action_view_task"
class="oe_stat_button"
icon="fa-tasks"
attrs="{'invisible': [('tasks_count', '=', 0)]}"
groups="project.group_project_user">
<field name="tasks_count" widget="statinfo" string="Tasks"/>
- </button>
+ </button>
+ <button type="object"
+ name="action_view_timesheet"
+ class="oe_stat_button"
+ icon="fa-clock-o"
+ attrs="{'invisible': [('timesheet_count', '=', 0)]}"
+ groups="hr_timesheet.group_hr_timesheet_user">
+ <div class="o_field_widget o_stat_info">
+ <span class="o_stat_value">
+ <field name="timesheet_count" class="mr4"/>
+ <field name="timesheet_encode_uom_id" options="{'no_open' : True}"/>
+ </span>
+ <span class="o_stat_text">Recorded</span>
+ </div>
+ </button>
</xpath>
<xpath expr="//field[@name='analytic_account_id']" position="after">
<field name="visible_project" invisible="1"/>
diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py
index fc4811e9af7..bc24dc23157 100644
--- a/addons/stock/models/stock_picking.py
+++ b/addons/stock/models/stock_picking.py
@@ -1089,6 +1089,7 @@ class Picking(models.Model):
action = self.env.ref('stock.action_stock_scrap').read()[0]
scraps = self.env['stock.scrap'].search([('picking_id', '=', self.id)])
action['domain'] = [('id', 'in', scraps.ids)]
+ action['context'] = dict(self._context, create=False)
return action
def action_see_packages(self):
diff --git a/addons/stock/models/stock_production_lot.py b/addons/stock/models/stock_production_lot.py
index 926b4696d70..1307272edda 100644
--- a/addons/stock/models/stock_production_lot.py
+++ b/addons/stock/models/stock_production_lot.py
@@ -69,7 +69,7 @@ class ProductionLot(models.Model):
lot.product_qty = sum(quants.mapped('quantity'))
def action_lot_open_quants(self):
- self = self.with_context(search_default_lot_id=self.id)
+ self = self.with_context(search_default_lot_id=self.id, create=False)
if self.user_has_groups('stock.group_stock_manager'):
self = self.with_context(inventory_mode=True)
return self.env['stock.quant']._get_quants_action()
diff --git a/addons/stock/models/stock_warehouse.py b/addons/stock/models/stock_warehouse.py
index f5939e7aae7..72700f0bfcc 100644
--- a/addons/stock/models/stock_warehouse.py
+++ b/addons/stock/models/stock_warehouse.py
@@ -922,7 +922,8 @@ class Warehouse(models.Model):
'type': 'ir.actions.act_window',
'view_id': False,
'view_mode': 'tree,form',
- 'limit': 20
+ 'limit': 20,
+ 'context': dict(self._context, default_warehouse_selectable=True, default_warehouse_ids=self.ids)
}
diff --git a/addons/stock/views/product_views.xml b/addons/stock/views/product_views.xml
index ed326116f38..f37bf279575 100644
--- a/addons/stock/views/product_views.xml
+++ b/addons/stock/views/product_views.xml
@@ -214,7 +214,7 @@
<div name="button_box" position="inside">
<button class="oe_stat_button"
name="action_open_quants"
- icon="fa-building-o"
+ icon="fa-cubes"
type="object" attrs="{'invisible':[('type', '!=', 'product')]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
@@ -227,31 +227,25 @@
<button type="action"
name="%(stock.report_stock_quantity_action_product)d"
attrs="{'invisible':[('type', '!=', 'product')]}"
- context="{'search_default_product_id': id}"
- class="oe_stat_button" icon="fa-building-o">
+ context="{'search_default_product_id': id, 'default_product_id': id}"
+ class="oe_stat_button" icon="fa-cubes">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="virtual_available" widget="statinfo" nolabel="1"/>
<span attrs="{'invisible': [('outgoing_qty', '=', 0), ('incoming_qty', '=', 0)]}" groups="base.group_no_one">
(-<field name="outgoing_qty" widget="statinfo" nolabel="1"/>+<field name="incoming_qty" widget="statinfo" nolabel="1"/>)
</span>
- <field name="uom_name" class="ml4"/>
+ <field name="uom_name"/>
</span>
<span class="o_stat_text">Forecasted</span>
</div>
</button>
- <button string="Product Moves"
+ <button string="Traceability"
type="object"
name= "action_view_stock_move_lines"
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"
class="oe_stat_button" icon="fa-exchange"
groups="stock.group_stock_user"/>
- <button type="action"
- name="%(product_open_orderpoint)d"
- attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '==', 1)]}"
- class="oe_stat_button" icon="fa-refresh">
- <field name="nbr_reordering_rules" widget="statinfo"/>
- </button>
<button name="%(product_open_orderpoint)d" type="action"
attrs="{'invisible':['|',('type', 'not in', ['product', 'consu']),('nbr_reordering_rules', '!=', 1)]}"
class="oe_stat_button" icon="fa-refresh">
@@ -264,6 +258,16 @@
<span class="o_stat_value"><field name="reordering_max_qty"/></span>
</div>
</button>
+ <button type="action"
+ name="%(product_open_orderpoint)d"
+ attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '==', 1)]}"
+ class="oe_stat_button" icon="fa-refresh">
+ <field name="nbr_reordering_rules" widget="statinfo"/>
+ </button>
+ <button string="Lot/Serial Numbers" type="object"
+ name="action_open_product_lot"
+ attrs="{'invisible': [('tracking', '=', 'none')]}"
+ class="oe_stat_button" icon="fa-bars" groups="stock.group_production_lot"/>
<button string="Routes" type="action"
name="%(action_stock_rules_report)d"
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"
@@ -275,10 +279,6 @@
class="oe_stat_button" icon="fa-random" groups="stock.group_stock_multi_locations"
attrs="{'invisible': [('type', '=', 'service')]}"
context="{'invisible_handle': True, 'single_product': True}"/>
- <button string="Lot/Serial Number" type="object"
- name="action_open_product_lot"
- attrs="{'invisible': [('tracking', '=', 'none')]}"
- class="oe_stat_button" icon="fa-bars" groups="stock.group_production_lot"/>
</div>
<xpath expr="//field[@name='product_tmpl_id']" position="attributes">
<attribute name="context">{'quantity_available_locations_domain': ('internal',)}</attribute>
@@ -309,7 +309,7 @@
<button type="object"
name="action_open_quants"
attrs="{'invisible':[('type', '!=', 'product')]}"
- class="oe_stat_button" icon="fa-building-o">
+ class="oe_stat_button" icon="fa-cubes">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value" widget="statinfo">
<field name="qty_available" widget="statinfo" nolabel="1" class="mr4"/>
@@ -321,33 +321,26 @@
<button type="action"
name="%(stock.report_stock_quantity_action_product)d"
attrs="{'invisible':[('type', '!=', 'product')]}"
- context="{'search_default_product_tmpl_id': id}"
- class="oe_stat_button" icon="fa-building-o">
+ context="{'search_default_product_tmpl_id': id, 'default_product_tmpl_id': id}"
+ class="oe_stat_button" icon="fa-cubes">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="virtual_available" widget="statinfo" nolabel="1"/>
<span attrs="{'invisible':[('outgoing_qty', '=', 0),('incoming_qty','=',0)]}" groups="base.group_no_one">
(-<field name="outgoing_qty" widget="statinfo" nolabel="1"/>+<field name="incoming_qty" widget="statinfo" nolabel="1"/>)
</span>
- <field name="uom_name" class="ml4"/>
+ <field name="uom_name"/>
</span>
<span class="o_stat_text">Forecasted</span>
</div>
</button>
- <button string="Product Moves" type="object"
+ <button string="Traceability" type="object"
name= "action_view_stock_move_lines"
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"
class="oe_stat_button" icon="fa-exchange"
groups="stock.group_stock_user"/>
<button type="object"
name="action_view_orderpoints"
- attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '==', 1)]}"
- class="oe_stat_button"
- icon="fa-refresh">
- <field name="nbr_reordering_rules" widget="statinfo"/>
- </button>
- <button type="object"
- name="action_view_orderpoints"
attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '!=', 1)]}"
class="oe_stat_button" icon="fa-refresh">
<div class="o_field_widget o_stat_info mr4">
@@ -359,6 +352,17 @@
<span class="o_stat_value"><field name="reordering_max_qty"/></span>
</div>
</button>
+ <button type="object"
+ name="action_view_orderpoints"
+ attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '==', 1)]}"
+ class="oe_stat_button"
+ icon="fa-refresh">
+ <field name="nbr_reordering_rules" widget="statinfo"/>
+ </button>
+ <button string="Lot/Serial Numbers" type="object"
+ name="action_open_product_lot"
+ attrs="{'invisible': [('tracking', '=', 'none')]}"
+ class="oe_stat_button" icon="fa-bars" groups="stock.group_production_lot"/>
<button string="Routes" type="action"
name="%(action_stock_rules_report)d"
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"
@@ -373,10 +377,6 @@
'invisible_handle': True,
'single_product': product_variant_count == 1,
}"/>
- <button string="Lot/Serial Number" type="object"
- name="action_open_product_lot"
- attrs="{'invisible': [('tracking', '=', 'none')]}"
- class="oe_stat_button" icon="fa-bars" groups="stock.group_production_lot"/>
</div>
<!-- change attrs of fields added in view_template_property_form
diff --git a/addons/stock/views/stock_location_views.xml b/addons/stock/views/stock_location_views.xml
index 20a06956ee9..72a55480542 100644
--- a/addons/stock/views/stock_location_views.xml
+++ b/addons/stock/views/stock_location_views.xml
@@ -2,7 +2,7 @@
<odoo>
<act_window
context="{'location': active_id, 'search_default_real_stock_available': 1, 'search_default_virtual_stock_available': 1,
- 'search_default_virtual_stock_negative': 1, 'search_default_real_stock_negative': 1}"
+ 'search_default_virtual_stock_negative': 1, 'search_default_real_stock_negative': 1, 'create': False}"
id="act_product_location_open"
name="Products"
res_model="product.product"
@@ -23,10 +23,10 @@
groups="stock.group_stock_multi_locations"/>
<button string="Current Stock"
class="oe_stat_button"
- icon="fa-building-o" name="%(location_open_quants)d" type="action"/>
+ icon="fa-cubes" name="%(location_open_quants)d" type="action"/>
<button string="Products"
class="oe_stat_button"
- icon="fa-filter" name="%(act_product_location_open)d" type="action"
+ icon="fa-th-list" name="%(act_product_location_open)d" type="action"
context="{'location_id': active_id}"
/>
</div>
diff --git a/addons/stock/views/stock_picking_views.xml b/addons/stock/views/stock_picking_views.xml
index 96b067e1cfb..85d99877011 100644
--- a/addons/stock/views/stock_picking_views.xml
+++ b/addons/stock/views/stock_picking_views.xml
@@ -238,7 +238,7 @@
<button name="action_see_packages" string="Packages" type="object"
class="oe_stat_button" icon="fa-cubes"
attrs="{'invisible': [('has_packages', '=', False)]}"/>
- <button name="%(action_stock_report)d" icon="fa-arrow-up" class="oe_stat_button" string="Traceability Report" type="action" attrs="{'invisible': ['|', ('state', '!=', 'done'), ('has_tracking', '=', False)]}" groups="stock.group_production_lot"/>
+ <button name="%(action_stock_report)d" icon="fa-arrow-up" class="oe_stat_button" string="Traceability" type="action" attrs="{'invisible': ['|', ('state', '!=', 'done'), ('has_tracking', '=', False)]}" groups="stock.group_production_lot"/>
<!-- Use the following button to avoid onchange on one2many -->
<button name="action_picking_move_tree"
class="oe_stat_button"
diff --git a/addons/stock/views/stock_production_lot_views.xml b/addons/stock/views/stock_production_lot_views.xml
index 710592d2ce0..b03bc97f163 100644
--- a/addons/stock/views/stock_production_lot_views.xml
+++ b/addons/stock/views/stock_production_lot_views.xml
@@ -10,8 +10,8 @@
<field name="display_complete" invisible="1"/>
<div class="oe_button_box" name="button_box"
attrs="{'invisible': [('display_complete', '=', False)]}">
- <button name="action_lot_open_quants" icon="fa-arrows" class="oe_stat_button" string="Locate" type="object"/>
- <button name="%(action_stock_report)d" icon="fa-arrow-up" class="oe_stat_button" string="Traceability Report" type="action"/>
+ <button name="action_lot_open_quants" icon="fa-arrows" class="oe_stat_button" string="Location" type="object"/>
+ <button name="%(action_stock_report)d" icon="fa-arrow-up" class="oe_stat_button" string="Traceability" type="action"/>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
diff --git a/addons/stock/views/stock_scrap_views.xml b/addons/stock/views/stock_scrap_views.xml
index bc8d43d54ae..4e5520b6bcd 100644
--- a/addons/stock/views/stock_scrap_views.xml
+++ b/addons/stock/views/stock_scrap_views.xml
@@ -35,7 +35,7 @@
attrs="{'invisible':[('picking_id','=',False)]}" icon="fa-cogs"/>
<field name="picking_id" invisible="1"/>
<button class="oe_stat_button" name="action_get_stock_move_lines"
- string="Product Move" type="object"
+ string="Traceability" type="object"
attrs="{'invisible':[('move_id','=',False)]}" icon="fa-exchange"/>
<field name="move_id" invisible="1"/>
</div>
diff --git a/addons/stock_account/models/stock_inventory.py b/addons/stock_account/models/stock_inventory.py
index a5ae3bfe0a2..ce00ed251c5 100644
--- a/addons/stock_account/models/stock_inventory.py
+++ b/addons/stock_account/models/stock_inventory.py
@@ -31,6 +31,7 @@ class StockInventory(models.Model):
return False
action_data = action_ref.read()[0]
action_data['domain'] = [('stock_move_id.id', 'in', self.move_ids.ids)]
+ action_data['context'] = dict(self._context, create=False)
return action_data
def post_inventory(self):
diff --git a/addons/website_sale_digital/views/website_sale_digital_view.xml b/addons/website_sale_digital/views/website_sale_digital_view.xml
index a486170e31b..e91807fd29f 100644
--- a/addons/website_sale_digital/views/website_sale_digital_view.xml
+++ b/addons/website_sale_digital/views/website_sale_digital_view.xml
@@ -6,7 +6,7 @@
<field name="inherit_id" ref="product.product_template_only_form_view" />
<field name="arch" type="xml">
<div name="button_box" position="inside">
- <button class="oe_stat_button" name="action_open_attachments" type="object" icon="fa-file">
+ <button class="oe_stat_button" name="action_open_attachments" type="object" icon="fa-file-text-o">
<field string="Digital Files" name="attachment_count" widget="statinfo" />
</button>
</div>
@@ -19,7 +19,7 @@
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
- <button class="oe_stat_button" name="action_open_attachments" type="object" icon="fa-file">
+ <button class="oe_stat_button" name="action_open_attachments" type="object" icon="fa-file-text-o">
<field string="Digital Files" name="attachment_count" widget="statinfo" />
</button>
</div>