Skip to content

Commit

Permalink
Merge pull request OCA#42 from burroaktoolinc/rl-oak-product
Browse files Browse the repository at this point in the history
[FIX] Installable oak_product & fixes to cnc_info
  • Loading branch information
auroraeosrose authored Apr 4, 2023
2 parents 0fbf673 + 18379ef commit 7147c41
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 7 deletions.
3 changes: 2 additions & 1 deletion addons/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
| oak_boti_ui | local | BOTI | UI Alterations for BOTI |
| oak_crm | local | BOTI | CRM lead field additions |
| oak_partner | local | BOTI | Partner additional fields and tracking |
| oak_product | local | BOTI | Adds a Product App with links to product listing, adds additional product fields |
| oak_maintenance | local | BOTI | Sage info for equipment |
| oak_redis_session | local | BOTI | Redis for session |
| oak_visits | local | BOTI | BOTI Customizations for acs_visits |
Expand Down Expand Up @@ -62,7 +63,7 @@
| sale_order_revision | OCA | sale-workflow | sales order revisions via cancel/new from cancelled |
| sale_parnter_incoterm | OCA | sale-workflow | incoterms for sales orders and contacts |
| sale_procurement_group_by_line | OCA | sale-workflow | dep for delivery_split_date |
| sale_product_approval | OCA | sale-workflow | dep for sale_product_approval_mrp |
| sale_partner_approval | OCA | sale-workflow | Control Partners that can be used in Sales Orders |
| sale_product_approval_mrp | OCA | sale-workflow | product can be manufactured, a component of a manufacturing order or on a bom in the particular state |
| scrap_reason_code | stock-logistics-warehouse | OCA | Adds a reason code for scrapping operations |
| stock_delivery_note | stock-logistics-workflow | OCA | Adds a delivery note in stock pickings. Displayed on delivery reports. |
Expand Down
1 change: 1 addition & 0 deletions addons/oak_product
1 change: 1 addition & 0 deletions boti/oak_product/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"depends": [
"base",
"product",
"product_state",
],
"data": [
"security/security.xml",
Expand Down
8 changes: 6 additions & 2 deletions boti/oak_product/models/product_cnc_info_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ class ProductCNCInfoLine(models.Model):
cnc_length = fields.Float(string="CNC - Length")
cnc_diameter = fields.Float(string="CNC - Diameter")
workcenter_id = fields.Many2one("mrp.workcenter", "Work Center")
department_id = fields.Many2one(readonly=True, compute="_compute_department_id")
department_id = fields.Char(
readonly=True, string="Department", compute="_compute_department_id"
)

# Related field on department id caused circular dependency
# The purpose of this is to prevent that
@api.depends("workcenter_id")
def _compute_department_id(self):
for record in self:
if "department_id" in self.env["mrp.workcenter"]._fields:
record.department_id = record.workcenter_id.department_id
record.department_id = record.workcenter_id.department_id.name
else:
record.department_id = "None"
36 changes: 32 additions & 4 deletions boti/oak_product/views/product.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@
options="{'no_create': True}"
/>
</group>
<group>
<!-- TODO REMOVE COMMENT WHEN CANDIDATE ARE IN <group>
<separator string="Candidate Options" />
<field name="can_edit_candidate" invisible="True" />
<field name="candidate_sale" />
<field name="candidate_bom" />
</group>
</group> -->
<group name="sys_info">
<field
name="create_date"
Expand Down Expand Up @@ -271,8 +271,35 @@
<field name="domain">[('product_tmpl_id', '=', active_id)]</field>
</record>

<!-- Product (product.template) and variant (product.product) common-->
<!-- NOT CORRECT Product (product.template) and variant (product.product) common-->
<record id="product_template_form_view_inherit_mrp" model="ir.ui.view">
<field name="name">product.template.form.inherit.mrp</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field eval="110" name="priority" />
<field name="arch" type="xml">
<page name="inventory" position="before">
<page string="Manufacturing" name="manufacturing" invisible="0">
<separator
colspan="4"
string="CNC Information"
name="cnc_info_lines"
/>
<field name="cnc_info_line" widget="one2many">
<tree name="CNC Programs" editable="bottom">
<field name="name" />
<field name="cnc_length" />
<field name="cnc_diameter" />
<field name="workcenter_id" />
<field name="department_id" />
</tree>
</field>
</page>
</page>
</field>
</record>

<!-- TODO REPLACE ABOVE WITH THIS WHEN SALE sale_product_approval IS IN<record id="product_template_form_view_inherit_mrp" model="ir.ui.view">
<field name="name">product.template.form.inherit.mrp</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
Expand Down Expand Up @@ -303,5 +330,6 @@
</page>
</page>
</field>
</record>
</record> -->

</odoo>

0 comments on commit 7147c41

Please sign in to comment.