_read_flat: remove duplicated fields in read call
get many2one: as False is instance of int, check the value of x first to avoid calling a name_get with a list of False
When we were reading twice a m2o field where at least one result is null, the first call to name_get would set the value to False instead of None and then accepted by the filter 'isinstance(x, (int,long))'
sale_order module override state field of sale.oder (sale.sale.py) and forgot to reset the track_visibility, therefore sale orders state changes are no longer tracked once this module installed.
This will make sure already processed rules are persisted
in case a timeout occurs while processing the next ones,
ensuring that *some* progress can be made in most cases.
A safety guard already in place prevents the recursive
trigger of rules while another rule is being executed,
as a simple measure to prevent endless loops.
This guard was missing when processing time-based rules.
A programming error introduced at rco@openerp.com-20121220142445-emzzvhlw400q37c9
fails to properly check when a rule has already been executed in the past.
Time-based rules should only be executed if the trigger date is in the past and:
- either they never executed before
- or the last execution date is older than the trigger date
Executing a rule always updates the `last_run` value, which would
always force a useless registry reload to occur. Only signal the
change if the rule applies to a model that was not previoulsy
monitored for base action rules.
The field note on account.fiscal.position and account.fiscal.position.template should not be translatable in classic modules.
The l10n_multilang module is intendend to make chart of accounts multilang and is the place to set translate=True
If the writeoff_amount is above 0, the fields writeoff_acc_id can be displayed and is required depending of the payment option. If the writeoff_amount is reset to 0, this field should no longer be required.
The get() method of m2o function fields is used for 2 different things:
- call the function defining the m2o
- get the name_get representation of the value
Until this pathc, only the first case was handled, resulting to a useless
recomputation of the field when reading it.
User should be at least have Configuration settings group to be allowed to create actions. Basic document page users do not have this rights, therefore we temporary give superuser_id to create the action
This is related to rev 133c5033a0
When uninstalling a module, remove the ir.model.constraint after removing the non-model records and before fields and model definition.
Without this fix, some constraint would be removed too early allowing to have broken relations and data left from removed module.
When creating a grouped invoice, the invoice_vals value is used to create the invoice line.
The value was not reset for grouped invoice and we reused the values of previous line.
Some browsers (e.g. chrome) trigger onEmptyClick as well as
onBeforeLightbox during drag&drop which calls two slow_create
calls (and two popups). Workaround to kill the second one.
[FIX] mail: detection of MIME type
When parsing the mail headers, the content-type may has a 'type' attribute for Multipart/Related objects (rfc2387).
Previous check would match on attached files of type text instead of real `content-type: text/`.
Be careful, content-type may contain tricky content like in the
following example so test the MIME type with startswith()
Content-Type: multipart/related;
boundary="_004_3f1e4da175f349248b8d43cdeb9866f1AMSPR06MB343eurprd06pro_";
type="text/html"
This restriction behavior copied from the sale.order model
Moreover, the purchase.order lines state were not set to cancel when the purchase order was cancelled.
This is now the case, this behavior is also coped from the sale.order model
When the purchase order is reset to draft, we also reset the order lines state to draft
[FIX] Fix o2m record duplication when clicking on a button
The button action will execute a write call, creating the new line.
The reload is necessary to avoid recreating the line when using the save button.