Skip to content

Commit

Permalink
Add setting to confirm orders without record type
Browse files Browse the repository at this point in the history
Introduced a configurable option in res.config.settings to allow orders to be confirmed without specifying a record type. Updated translations and views accordingly, and refined associated security group definitions.
  • Loading branch information
dhongu committed Jan 18, 2025
1 parent 92fdbc2 commit f4b830d
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 12 deletions.
1 change: 1 addition & 0 deletions deltatech_record_type/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"views/purchase_view.xml",
"views/sale_view.xml",
"security/ir.model.access.csv",
"views/res_config_settings_views.xml"
],
# "demo": [
# "data/demo_data.xml",
Expand Down
27 changes: 21 additions & 6 deletions deltatech_record_type/i18n/ro.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0+e\n"
"Project-Id-Version: Odoo Server 17.0+ec\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-17 20:25+0000\n"
"PO-Revision-Date: 2025-01-17 20:25+0000\n"
"POT-Creation-Date: 2025-01-18 02:51+0000\n"
"PO-Revision-Date: 2025-01-18 02:51+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand All @@ -30,11 +30,26 @@ msgstr ""
msgid "Can Confirm Orders Without Record Type"
msgstr "Poate confirma comenzi fără tip comandă"

#. module: deltatech_record_type
#: model_terms:ir.ui.view,arch_db:deltatech_record_type.res_config_settings_view_form
msgid "Can confirm orders without record type"
msgstr "Poate confirma comenzi fără tip comandă"

#. module: deltatech_record_type
#: model:ir.model.fields.selection,name:deltatech_record_type.selection__record_type_default_values__field_type__char
msgid "Char"
msgstr ""

#. module: deltatech_record_type
#: model:ir.model,name:deltatech_record_type.model_res_config_settings
msgid "Config Settings"
msgstr "Setări de configurare"

#. module: deltatech_record_type
#: model:ir.model.fields,field_description:deltatech_record_type.field_res_config_settings__group_confirm_order_without_record_type
msgid "Confirmed without record type"
msgstr "Confirmat fără tip comandă"

#. module: deltatech_record_type
#: model:ir.model.fields,field_description:deltatech_record_type.field_record_type__create_uid
#: model:ir.model.fields,field_description:deltatech_record_type.field_record_type_default_values__create_uid
Expand Down Expand Up @@ -132,7 +147,7 @@ msgstr "Tipuri comandă"
#: model:ir.model,name:deltatech_record_type.model_purchase_order
#: model:ir.model.fields.selection,name:deltatech_record_type.selection__record_type__model__purchase_order
msgid "Purchase Order"
msgstr "Comandă achiziție"
msgstr "Comandă de achiziție"

#. module: deltatech_record_type
#: model:ir.model,name:deltatech_record_type.model_record_type
Expand All @@ -154,7 +169,7 @@ msgstr ""
#. module: deltatech_record_type
#: model:ir.model.fields.selection,name:deltatech_record_type.selection__record_type__model__sale_order
msgid "Sale Order"
msgstr "Comandă vânzare"
msgstr "Comandă de vânzare"

#. module: deltatech_record_type
#: model:ir.model,name:deltatech_record_type.model_record_type_default_values
Expand All @@ -164,7 +179,7 @@ msgstr "Valori implicite tip comandă de vânzare"
#. module: deltatech_record_type
#: model:ir.model,name:deltatech_record_type.model_sale_order
msgid "Sales Order"
msgstr "Comandă vânzare"
msgstr "Comandă de vânzare"

#. module: deltatech_record_type
#. odoo-python
Expand Down
2 changes: 2 additions & 0 deletions deltatech_record_type/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
from . import sale
from . import record_type
from . import purchase
from . import res_config_settings

13 changes: 13 additions & 0 deletions deltatech_record_type/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@


from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'

group_confirm_order_without_record_type = fields.Boolean(
string="Confirmed without record type",
implied_group='deltatech_record_type.group_confirm_order_without_record_type',
default=True,
)
8 changes: 2 additions & 6 deletions deltatech_record_type/security/record_type_security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
<odoo>
<record id="group_confirm_order_without_record_type" model="res.groups">
<field name="name">Can Confirm Orders Without Record Type</field>
<field name="category_id" ref="base.module_category_hidden" />
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin')), (4, ref('base.group_user'))]"
/>
<field name="category_id" ref="base.module_category_hidden"/>
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin')), (4, ref('base.default_user'))]"/>
</record>

</odoo>
16 changes: 16 additions & 0 deletions deltatech_record_type/views/res_config_settings_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="10"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//block[@name='quotation_order_setting_container']" position="inside">
<setting id="confirm_order_without_record_type" help="Can confirm orders without record type">
<field name="group_confirm_order_without_record_type"/>
</setting>
</xpath>
</field>
</record>
</odoo>

0 comments on commit f4b830d

Please sign in to comment.