16.0 vanila

This commit is contained in:
Ernad Husremovic 2025-10-03 17:53:49 +02:00
parent 956889352c
commit 2e65bf056a
17 changed files with 5293 additions and 17668 deletions

View file

@ -9,27 +9,8 @@ from . import wizard
def post_init(cr, registry):
"""Post-init housekeeping.
- Rewrites ICP's to force groups (existing behavior)
- Removes enterprise/proprietary "to_buy" module promos from Apps list
"""
"""Rewrite ICP's to force groups"""
from odoo import api, SUPERUSER_ID
env = api.Environment(cr, SUPERUSER_ID, {})
# Keep existing behavior
env['ir.config_parameter'].init(force=True)
# Remove enterprise/proprietary promotional stubs so they don't show in Apps
try:
Module = env['ir.module.module']
promos = Module.search([
('to_buy', '=', True),
('license', 'in', ['OEEL-1', 'OEEL', 'OPL-1', 'Proprietary']),
])
if promos:
promos.unlink()
except Exception:
# Best-effort cleanup; never break base post-init
pass

View file

@ -49,8 +49,7 @@ The kernel of Odoo, needed for all installation.
'views/ir_qweb_widget_templates.xml',
'views/ir_module_views.xml',
'data/ir_module_category_data.xml',
# Removed enterprise proprietary module promos (to_buy) from base data
# 'data/ir_module_module.xml',
'data/ir_module_module.xml',
'report/ir_module_reports.xml',
'report/ir_module_report_templates.xml',
'wizard/base_module_update_views.xml',

View file

@ -45,12 +45,6 @@
<field name="name">Sales</field>
<field name="sequence">5</field>
</record>
<record model="ir.module.category" id="module_category_sales_sales">
<field name="name">Sales</field>
<field name="parent_id" ref="module_category_sales"/>
<field name="description">Sales Management</field>
</record>
<record model="ir.module.category" id="module_category_human_resources">
<field name="name">Human Resources</field>
@ -61,34 +55,16 @@
<field name="name">Marketing</field>
<field name="sequence">40</field>
</record>
<record model="ir.module.category" id="module_category_marketing_email_marketing">
<field name="name">Email Marketing</field>
<field name="parent_id" ref="module_category_marketing"/>
<field name="description">Email Marketing Tools</field>
</record>
<record model="ir.module.category" id="module_category_manufacturing">
<field name="name">Manufacturing</field>
<field name="sequence">30</field>
</record>
<record model="ir.module.category" id="module_category_manufacturing_manufacturing">
<field name="name">Manufacturing</field>
<field name="parent_id" ref="module_category_manufacturing"/>
<field name="description">Manufacturing Management</field>
</record>
<record model="ir.module.category" id="module_category_website">
<field name="name">Website</field>
<field name="sequence">35</field>
</record>
<record model="ir.module.category" id="module_category_website_website">
<field name="name">Website</field>
<field name="parent_id" ref="module_category_website"/>
<field name="description">Website Management</field>
</record>
<record model="ir.module.category" id="module_category_theme">
<field name="name">Theme</field>
@ -129,30 +105,11 @@
<field name="name">Field Service</field>
<field name="parent_id" ref="module_category_services"/>
</record>
<record model="ir.module.category" id="module_category_services_project">
<field name="name">Project</field>
<field name="parent_id" ref="module_category_services"/>
<field name="sequence">15</field>
</record>
<record model="ir.module.category" id="module_category_services_timesheets">
<field name="name">Timesheets</field>
<field name="parent_id" ref="module_category_services"/>
<field name="description">Helps you manage the timesheets.</field>
<field name="sequence">13</field>
</record>
<record model="ir.module.category" id="module_category_inventory">
<field name="name">Inventory</field>
<field name="sequence">25</field>
</record>
<record model="ir.module.category" id="module_category_inventory_inventory">
<field name="name">Inventory</field>
<field name="parent_id" ref="module_category_inventory"/>
<field name="description">Inventory Management</field>
</record>
<record model="ir.module.category" id="module_category_productivity">
<field name="name">Productivity</field>

