[MIG] base_company_extension to v14

product_usability: add seller_id field
base_usability: write/create rights on res.partner.title to base.group_system (instead of partner manager)
sale_stock_usability: move warehouse_id to top
stock_usabiluty: type on product set to 'product' by default
This commit is contained in:
Alexis de Lattre
2020-12-15 18:34:20 +01:00
parent 6682c9e048
commit a90965109d
12 changed files with 30 additions and 18 deletions

View File

@@ -19,16 +19,12 @@ Base Company Extension
|badge1| |badge2| |badge3|
This module adds the following fields to the ResCompany model:
This module adds the following fields on the company:
* Capital Amount
* Legal Type
This is useful to display the legal name of the company in reports
**Table of contents**
.. contents::
:local:
This is useful to display the legal name of the company in reports.
Bug Tracker
===========
@@ -36,7 +32,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_company_extension%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_company_extension%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.

View File

@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright 2014-2019 Akretion (http://www.akretion.com)
# Copyright 2014-2020 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Base Company Extension',
'version': '12.0.1.0.0',
'version': '14.0.1.0.0',
'category': 'Partner',
'license': 'AGPL-3',
'summary': 'Adds capital and title on company',
@@ -14,5 +13,5 @@
# I depend on base_usability only for _report_company_legal_name()
'depends': ['base_usability'],
'data': ['company_view.xml'],
'installable': False,
'installable': True,
}

View File

@@ -1,4 +1,4 @@
# Copyright 2014-2019 Akretion (http://www.akretion.com)
# Copyright 2014-2020 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -16,7 +16,7 @@ class ResCompany(models.Model):
def _report_company_legal_name(self):
self.ensure_one()
if self.legal_type:
name = u'%s %s' % (self.name, self.legal_type)
name = '%s %s' % (self.name, self.legal_type)
else:
name = self.name
return name

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2014-2019 Akretion (http://www.akretion.com/)
Copyright 2014-2020 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->

View File

@@ -13,6 +13,7 @@
'depends': ['base'],
'data': [
'security/group.xml',
'security/ir.model.access.csv',
'views/res_partner.xml',
'views/res_partner_bank.xml',
'views/res_country.xml',

View File

@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
base.access_res_partner_title_group_user,Full access on res.partner.title to Settings group (instead of partner manager by default),base.model_res_partner_title,base.group_system,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 base.access_res_partner_title_group_user Full access on res.partner.title to Settings group (instead of partner manager by default) base.model_res_partner_title base.group_system 1 1 1 1

View File

@@ -19,7 +19,7 @@ This module has been written by Alexis de Lattre <alexis.delattre@akretion.com>
""",
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['base'],
'depends': ['account'],
'data': ['views/res_partner.xml'],
'installable': True,
}

View File

@@ -19,7 +19,7 @@ This module has been written by Alexis de Lattre <alexis.delattre@akretion.com>
""",
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['base'],
'depends': ['contacts'],
'data': ['views/res_partner.xml'],
'installable': True,
}

View File

@@ -8,7 +8,7 @@
<odoo>
<record id="contacts.action_contacts" model="ir.actions.act_window">
<field name="view_mode">tree,form,kanban</field>
<field name="view_mode">tree,form,kanban,activity</field>
</record>
<record id="contacts.action_contacts_view_tree" model="ir.actions.act_window.view">

View File

@@ -9,6 +9,13 @@ from odoo import models, fields
class ProductTemplate(models.Model):
_inherit = 'product.template'
# restore v8 native field
# https://github.com/odoo/odoo/blob/8.0/addons/product/product.py#L592
# in v10, that field was defined in procurement_suggest, but we will
# probably not port procurement_suggest because it is native in v14
seller_id = fields.Many2one(
'res.partner', related='seller_ids.name', string='Main Supplier')
# name = fields.Char(
# track_visibility='onchange')

View File

@@ -15,6 +15,10 @@
<field name="picking_policy" position="after">
<field name="picking_status"/>
</field>
<!-- move warehouse_id to the top, not hidden in the 2nd tab -->
<group name="order_details" position="inside">
<field name="warehouse_id" options="{'no_create': True}" groups="stock.group_stock_multi_warehouses" force_save="1" position="move"/>
</group>
</field>
</record>

View File

@@ -10,3 +10,6 @@ class ProductTemplate(models.Model):
tracking = fields.Selection(tracking=True)
sale_delay = fields.Float(tracking=True)
# the 'stock' module adds 'product' in type...
# but forgets to make it the default
type = fields.Selection(default='product')