-
-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
140 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from odoo import api, fields, models | ||
|
||
|
||
class Benefit(models.Model): | ||
_name = "l10n_br_fiscal.benefit" | ||
_inherit = "l10n_br_fiscal.data.abstract" | ||
|
||
benefit_code = fields.Char( | ||
string="Concatenated Code and Name", | ||
compute="_compute_benefit_code", | ||
store=True, | ||
) | ||
|
||
@api.depends("code", "name") | ||
def _compute_benefit_code(self): | ||
for record in self: | ||
if record.code and record.name: | ||
record.benefit_code = f"{record.code}{record.name}" | ||
else: | ||
record.benefit_code = record.code or record.name or "" |
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
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,28 @@ | ||
<?xml version='1.0' encoding='utf-8' ?> | ||
<odoo> | ||
<record id="benefit_code_tree" model="ir.ui.view"> | ||
<field name="name">l10n_br_fiscal.benefit.code.tree</field> | ||
<field name="model">l10n_br_fiscal.benefit</field> | ||
<field name="arch" type="xml"> | ||
<tree> | ||
<field name="code" /> | ||
<field name="name" /> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
<record id="benefit_code_form" model="ir.ui.view"> | ||
<field name="name">l10n_br_fiscal.benefit.code.form</field> | ||
<field name="model">l10n_br_fiscal.benefit</field> | ||
<field name="arch" type="xml"> | ||
<form string="Benefit Code"> | ||
<sheet> | ||
<group> | ||
<field name="code" /> | ||
<field name="name" /> | ||
</group> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
</odoo> |
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
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