diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-08-01 17:22:43 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-08-01 17:22:43 +0200 |
| commit | af9868bc281721fe5d9ec323f9461fe735320b73 (patch) | |
| tree | 67dc8d914a5f5db5ed6a8acbc257c00569ff509c | |
| parent | 9cae99134580eacc95d445b43f2ea3a388bdd87a (diff) | |
| parent | e6ad24563457ed2fd42f11bdf5e586e8b554d81b (diff) | |
[MERGE] forward port branch 10.0 up to e6ad2456345
20 files changed, 73 insertions, 23 deletions
diff --git a/addons/hr/models/hr.py b/addons/hr/models/hr.py index f572056dded..4adaf2e78b3 100644 --- a/addons/hr/models/hr.py +++ b/addons/hr/models/hr.py @@ -110,26 +110,26 @@ class Employee(models.Model): # we need a related field in order to be able to sort the employee by name name_related = fields.Char(related='resource_id.name', string="Resource Name", readonly=True, store=True) country_id = fields.Many2one('res.country', string='Nationality (Country)') - birthday = fields.Date('Date of Birth') - ssnid = fields.Char('SSN No', help='Social Security Number') - sinid = fields.Char('SIN No', help='Social Insurance Number') - identification_id = fields.Char(string='Identification No') + birthday = fields.Date('Date of Birth', groups='hr.group_hr_user') + ssnid = fields.Char('SSN No', help='Social Security Number', groups='hr.group_hr_user') + sinid = fields.Char('SIN No', help='Social Insurance Number', groups='hr.group_hr_user') + identification_id = fields.Char(string='Identification No', groups='hr.group_hr_user') gender = fields.Selection([ ('male', 'Male'), ('female', 'Female'), ('other', 'Other') - ]) + ], groups='hr.group_hr_user') marital = fields.Selection([ ('single', 'Single'), ('married', 'Married'), ('widower', 'Widower'), ('divorced', 'Divorced') - ], string='Marital Status') + ], string='Marital Status', groups='hr.group_hr_user') department_id = fields.Many2one('hr.department', string='Department') address_id = fields.Many2one('res.partner', string='Work Address') address_home_id = fields.Many2one('res.partner', string='Home Address') bank_account_id = fields.Many2one('res.partner.bank', string='Bank Account Number', - domain="[('partner_id', '=', address_home_id)]", help='Employee bank salary account') + domain="[('partner_id', '=', address_home_id)]", help='Employee bank salary account', groups='hr.group_hr_user') work_phone = fields.Char('Work Phone') mobile_phone = fields.Char('Work Mobile') work_email = fields.Char('Work Email') @@ -142,7 +142,7 @@ class Employee(models.Model): ondelete='cascade', required=True, auto_join=True) coach_id = fields.Many2one('hr.employee', string='Coach') job_id = fields.Many2one('hr.job', string='Job Title') - passport_id = fields.Char('Passport No') + passport_id = fields.Char('Passport No', groups='hr.group_hr_user') color = fields.Integer('Color Index', default=0) city = fields.Char(related='address_id.city') login = fields.Char(related='user_id.login', readonly=True) diff --git a/addons/hr_contract/models/hr_contract.py b/addons/hr_contract/models/hr_contract.py index 07b2f380fac..cb0049f8e24 100644 --- a/addons/hr_contract/models/hr_contract.py +++ b/addons/hr_contract/models/hr_contract.py @@ -13,11 +13,11 @@ class Employee(models.Model): _inherit = "hr.employee" manager = fields.Boolean(string='Is a Manager') - medic_exam = fields.Date(string='Medical Examination Date') - place_of_birth = fields.Char('Place of Birth') - children = fields.Integer(string='Number of Children') - vehicle = fields.Char(string='Company Vehicle') - vehicle_distance = fields.Integer(string='Home-Work Dist.', help="In kilometers") + medic_exam = fields.Date(string='Medical Examination Date', groups='hr.group_hr_user') + place_of_birth = fields.Char('Place of Birth', groups='hr.group_hr_user') + children = fields.Integer(string='Number of Children', groups='hr.group_hr_user') + vehicle = fields.Char(string='Company Vehicle', groups='hr.group_hr_user') + vehicle_distance = fields.Integer(string='Home-Work Dist.', help="In kilometers", groups='hr.group_hr_user') contract_ids = fields.One2many('hr.contract', 'employee_id', string='Contracts') contract_id = fields.Many2one('hr.contract', compute='_compute_contract_id', string='Current Contract', help='Latest contract of the employee') contracts_count = fields.Integer(compute='_compute_contracts_count', string='Contracts') diff --git a/addons/l10n_in_hr_payroll/models/l10n_in_hr_payroll.py b/addons/l10n_in_hr_payroll/models/l10n_in_hr_payroll.py index b31cf67f5d1..b52641ec3cb 100644 --- a/addons/l10n_in_hr_payroll/models/l10n_in_hr_payroll.py +++ b/addons/l10n_in_hr_payroll/models/l10n_in_hr_payroll.py @@ -73,6 +73,7 @@ class HrPayrollAdvice(models.Model): self.env['hr.payroll.advice.line'].create({ 'advice_id': advice.id, 'name': slip.employee_id.bank_account_id.acc_number, + 'ifsc_code': slip.employee_id.bank_account_id.bank_bic or '', 'employee_id': slip.employee_id.id, 'bysal': payslip_line.total }) @@ -147,6 +148,7 @@ class HrPayslipRun(models.Model): self.env['hr.payroll.advice.line'].create({ 'advice_id': advice.id, 'name': slip.employee_id.bank_account_id.acc_number, + 'ifsc_code': slip.employee_id.bank_account_id.bank_bic or '', 'employee_id': slip.employee_id.id, 'bysal': payslip_line.total }) diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 6a44bc106e8..c6b88c239ca 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -414,7 +414,7 @@ class PurchaseOrder(models.Model): moves = order.order_line._create_stock_moves(picking) moves = moves.filtered(lambda x: x.state not in ('done', 'cancel')).action_confirm() seq = 0 - for move in moves: + for move in sorted(moves, key=lambda move: move.date_expected): seq += 5 move.sequence = seq moves.force_assign() diff --git a/addons/purchase/views/purchase_views.xml b/addons/purchase/views/purchase_views.xml index c5f7d88ffef..c81044e36a1 100644 --- a/addons/purchase/views/purchase_views.xml +++ b/addons/purchase/views/purchase_views.xml @@ -569,7 +569,7 @@ <group string="Warning when Purchasing this Product" groups="purchase.group_warning_purchase"> <field name="purchase_line_warn" nolabel="1"/> <field name="purchase_line_warn_msg" colspan="3" nolabel="1" - attrs="{'required':[('purchase_line_warn','!=','no-message')],'readonly':[('purchase_line_warn','=','no-message')]}"/> + attrs="{'required':[('purchase_line_warn','!=','no-message')],'readonly':[('purchase_line_warn','=','no-message')], 'invisible':[('purchase_line_warn','=','no-message')]}"/> </group> </group> <group name="description" position="inside"> diff --git a/addons/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml index 1c5cc4f086d..45400202b03 100644 --- a/addons/sale/views/sale_views.xml +++ b/addons/sale/views/sale_views.xml @@ -627,7 +627,7 @@ <group string="Warning when Selling this Product" groups="sale.group_warning_sale"> <field name="sale_line_warn" nolabel="1"/> <field name="sale_line_warn_msg" colspan="3" nolabel="1" - attrs="{'required':[('sale_line_warn','!=','no-message')],'readonly':[('sale_line_warn','=','no-message')]}"/> + attrs="{'required':[('sale_line_warn','!=','no-message')],'readonly':[('sale_line_warn','=','no-message')], 'invisible':[('sale_line_warn','=','no-message')]}"/> </group> </group> </field> diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py index 95eb0db46c0..c88e21922e1 100644 --- a/addons/sale_stock/models/sale_order.py +++ b/addons/sale_stock/models/sale_order.py @@ -184,7 +184,7 @@ class SaleOrderLine(models.Model): if move.location_dest_id.usage == "customer": if not move.origin_returned_move_id: qty += move.product_uom._compute_quantity(move.product_uom_qty, self.product_uom) - elif move.location_dest_id.usage == "internal" and move.to_refund_so: + elif move.location_dest_id.usage != "customer" and move.to_refund_so: qty -= move.product_uom._compute_quantity(move.product_uom_qty, self.product_uom) return qty diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 853be23c29a..11d89207ada 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -539,7 +539,7 @@ class ProductTemplate(models.Model): def action_view_stock_moves(self): products = self.mapped('product_variant_ids') action = self.env.ref('stock.act_product_stock_move_open').read()[0] - if self: + if products: action['context'] = {'default_product_id': products.ids[0]} action['domain'] = [('product_id.product_tmpl_id', 'in', self.ids)] return action diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 359c0b93435..3470f816b6a 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -219,8 +219,11 @@ class StockMove(models.Model): @api.constrains('product_uom') def _check_uom(self): - if any(move.product_id.uom_id.category_id.id != move.product_uom.category_id.id for move in self): - raise UserError(_('You try to move a product using a UoM that is not compatible with the UoM of the product moved. Please use an UoM in the same UoM category.')) + moves_error = self.filtered(lambda move: move.product_id.uom_id.category_id.id != move.product_uom.category_id.id) + if moves_error: + user_warning = _('You try to move a product using a UoM that is not compatible with the UoM of the product moved. Please use an UoM in the same UoM category.') + user_warning += '\n\nBlocking: %s' % ' ,'.join(moves_error.mapped('name')) + raise UserError(user_warning) @api.model_cr def init(self): diff --git a/addons/website_slides/data/demo-thumbnails/8DBabYQ1nUE.jpg b/addons/website_slides/data/demo-thumbnails/8DBabYQ1nUE.jpg Binary files differnew file mode 100644 index 00000000000..2a4245bf9ba --- /dev/null +++ b/addons/website_slides/data/demo-thumbnails/8DBabYQ1nUE.jpg diff --git a/addons/website_slides/data/demo-thumbnails/QtIU0p8daAo.jpg b/addons/website_slides/data/demo-thumbnails/QtIU0p8daAo.jpg Binary files differnew file mode 100644 index 00000000000..7db70d6aeb4 --- /dev/null +++ b/addons/website_slides/data/demo-thumbnails/QtIU0p8daAo.jpg diff --git a/addons/website_slides/data/demo-thumbnails/VMuCr5_arsY.jpg b/addons/website_slides/data/demo-thumbnails/VMuCr5_arsY.jpg Binary files differnew file mode 100644 index 00000000000..ca2ceb8e819 --- /dev/null +++ b/addons/website_slides/data/demo-thumbnails/VMuCr5_arsY.jpg diff --git a/addons/website_slides/data/demo-thumbnails/Vp5xqQOWLzE.jpg b/addons/website_slides/data/demo-thumbnails/Vp5xqQOWLzE.jpg Binary files differnew file mode 100644 index 00000000000..6f692064738 --- /dev/null +++ b/addons/website_slides/data/demo-thumbnails/Vp5xqQOWLzE.jpg diff --git a/addons/website_slides/data/demo-thumbnails/fgdz8MH2YHY.jpg b/addons/website_slides/data/demo-thumbnails/fgdz8MH2YHY.jpg Binary files differnew file mode 100644 index 00000000000..19be3967af2 --- /dev/null +++ b/addons/website_slides/data/demo-thumbnails/fgdz8MH2YHY.jpg diff --git a/addons/website_slides/data/demo-thumbnails/sDxfUTd-gs0.jpg b/addons/website_slides/data/demo-thumbnails/sDxfUTd-gs0.jpg Binary files differnew file mode 100644 index 00000000000..38a695d6910 --- /dev/null +++ b/addons/website_slides/data/demo-thumbnails/sDxfUTd-gs0.jpg diff --git a/addons/website_slides/data/demo-thumbnails/tUx39vAENy0.jpg b/addons/website_slides/data/demo-thumbnails/tUx39vAENy0.jpg Binary files differnew file mode 100644 index 00000000000..223b7a47e0b --- /dev/null +++ b/addons/website_slides/data/demo-thumbnails/tUx39vAENy0.jpg diff --git a/addons/website_slides/data/demo-thumbnails/v2O0YZU19ms.jpg b/addons/website_slides/data/demo-thumbnails/v2O0YZU19ms.jpg Binary files differnew file mode 100644 index 00000000000..4cf84bcdd0c --- /dev/null +++ b/addons/website_slides/data/demo-thumbnails/v2O0YZU19ms.jpg diff --git a/addons/website_slides/data/website_slides_demo.xml b/addons/website_slides/data/website_slides_demo.xml index eb47562e18d..39e91d3b73f 100644 --- a/addons/website_slides/data/website_slides_demo.xml +++ b/addons/website_slides/data/website_slides_demo.xml @@ -28,66 +28,111 @@ <record id="slide_0" model="slide.slide"> <field name="name">Odoo MRP</field> <field name="url">https://www.youtube.com/watch?v=QtIU0p8daAo</field> + <field name="document_id">QtIU0p8daAo</field> + <field name="slide_type">video</field> <field name="channel_id" ref="channel_public"/> <field name="category_id" ref="category_1"/> <field name="website_published" eval="True"/> <field name="tag_ids" eval="[(4, ref('tag2'))]"/> + <field name="image" type="base64" file="website_slides/data/demo-thumbnails/QtIU0p8daAo.jpg"/> + <field name="description">Discover how you can integrate MRP, PLM, Quality and Maintenance in a single application to maximize the efficiency of your manufacturing operations. + +Read more about the features at: https://www.odoo.com/page/manufacturing-features + +Discover Odoo MRP: https://www.odoo.com/page/manufacturing</field> </record> <record id="slide_1" model="slide.slide"> <field name="name">Odoo CRM</field> <field name="url">https://www.youtube.com/watch?v=fgdz8MH2YHY</field> + <field name="document_id">fgdz8MH2YHY</field> + <field name="slide_type">video</field> <field name="channel_id" ref="channel_public"/> <field name="category_id" ref="category_1"/> <field name="website_published" eval="True"/> <field name="tag_ids" eval="[(4, ref('tag1'))]"/> + <field name="image" type="base64" file="website_slides/data/demo-thumbnails/fgdz8MH2YHY.jpg"/> + <field name="description">Discover the CRM sales people love https://www.odoo.com/page/crm</field> </record> <record id="slide_2" model="slide.slide"> <field name="name">Odoo All-in-One Software Demonstration</field> <field name="url">https://www.youtube.com/watch?v=tUx39vAENy0</field> + <field name="document_id">tUx39vAENy0</field> + <field name="slide_type">video</field> <field name="channel_id" ref="channel_public"/> <field name="category_id" ref="category_2"/> <field name="website_published" eval="True"/> <field name="tag_ids" eval="[(4, ref('tag1')), (4, ref('tag2'))]"/> + <field name="image" type="base64" file="website_slides/data/demo-thumbnails/tUx39vAENy0.jpg"/> + <field name="description">Discover the all-in-one business management software solution that fits any business size and use case. + +Learn more at https://odoo.com</field> </record> <record id="slide_3" model="slide.slide"> <field name="name">Odoo Sign Demonstration</field> <field name="url">https://www.youtube.com/watch?v=8DBabYQ1nUE</field> + <field name="document_id">8DBabYQ1nUE</field> + <field name="slide_type">video</field> <field name="channel_id" ref="channel_public"/> <field name="category_id" ref="category_2"/> <field name="website_published" eval="True"/> <field name="tag_ids" eval="[(4, ref('tag2'))]"/> + <field name="image" type="base64" file="website_slides/data/demo-thumbnails/8DBabYQ1nUE.jpg"/> + <field name="description">Stop doing manual printing and scanning. Move to electronic signature with Odoo Sign! + +Discover more at https://www.odoo.com/page/sign</field> </record> <record id="slide_5" model="slide.slide"> <field name="name">Awesome Timesheet by Odoo</field> <field name="url">https://www.youtube.com/watch?v=v2O0YZU19ms</field> + <field name="document_id">v2O0YZU19ms</field> + <field name="slide_type">video</field> <field name="channel_id" ref="channel_public"/> <field name="category_id" ref="category_1"/> <field name="website_published" eval="True"/> <field name="tag_ids" eval="[(4, ref('tag2'))]"/> + <field name="image" type="base64" file="website_slides/data/demo-thumbnails/v2O0YZU19ms.jpg"/> + <field name="description">Download Awesome Timesheet by Odoo and discover how easy time tracking and employee management can be! + +Chrome: http://bit.ly/2613LcY +iOS: http://bit.ly/1ZUZsZD</field> </record> <record id="slide_6" model="slide.slide"> <field name="name">Odoo Marketing</field> <field name="url">https://www.youtube.com/watch?v=sDxfUTd-gs0</field> + <field name="document_id">sDxfUTd-gs0</field> + <field name="slide_type">video</field> <field name="channel_id" ref="channel_public"/> <field name="category_id" ref="category_1"/> <field name="website_published" eval="True"/> <field name="tag_ids" eval="[(4, ref('tag1')), (4, ref('tag2'))]"/> + <field name="image" type="base64" file="website_slides/data/demo-thumbnails/sDxfUTd-gs0.jpg"/> + <field name="description">Discover how easy marketing your business can be with Odoo</field> </record> <record id="slide_7" model="slide.slide"> <field name="name">Odoo Inventory</field> <field name="url">https://www.youtube.com/watch?v=Vp5xqQOWLzE</field> + <field name="document_id">Vp5xqQOWLzE</field> + <field name="slide_type">video</field> <field name="channel_id" ref="channel_public"/> <field name="category_id" ref="category_1"/> <field name="website_published" eval="True"/> <field name="tag_ids" eval="[(4, ref('tag1')), (4, ref('tag2'))]"/> + <field name="image" type="base64" file="website_slides/data/demo-thumbnails/Vp5xqQOWLzE.jpg"/> + <field name="description">Warehouse management software for the 21st century. + +Discover Odoo Inventory: https://www.odoo.com/page/warehouse</field> </record> <record id="slide_8" model="slide.slide"> <field name="name">Odoo Sales</field> <field name="url">https://www.youtube.com/watch?v=VMuCr5_arsY</field> + <field name="document_id">VMuCr5_arsY</field> + <field name="slide_type">video</field> <field name="channel_id" ref="channel_public"/> <field name="category_id" ref="category_1"/> <field name="website_published" eval="True"/> <field name="tag_ids" eval="[(4, ref('tag1')), (4, ref('tag2'))]"/> + <field name="image" type="base64" file="website_slides/data/demo-thumbnails/VMuCr5_arsY.jpg"/> + <field name="description">Learn more at https://www.odoo.com/page/sales</field> </record> <record id="slide_9" model="slide.slide"> diff --git a/addons/website_slides/models/slides.py b/addons/website_slides/models/slides.py index 10717866b07..ff4078a103e 100644 --- a/addons/website_slides/models/slides.py +++ b/addons/website_slides/models/slides.py @@ -387,7 +387,7 @@ class Slide(models.Model): values['image'] = values['datas'] if values.get('website_published') and not values.get('date_published'): values['date_published'] = datetime.datetime.now() - if values.get('url'): + if values.get('url') and not values.get('document_id'): doc_data = self._parse_document_url(values['url']).get('values', dict()) for key, value in doc_data.iteritems(): values.setdefault(key, value) @@ -401,7 +401,7 @@ class Slide(models.Model): @api.multi def write(self, values): - if values.get('url'): + if values.get('url') and values['url'] != self.url: doc_data = self._parse_document_url(values['url']).get('values', dict()) for key, value in doc_data.iteritems(): values.setdefault(key, value) diff --git a/odoo/exceptions.py b/odoo/exceptions.py index d83e350c624..edde12cb3ae 100644 --- a/odoo/exceptions.py +++ b/odoo/exceptions.py @@ -30,7 +30,7 @@ class except_orm(Exception): class UserError(except_orm): def __init__(self, msg): - super(UserError, self).__init__(msg) + super(UserError, self).__init__(msg, value='') # deprecated due to collision with builtins, kept for compatibility |
