Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by jjscarafia
- Loading branch information
Showing
15 changed files
with
260 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
odoo_module_migrate/migration_scripts/removed_models/migrate_150_160/removed_models.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- ["account.account.type", "Commit https://github.com/odoo/odoo/commit/26b2472f4977ccedbb0b5ed5f"] |
1 change: 1 addition & 0 deletions
1
odoo_module_migrate/migration_scripts/renamed_models/migrate_150_160/renamed_models.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- ["stock.production.lot", "stock.lot", None] |
3 changes: 3 additions & 0 deletions
3
odoo_module_migrate/migration_scripts/text_replaces/migrate_150_160/orm_methods.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.py: | ||
\.get_xml_id\(: ".get_external_id(" | ||
\.fields_get_keys\(\): "._fields" |
16 changes: 16 additions & 0 deletions
16
tests/data_result/module_150_160/models/account_account_type.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class AccountAccountType(models.Model): | ||
_inherit = "account.account.type" | ||
|
||
analytic_account_required = fields.Boolean( | ||
string='Analytic Account Required?', | ||
help="If True, then an analytic account will be required when posting " | ||
"journal entries with this type of account.", | ||
) | ||
analytic_tag_required = fields.Boolean( | ||
string='Analytic Tag Required?', | ||
help="If True, then analytic tags will be required when posting " | ||
"journal entries with this type of account.", | ||
) |
22 changes: 22 additions & 0 deletions
22
tests/data_result/module_150_160/models/stock_production_lot.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from odoo import models, _ | ||
from odoo.exceptions import UserError | ||
|
||
|
||
class StockProductionLot(models.Model): | ||
_inherit = 'stock.lot' | ||
_barcode_field = 'name' | ||
|
||
def _get_stock_barcode_specific_data(self): | ||
products = self.product_id | ||
return { | ||
'product.product': products.read(self.env['product.product']._get_fields_stock_barcode(), load=False), | ||
'uom.uom': products.uom_id.read(self.env['uom.uom']._get_fields_stock_barcode(), load=False) | ||
} | ||
|
||
def _check_create(self): | ||
active_mo_id = self.env.context.get('active_mo_id') | ||
if active_mo_id: | ||
active_mo = self.env['mrp.production'].browse(active_mo_id) | ||
if not active_mo.picking_type_id.use_create_components_lots: | ||
raise UserError(_('You are not allowed to create or edit a lot or serial number for the components with the operation type "Manufacturing". To change this, go on the operation type and tick the box "Create New Lots/Serial Numbers for Components".')) | ||
return super()._check_create() |
2 changes: 2 additions & 0 deletions
2
tests/data_result/module_150_160/security/ir.model.access.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_stock_production_user,stock.production.lot,stock.model_stock_lot,quality.group_quality_user,1,0,0,0 |
33 changes: 33 additions & 0 deletions
33
tests/data_result/module_150_160/views/stock_report_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data> | ||
<record id="action_report_lot_label" model="ir.actions.report"> | ||
<field name="name">Lot/Serial Number (PDF)</field> | ||
<field name="model">stock.production.lot</field> | ||
<field name="report_type">qweb-pdf</field> | ||
<field name="report_name">stock.report_lot_label</field> | ||
<field name="report_file">stock.report_lot_label</field> | ||
<field name="print_report_name">'Lot-Serial - %s' % object.name</field> | ||
<field name="binding_model_id" ref="model_stock_lot"/> | ||
<field name="binding_type">report</field> | ||
</record> | ||
|
||
<record id="action_report_lot_label" model="ir.actions.report"> | ||
<field name="name">Lot/Serial Number (PDF)</field> | ||
<field name="model">stock.production.lot</field> | ||
<field name="report_type">qweb-pdf</field> | ||
<field name="report_name">stock.report_lot_label</field> | ||
<field name="report_file">stock.report_lot_label</field> | ||
<field name="print_report_name">'Lot-Serial - %s' % object.name</field> | ||
<field name="binding_model_id" ref='model_stock_lot'/> | ||
<field name="binding_type">report</field> | ||
</record> | ||
|
||
<record id="stock_lot" model="stock.lot"> | ||
<field name="name">0000000000003</field> | ||
<field name="product_id" ref="mrp.product_product_computer_desk"/> | ||
<field name="product_qty">1</field> | ||
<field name="company_id" ref="base.main_company"/> | ||
</record> | ||
</data> | ||
</odoo> |
16 changes: 16 additions & 0 deletions
16
tests/data_template/module_150/models/account_account_type.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class AccountAccountType(models.Model): | ||
_inherit = "account.account.type" | ||
|
||
analytic_account_required = fields.Boolean( | ||
string='Analytic Account Required?', | ||
help="If True, then an analytic account will be required when posting " | ||
"journal entries with this type of account.", | ||
) | ||
analytic_tag_required = fields.Boolean( | ||
string='Analytic Tag Required?', | ||
help="If True, then analytic tags will be required when posting " | ||
"journal entries with this type of account.", | ||
) |
22 changes: 22 additions & 0 deletions
22
tests/data_template/module_150/models/stock_production_lot.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from odoo import models, _ | ||
from odoo.exceptions import UserError | ||
|
||
|
||
class StockProductionLot(models.Model): | ||
_inherit = 'stock.production.lot' | ||
_barcode_field = 'name' | ||
|
||
def _get_stock_barcode_specific_data(self): | ||
products = self.product_id | ||
return { | ||
'product.product': products.read(self.env['product.product']._get_fields_stock_barcode(), load=False), | ||
'uom.uom': products.uom_id.read(self.env['uom.uom']._get_fields_stock_barcode(), load=False) | ||
} | ||
|
||
def _check_create(self): | ||
active_mo_id = self.env.context.get('active_mo_id') | ||
if active_mo_id: | ||
active_mo = self.env['mrp.production'].browse(active_mo_id) | ||
if not active_mo.picking_type_id.use_create_components_lots: | ||
raise UserError(_('You are not allowed to create or edit a lot or serial number for the components with the operation type "Manufacturing". To change this, go on the operation type and tick the box "Create New Lots/Serial Numbers for Components".')) | ||
return super()._check_create() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_stock_production_user,stock.production.lot,stock.model_stock_production_lot,quality.group_quality_user,1,0,0,0 |
33 changes: 33 additions & 0 deletions
33
tests/data_template/module_150/views/stock_report_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data> | ||
<record id="action_report_lot_label" model="ir.actions.report"> | ||
<field name="name">Lot/Serial Number (PDF)</field> | ||
<field name="model">stock.production.lot</field> | ||
<field name="report_type">qweb-pdf</field> | ||
<field name="report_name">stock.report_lot_label</field> | ||
<field name="report_file">stock.report_lot_label</field> | ||
<field name="print_report_name">'Lot-Serial - %s' % object.name</field> | ||
<field name="binding_model_id" ref="model_stock_production_lot"/> | ||
<field name="binding_type">report</field> | ||
</record> | ||
|
||
<record id="action_report_lot_label" model="ir.actions.report"> | ||
<field name="name">Lot/Serial Number (PDF)</field> | ||
<field name="model">stock.production.lot</field> | ||
<field name="report_type">qweb-pdf</field> | ||
<field name="report_name">stock.report_lot_label</field> | ||
<field name="report_file">stock.report_lot_label</field> | ||
<field name="print_report_name">'Lot-Serial - %s' % object.name</field> | ||
<field name="binding_model_id" ref='model_stock_production_lot'/> | ||
<field name="binding_type">report</field> | ||
</record> | ||
|
||
<record id="stock_production_lot" model="stock.production.lot"> | ||
<field name="name">0000000000003</field> | ||
<field name="product_id" ref="mrp.product_product_computer_desk"/> | ||
<field name="product_qty">1</field> | ||
<field name="company_id" ref="base.main_company"/> | ||
</record> | ||
</data> | ||
</odoo> |