View file

@ -1,176 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.module.category" id="module_category_hidden">
<field name="name">Technical</field>
<field name="sequence">60</field>
<field name="visible" eval="0" />
</record>
<record model="ir.module.category" id="module_category_accounting">
<field name="name">Accounting</field>
<field name="sequence">15</field>
</record>
<record model="ir.module.category" id="module_category_accounting_localizations">
<field name="name">Localization</field>
<field name="sequence">65</field>
<field name="visible" eval="0" />
<field name="parent_id" ref="module_category_accounting"/>
</record>
<record model="ir.module.category" id="module_category_payroll_localization">
<field name="name">Payroll Localization</field>
<field name="visible" eval="0" />
</record>
<record model="ir.module.category" id="module_category_accounting_localizations_account_charts">
<field name="parent_id" ref="module_category_accounting_localizations" />
<field name="name">Account Charts</field>
<field name="visible" eval="0" />
</record>
<record model="ir.module.category" id="module_category_user_type">
<field name="name">User types</field>
<field name="description">Helps you manage users.</field>
<field name="sequence">9</field>
</record>
<record model="ir.module.category" id="module_category_accounting_accounting">
<field name="name">Invoicing</field>
<field name="sequence">4</field>
</record>
<record model="ir.module.category" id="module_category_sales">
<field name="name">Sales</field>
<field name="sequence">5</field>
</record>
<record model="ir.module.category" id="module_category_human_resources">
<field name="name">Human Resources</field>
<field name="sequence">45</field>
</record>
<record model="ir.module.category" id="module_category_marketing">
<field name="name">Marketing</field>
<field name="sequence">40</field>
</record>
<record model="ir.module.category" id="module_category_manufacturing">
<field name="name">Manufacturing</field>
<field name="sequence">30</field>
</record>
<record model="ir.module.category" id="module_category_website">
<field name="name">Website</field>
<field name="sequence">35</field>
</record>
<record model="ir.module.category" id="module_category_theme">
<field name="name">Theme</field>
<field name="exclusive" eval="0"/>
<field name="sequence">50</field>
</record>
<record model="ir.module.category" id="module_category_administration">
<field name="name">Administration</field>
<field name="sequence">100</field>
<field name="parent_id" eval="False"/>
</record>
<record model="ir.module.category" id="module_category_human_resources_appraisals">
<field name="name">Appraisals</field>
<field name="description">A user without any rights on Appraisals will be able to see the application, create and manage appraisals for himself and the people he's manager of.</field>
<field name="sequence">15</field>
</record>
<record model="ir.module.category" id="module_category_sales_sign">
<field name="name">Sign</field>
<field name="description">Helps you sign and complete your documents easily.</field>
<field name="sequence">25</field>
</record>
<record model="ir.module.category" id="module_category_services">
<field name="name">Services</field>
<field name="sequence">10</field>
</record>
<record model="ir.module.category" id="module_category_services_helpdesk">
<field name="name">Helpdesk</field>
<field name="description">After-sales services</field>
<field name="sequence">14</field>
</record>
<record model="ir.module.category" id="module_category_services_field_service">
<field name="name">Field Service</field>
<field name="parent_id" ref="module_category_services"/>
</record>
<record model="ir.module.category" id="module_category_inventory">
<field name="name">Inventory</field>
<field name="sequence">25</field>
</record>
<record model="ir.module.category" id="module_category_productivity">
<field name="name">Productivity</field>
<field name="sequence">50</field>
</record>
<record model="ir.module.category" id="module_category_customizations">
<field name="name">Customizations</field>
<field name="sequence">55</field>
</record>
<record model="ir.module.category" id="module_category_administration_administration">
<field name="name">Administration</field>
<field name="parent_id" ref="module_category_administration"/>
</record>
<record model="ir.module.category" id="module_category_usability">
<field name="name">Extra Rights</field>
<field name="sequence">101</field>
</record>
<record model="ir.module.category" id="module_category_extra">
<field name="name">Other Extra Rights</field>
<field name="sequence">102</field>
</record>
<!-- add applications to base groups -->
<record model="res.groups" id="group_erp_manager">
<field name="category_id" ref="module_category_administration_administration"/>
</record>
<record model="res.groups" id="group_system">
<field name="category_id" ref="module_category_administration_administration"/>
</record>
<record model="res.groups" id="group_user">
<field name="category_id" ref="module_category_user_type"/>
</record>
<record model="res.groups" id="group_multi_company">
<field name="category_id" ref="module_category_usability"/>
</record>
<record model="res.groups" id="group_multi_currency">
<field name="category_id" ref="module_category_usability"/>
</record>
<record model="res.groups" id="group_no_one">
<field name="category_id" ref="module_category_usability"/>
</record>
<record id="group_portal" model="res.groups">
<field name="category_id" ref="module_category_user_type"/>
</record>
<record id="group_public" model="res.groups">
<field name="category_id" ref="module_category_user_type"/>
</record>
<record id="group_partner_manager" model="res.groups">
<field name="category_id" ref="module_category_usability"/>
</record>
</data>
</odoo>

