Wednesday, September 19, 2018
6 changes · master
Enhancements to existing features
Email scheduling now stores scheduled send times as proper date and time values instead of plain text. This makes scheduled emails easier for the system to process reliably and supports more accurate timing-related behavior.
Original PR description
Description of the issue/feature this PR addresses: scheduled_date changed to fields.Datetime Current behavior before PR: scheduled_date was fields.Char earlier Desired behavior after PR is merged: scheduled_date changed to fields.Datetime for effective use -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Point of Sale settings now let users choose from existing IoT boxes instead of manually entering an IP address. This reduces setup errors and makes hardware configuration easier, while making IoT a required dependency for Point of Sale.
Original PR description
Instead of typing the IP address of the box, the user will have to select an existing IoT box !! IoT as a dependency of Point of Sale !! Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Email scheduling fields now use a proper date and time format instead of plain text. This should make scheduled email setup more reliable and easier to use, especially when choosing dates and times.
Original PR description
Description of the issue/feature this PR addresses: scheduled_date fields from mail.mail and mail.template changed to fields.Datetime from fields.Char Current behavior before PR: When creating record in mail.mail or mail.template object, field scheduled_date is of type fields.Char Desired behavior after PR is merged: scheduled_date field changed to fields.Datetime for better datetime picking -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This change lets Odoo automatically update certain saved fields when related information changes, while still allowing users to override those values when needed. It reduces duplicated update logic and makes record creation and editing behave more consistently across forms and automated processes.
Original PR description
The idea is to avoid 'onchange' methods and replace them by 'compute' methods. Instead of fiscal_position = fields.Many2one('account.fiscal.position', string='Fiscal Position', readonly=True,…
The idea is to avoid 'onchange' methods and replace them by 'compute' methods.
Instead of
fiscal_position = fields.Many2one('account.fiscal.position', string='Fiscal Position',
readonly=True, states={'draft': [('readonly', False)]})
@api.onchange('partner_id')
def onchange_partner_fiscal_position(self):
self.fiscal_position = self.partner_id.property_account_position
we define
fiscal_position = fields.Many2one('account.fiscal.position', string='Fiscal Position',
compute='_compute_fiscal_position', store=True,
readonly=True, states={'draft': [('readonly', False)]})
@api.one
@api.depends('partner_id.property_account_position')
def _compute_fiscal_position(self):
self.fiscal_position = self.partner_id.property_account_position
So the onchange is defined as a computed field that can be modified by the user.
Behavior
an onchange triggered on 'partner_id' automatically invalidates 'fiscal_position' and recomputes it
write({'partner_id': pid}) automatically invalidates 'fiscal_position' and recomputes it
write({'partner_id': pid, 'fiscal_position': fp}) does not recompute 'fiscal_position'
create({'partner_id': pid}) automatically computes 'fiscal_position'
create({'partner_id': pid, 'fiscal_position': fp}) does not recompute 'fiscal_position'
The behavior covers:
onchange methods: potentially all onchange methods can be expressed as compute methods
create() and write() behave as if they had executed the onchange methods
Technically speaking
target: master
modify create() and write() to compute fields not provided but with a compute method
modify the field setup:
compute=... does not imply store=False
compute=... does not imply readonly=True
adapt documentationResolved issues and error corrections
This fix corrects a format conversion issue that prevented users from creating journals. After the change, journals can be created successfully and their related sequence is generated as expected.
Original PR description
Description of the issue/feature this PR addresses: Fix error in bad use of converting formats Current behavior before PR: Cant create a journal Desired behavior after PR is merged: Allow create journal and its sequence is created -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This change stops Odoo from automatically installing a generic accounting setup when a specific country localization module is already queued for installation. It helps new deployments, especially on Odoo.sh, start with the intended local accounting rules instead of requiring manual cleanup or reconfiguration.
Original PR description
# Steps 1. Create an odoo.sh configuration 2. List of modules to install use: l10n_mx  #…
# Steps 1. Create an odoo.sh configuration 2. List of modules to install use: l10n_mx  # Saw generic_coa is installed. # Expected generic_coa not installed since that we want to use l10n_mx and odoo.sh doesn't allow us to choose a `company.country` early. Currently, this behavior is working fine if you have the option to choose the country from the startup wizard -  - In order to auto-install the l10n_COUNTRY: - https://github.com/odoo/odoo/blob/f2b8caff07ba41b851ae9d5015e317753f3eb1a1/addons/account/__init__.py#L16 But odoo.sh settings doesn't have the option to choose a country. Another option is to use a Environment Variable to set early the company country from [company_country](https://github.com/Vauxoo/server-tools/blob/bf96d2cfce812a96da99956ad6a188401c7d98cc/company_country/models/res_config.py#L16) module, but I don't found an option to set environment variables from odoo.sh Another option is to install manually all modules (first changing the company.country) for each dev deploy, but it is consuming time. This PR avoid auto-install l10n_** module if in the list of modules to install there are one or more l10n_* modules. What do you think? @qdp-odoo @antonylesuisse @mart-e @beledouxdenis