Odoo 12 : How to generate the number, move_name, reference fields? - odoo-12

I migrate the module "account-invoice-merge" (code here https://github.com/OCA/account-invoicing/tree/10.0/account_invoice_merge) from Odoo 10 to Odoo 12. It works well but, it doesn't generate the number, move_name and reference fields, but I need those for accountacy and control. Can you help me?Thank you.

Related

How do I generate a fixed sized list of facts (duplicates included)?

I'm new to ASP & Clingo and I need to work on a project for school. I thought about some basic music generator.
For now, I need to generate notes (I'm sticking with C major for now). I also want to generate them randomly and I don't know how to do that. How can I make the following code generate a random sequence of notes (duplicates too)?
note(c;d;e;f;g;a;b).
20 { play(X) : note(X)} 30.
#show play/1.
So far, the code won't allow for more than 7 as the upper bound, because it won't show duplicate notes.
Current output: play(b) play(g) play(e) play(c)
Wanted output: play(d) play(g) play(f) ...[20-30 randomly generated notes]
I want to be able to add constraints later (such as this note should not be followed by that note, and so on). I appreciate any tips since I know so little about this.
An answer set is a set. The atoms have no order and duplicates are not possible because it is a set.
You want to guess one note for each beat.
beat(1..8).
1 { play(N,B) : note(N) } 1 :- beat(B).

protege set data range expression for a data properties

I have a data properties hasCode that can assume one of this values:
"1i"
"2i"
"3i"
"4i"
What is the expression that I have to write for get this restriction?
Thank you so much
{"1"^^xsd:int, "2"^^xsd:int, "3"^^xsd:int, "4"^^xsd:int}
This should do the trick.
Note: there's a bug in Protege 5 beta 21 that will not make this work. Either use Protege 5 beta 17 or wait for the next beta for this to work properly.

Error when i want insert a date in DB with laravel

I'm using laravel 5.1 with eloquent, i have a postgre database and i would like to insert an object with some date in. My start format date is like '15/10/2015', and i need to convert into 'Y-m-d'.
For that i use date mutators in my model, i add this line :
protected $dates = ['created_at', 'updated_at', 'prj_start_date', 'prj_end_date_init'];
I use an architecture with services and repositories so in my repository for create my object in DB i have this :
$this->model->create($data);
When i try to insert i have this error
InvalidArgumentException in Carbon.php line 425:
Unexpected data found.
Unexpected data found.
Data missing
in Carbon.php line 425
at Carbon::createFromFormat('Y-m-d H:i:s', '15/10/2015') in Model.php line 2959
at Model->asDateTime('15/10/2015') in Model.php line 2915
at Model->fromDateTime('15/10/2015') in Model.php line 2870
at Model->setAttribute('prj_start_date', '15/10/2015') in Model.php line 422
Why isn't work, i've miss something ?
Can someone help me please ?
In at Carbon::createFromFormat('Y-m-d H:i:s', '15/10/2015') in Model.php line 2959 it is pretty clear that somehow laravel hardcoded it's dates mutator. I suggest using a manual approach, converting your string into Carbon instance via:
Carbon::createFromFormat($format, $time, $tz);
for example assuming have a date field instead of timestamp:
Carbon::createFromFormat('d/m/Y', '15/10/2015');
ps. i did not have the time to test this yet. Nevertheless, learning from the source is much interesting right?
ps. you might interested in changing laravel's format just like the docs however, i suspect this will affect created_at and updated_at (also deleted_at) fields that by default is a timestamp instead of dates.
ps. right, i do forget to mention you had to include Carbon to your controller, just add use Carbon/Carbon

Magento import: Can not find required columns: sku

I am going nuts here with Magento's import function. I have created one template product within my store and then exported it, so I can see what the attributes look like. Next I used Pentaho Data Integration to transform our suppliers product list into that format.
The header row contains, like the export, the service columns (starting with an underline). Here is one record of what my generated data looks like:
sku,_store,_attribute_set,_type,_category,_root_category,_product_websites,color,cost,country_of_manufacture,created_at,custom_design,custom_design_from,custom_design_to,custom_layout_update,description,gallery,gift_message_available,has_options,image,image_label,manufacturer,media_gallery,meta_description,meta_keyword,meta_title,minimal_price,msrp,msrp_display_actual_price_type,msrp_enabled,name,news_from_date,news_to_date,options_container,page_layout,price,required_options,short_description,small_image,small_image_label,special_from_date,special_price,special_to_date,status,tax_class_id,thumbnail,thumbnail_label,updated_at,url_key,url_path,visibility,weight,qty,min_qty,use_config_min_qty,is_qty_decimal,backorders,use_config_backorders,min_sale_qty,use_config_min_sale_qty,max_sale_qty,use_config_max_sale_qty,is_in_stock,notify_stock_qty,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,stock_status_changed_auto,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,_links_related_sku,_links_related_position,_links_crosssell_sku,_links_crosssell_position,_links_upsell_sku,_links_upsell_position,_associated_sku,_associated_default_qty,_associated_position,_tier_price_website,_tier_price_customer_group,_tier_price_qty,_tier_price_price,_group_price_website,_group_price_customer_group,_group_price_price,_media_attribute_id,_media_image,_media_lable,_media_position,_media_is_disabled
4053258104446,,Default,simple,"Schmuck/Halsschmuck",Default Category,base,,,,25.07.2015 20:06,,,,,"Collier, PVC, braun, 42 cm, Karabinerverschluss 925/- S, Durchmesser ca. 2 mm",,,0,"35416.jpg",,"JOBO",,,,,,,"Konfiguration verwenden","Konfiguration verwenden","Collier PVC braun, Verschluss aus 925 Silber 42 cm Karabiner ",,,"Artikelinformationsspalte",,5,0,"Collier PVC braun, Verschluss aus 925 Silber 42 cm Karabiner","no_selection",,,,,1,2,"no_selection",,2015/07/25 20:06:32.291,,,4,,,,1,0,0,1,1,1,0,1,1,,1,0,1,0,1,0,1,0,0,,,,,,,,,,,,,,,,,,,,,
Magento complains with:
Can not find required columns: sku
I just don't see what might be wrong with my data. Obviously the sku is there, and my DB is empty! Things I have checked:
File-Encoding is UTF-8
Tried with LR and CR/LF
Strings are surrounded by "
Which fields are manadatory for an import? I just coudn't find anything within the documentation.
I have spent timeless hours on this. Any help is greatly appreciated!
Check if your column names are exactly the same as database names -
Moreover, encoding should be UTF-8 without BOM

QuickBase Perl API: Not able to edit a Record

I am trying to update a Quickbase record via my Perl script. I am following the Perl API documentation: http://metacpan.org/pod/HTTP::QuickBase
The method used for editing a record is "EditRecord". As per this method, you cannot edit built-in fields which is true.
and I know that I am not modifying built-in field but an user-created field.
e.g. I want to modify the field called "OS" to "Windows"
So per the Perl modules CPAN documentation mentioned above, I do this:
my %new_record=$qb_obj->GetRecord($database_id, $record_id);
$new_record{"OS"}="Windows";
$qb_obj->EditRecord($database_id, $record_id, %new_record);
But I get following error:
The field named "Date Created" with field id 1 cannot be modified
Which basically means that I ma trying to modify the field "Date Created" with Field ID "1". However, I am not doing that. It might be pulling that parameter some how. THe perl as well as the Quickbase documentation is not helping much.
Here is the Quickbase API documentation: http://www.quickbase.com/api-guide/edit_record.html#Overview
Can someone help me on this.
thanks.
Since you already know the id of the record, you don't need to read the record before modifying it. You should be able to just remove your first line, create the %new_record without reading it from QB, then your 2nd and 3rd lines should work fine.
The alternative is to remove the built-in QB fields from %new_record before doing the EditRecord.