File diff suppressed because one or more lines are too long

View file

@ -883,14 +883,6 @@ class IrActionsActClient(models.Model):
params = record.params
record.params_store = repr(params) if isinstance(params, dict) else params
def _get_default_form_view(self):
doc = super(IrActionsActClient, self)._get_default_form_view()
params = doc.find(".//field[@name='params']")
params.getparent().remove(params)
params_store = doc.find(".//field[@name='params_store']")
params_store.getparent().remove(params_store)
return doc
def _get_readable_fields(self):
return super()._get_readable_fields() | {

View file

@ -24,33 +24,7 @@ from lxml import etree
from contextlib import closing
from reportlab.graphics.barcode import createBarcodeDrawing
from reportlab.pdfbase.pdfmetrics import getFont, TypeFace
try:
from PyPDF2 import PdfWriter, PdfReader
# Create compatibility classes for old PyPDF2 API
class PdfFileWriter(PdfWriter):
def addPage(self, page):
return self.add_page(page)
def addMetadata(self, metadata):
return self.add_metadata(metadata)
def appendPagesFromReader(self, reader, after_page_append=None):
return self.append_pages_from_reader(reader, after_page_append)
class PdfFileReader(PdfReader):
def getNumPages(self):
return len(self.pages)
def getPage(self, page_num):
return self.pages[page_num]
@property
def numPages(self):
return len(self.pages)
except ImportError:
from PyPDF2 import PdfFileWriter, PdfFileReader
from PyPDF2 import PdfFileWriter, PdfFileReader
from collections import OrderedDict
from collections.abc import Iterable
from PIL import Image, ImageFile

View file

@ -1512,6 +1512,42 @@ class TestTemplating(ViewCase):
" the main view's"
)
def test_branding_remove_add_text(self):
view1 = self.View.create({
'name': "Base view",
'type': 'qweb',
'arch': """<root>
<item order="1">
<item/>
</item>
</root>""",
})
view2 = self.View.create({
'name': "Extension",
'type': 'qweb',
'inherit_id': view1.id,
'arch': """
<data>
<xpath expr="/root/item/item" position="replace" />
<xpath expr="/root/item" position="inside">A<div/>B</xpath>
</data>
"""
})
arch_string = view1.with_context(inherit_branding=True).get_combined_arch()
arch = etree.fromstring(arch_string)
self.View.distribute_branding(arch)
expected = etree.fromstring(f"""
<root>
<item order="1">
A
<div data-oe-id="{view2.id}" data-oe-xpath="/data/xpath[2]/div" data-oe-model="ir.ui.view" data-oe-field="arch"/>
B
</item>
</root>
""")
self.assertEqual(arch, expected)
class TestViews(ViewCase):

View file

@ -217,7 +217,6 @@
<field name="name">Apps</field>
<field name="res_model">ir.module.module</field>
<field name="view_mode">kanban,tree,form</field>
<field name="domain">[("to_buy", "=", False)]</field>
<field name="context">{'search_default_app':1}</field>
<field name="search_view_id" ref="view_module_filter"/>
<field name="help" type="html">