Browse Source
Merge pull request #84 from coopiteasy/12.0-setup-travis
Merge pull request #84 from coopiteasy/12.0-setup-travis
[12.0] MAKE TRAVIS GREEN AGAINpull/85/head
Robin Keunen
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
255 changed files with 19543 additions and 9688 deletions
-
291.eslintrc
-
10.flake8
-
27.gitignore
-
12.isort.cfg
-
69.pre-commit-config.yaml
-
86.pylintrc
-
64.pylintrc-mandatory
-
34.travis.yml
-
42README.md
-
58easy_my_coop/README.rst
-
6easy_my_coop/__init__.py
-
101easy_my_coop/__manifest__.py
-
87easy_my_coop/data/easy_my_coop_data.xml
-
940easy_my_coop/data/mail_template_data.xml
-
4easy_my_coop/data/paperformat.xml
-
34easy_my_coop/demo/coop.xml
-
6easy_my_coop/demo/users.xml
-
59easy_my_coop/migrations/8.0.1.0/pre-migration.py
-
372easy_my_coop/models/account_invoice.py
-
27easy_my_coop/models/account_journal.py
-
176easy_my_coop/models/company.py
-
1714easy_my_coop/models/coop.py
-
2easy_my_coop/models/mail_template.py
-
771easy_my_coop/models/operation_request.py
-
202easy_my_coop/models/partner.py
-
78easy_my_coop/models/product.py
-
29easy_my_coop/models/res_partner_bank.py
-
1easy_my_coop/readme/CONTRIBUTORS.rst
-
1easy_my_coop/readme/DESCRIPTION.rst
-
32easy_my_coop/report/account_invoice_report.py
-
35easy_my_coop/report/cooperator_certificat_G001.xml
-
136easy_my_coop/report/cooperator_invoice_G002.xml
-
250easy_my_coop/report/cooperator_register_G001.xml
-
222easy_my_coop/report/cooperator_subscription_G001.xml
-
76easy_my_coop/report/easy_my_coop_report.xml
-
65easy_my_coop/report/layout.xml
-
32easy_my_coop/security/ir.model.access.csv
-
6easy_my_coop/security/res_groups.xml
-
414easy_my_coop/static/description/index.html
-
54easy_my_coop/static/src/css/coop_report.css
-
100easy_my_coop/static/src/js/easy_my_coop.js
-
3125easy_my_coop/static/src/js/jquery.inputmask.bundle.js
-
5easy_my_coop/tests/test_emc.py
-
166easy_my_coop/views/account_invoice_view.xml
-
54easy_my_coop/views/account_journal_view.xml
-
161easy_my_coop/views/cooperator_register_view.xml
-
30easy_my_coop/views/email_template_view.xml
-
62easy_my_coop/views/menus.xml
-
238easy_my_coop/views/operation_request_view.xml
-
321easy_my_coop/views/product_view.xml
-
69easy_my_coop/views/res_company_view.xml
-
396easy_my_coop/views/res_partner_view.xml
-
439easy_my_coop/views/subscription_request_view.xml
-
10easy_my_coop/wizard/account_invoice_refund.py
-
83easy_my_coop/wizard/cooperative_history_wizard.xml
-
216easy_my_coop/wizard/create_subscription_from_partner.py
-
41easy_my_coop/wizard/create_subscription_from_partner.xml
-
49easy_my_coop/wizard/update_partner_info.py
-
27easy_my_coop/wizard/update_partner_info.xml
-
44easy_my_coop/wizard/update_share_line.py
-
76easy_my_coop/wizard/update_share_line.xml
-
8easy_my_coop/wizard/validate_subscription_request.py
-
17easy_my_coop/wizard/validate_subscription_request.xml
-
58easy_my_coop_be/README.rst
-
2easy_my_coop_be/__init__.py
-
19easy_my_coop_be/__manifest__.py
-
4easy_my_coop_be/models/__init__.py
-
53easy_my_coop_be/models/coop.py
-
24easy_my_coop_be/models/partner.py
-
1easy_my_coop_be/readme/CONTRIBUTORS.rst
-
1easy_my_coop_be/readme/DESCRIPTION.rst
-
414easy_my_coop_be/static/description/index.html
-
55easy_my_coop_ch/README.rst
-
2easy_my_coop_ch/__init__.py
-
46easy_my_coop_ch/__manifest__.py
-
4easy_my_coop_ch/models/__init__.py
-
47easy_my_coop_ch/models/coop.py
-
34easy_my_coop_ch/models/partner.py
-
2easy_my_coop_ch/readme/CONTRIBUTORS.rst
-
1easy_my_coop_ch/readme/DESCRIPTION.rst
-
414easy_my_coop_ch/static/description/index.html
-
63easy_my_coop_ch/views/certificate_template.xml
-
65easy_my_coop_ch/views/subscription_template.xml
-
62easy_my_coop_dividend/README.rst
-
1easy_my_coop_dividend/__init__.py
-
38easy_my_coop_dividend/__manifest__.py
-
1easy_my_coop_dividend/models/__init__.py
-
403easy_my_coop_dividend/models/dividend.py
-
2easy_my_coop_dividend/readme/CONTRIBUTORS.rst
-
3easy_my_coop_dividend/readme/DESCRIPTION.rst
-
2easy_my_coop_dividend/security/ir.model.access.csv
-
419easy_my_coop_dividend/static/description/index.html
-
349easy_my_coop_dividend/views/dividend_views.xml
-
54easy_my_coop_eater/README.rst
-
2easy_my_coop_eater/__init__.py
-
17easy_my_coop_eater/__manifest__.py
-
35easy_my_coop_eater/__openerp__.py
-
4easy_my_coop_eater/models/__init__.py
-
57easy_my_coop_eater/models/coop.py
-
20easy_my_coop_eater/models/product.py
@ -0,0 +1,291 @@ |
|||
{ |
|||
"globals": { |
|||
"$": false, |
|||
"_": false, |
|||
"fuzzy": false, |
|||
"jQuery": false, |
|||
"moment": false, |
|||
"odoo": false, |
|||
"openerp": false, |
|||
"self": false |
|||
}, |
|||
"env": { |
|||
"browser": true |
|||
}, |
|||
"rules": { |
|||
"no-alert": "warn", |
|||
"no-array-constructor": "warn", |
|||
"no-bitwise": "off", |
|||
"no-caller": "warn", |
|||
"no-case-declarations": "warn", |
|||
"no-catch-shadow": "warn", |
|||
"no-class-assign": "warn", |
|||
"no-cond-assign": "warn", |
|||
"no-confusing-arrow": "warn", |
|||
"no-console": "off", |
|||
"no-const-assign": "warn", |
|||
"no-constant-condition": "warn", |
|||
"no-continue": "off", |
|||
"no-control-regex": "warn", |
|||
"no-debugger": "warn", |
|||
"no-delete-var": "warn", |
|||
"no-div-regex": "warn", |
|||
"no-dupe-args": "warn", |
|||
"no-dupe-class-members": "warn", |
|||
"no-dupe-keys": "warn", |
|||
"no-duplicate-case": "warn", |
|||
"no-duplicate-imports": "warn", |
|||
"no-else-return": "warn", |
|||
"no-empty": "warn", |
|||
"no-empty-character-class": "warn", |
|||
"no-empty-function": "warn", |
|||
"no-empty-pattern": "warn", |
|||
"no-eq-null": "warn", |
|||
"no-eval": "warn", |
|||
"no-ex-assign": "warn", |
|||
"no-extend-native": "warn", |
|||
"no-extra-bind": "warn", |
|||
"no-extra-boolean-cast": "warn", |
|||
"no-extra-label": "warn", |
|||
"no-extra-parens": "warn", |
|||
"no-extra-semi": "warn", |
|||
"no-fallthrough": "warn", |
|||
"no-floating-decimal": "warn", |
|||
"no-func-assign": "warn", |
|||
"no-implicit-coercion": ["warn", { |
|||
"allow": ["~"] |
|||
}], |
|||
"no-implicit-globals": "warn", |
|||
"no-implied-eval": "warn", |
|||
"no-inline-comments": "warn", |
|||
"no-inner-declarations": "warn", |
|||
"no-invalid-regexp": "warn", |
|||
"no-invalid-this": "off", |
|||
"no-irregular-whitespace": "warn", |
|||
"no-iterator": "warn", |
|||
"no-label-var": "warn", |
|||
"no-labels": "warn", |
|||
"no-lone-blocks": "warn", |
|||
"no-lonely-if": "warn", |
|||
"no-loop-func": "off", |
|||
"no-magic-numbers": "off", |
|||
"no-mixed-operators": "warn", |
|||
"no-mixed-requires": "warn", |
|||
"no-mixed-spaces-and-tabs": "warn", |
|||
"no-multi-spaces": "warn", |
|||
"no-multi-str": "warn", |
|||
"no-multiple-empty-lines": "warn", |
|||
"no-native-reassign": "warn", |
|||
"no-negated-condition": "warn", |
|||
"no-negated-in-lhs": "warn", |
|||
"no-nested-ternary": "off", |
|||
"no-new": "warn", |
|||
"no-new-func": "warn", |
|||
"no-new-object": "warn", |
|||
"no-new-require": "warn", |
|||
"no-new-symbol": "warn", |
|||
"no-new-wrappers": "warn", |
|||
"no-obj-calls": "warn", |
|||
"no-octal": "warn", |
|||
"no-octal-escape": "warn", |
|||
"no-param-reassign": "warn", |
|||
"no-path-concat": "warn", |
|||
"no-plusplus": "off", |
|||
"no-process-env": "warn", |
|||
"no-process-exit": "warn", |
|||
"no-proto": "warn", |
|||
"no-prototype-builtins": "warn", |
|||
"no-redeclare": "warn", |
|||
"no-regex-spaces": "warn", |
|||
"no-restricted-globals": "warn", |
|||
"no-restricted-imports": "warn", |
|||
"no-restricted-modules": "warn", |
|||
"no-restricted-syntax": "warn", |
|||
"no-return-assign": "warn", |
|||
"no-script-url": "warn", |
|||
"no-self-assign": "warn", |
|||
"no-self-compare": "warn", |
|||
"no-sequences": "warn", |
|||
"no-shadow": "warn", |
|||
"no-shadow-restricted-names": "warn", |
|||
"no-whitespace-before-property": "warn", |
|||
"no-spaced-func": "warn", |
|||
"no-sparse-arrays": "warn", |
|||
"no-sync": "warn", |
|||
"no-tabs": "warn", |
|||
"no-ternary": "off", |
|||
"no-trailing-spaces": "warn", |
|||
"no-this-before-super": "warn", |
|||
"no-throw-literal": "warn", |
|||
"no-undef": "warn", |
|||
"no-undef-init": "warn", |
|||
"no-undefined": "off", |
|||
"no-unexpected-multiline": "warn", |
|||
"no-underscore-dangle": "off", |
|||
"no-unmodified-loop-condition": "warn", |
|||
"no-unneeded-ternary": "warn", |
|||
"no-unreachable": "warn", |
|||
"no-unsafe-finally": "warn", |
|||
"no-unused-expressions": "warn", |
|||
"no-unused-labels": "warn", |
|||
"no-unused-vars": "warn", |
|||
"no-use-before-define": "warn", |
|||
"no-useless-call": "warn", |
|||
"no-useless-computed-key": "warn", |
|||
"no-useless-concat": "warn", |
|||
"no-useless-constructor": "warn", |
|||
"no-useless-escape": "warn", |
|||
"no-useless-rename": "warn", |
|||
"no-void": "warn", |
|||
"no-var": "off", |
|||
"no-warning-comments": "off", |
|||
"no-with": "warn", |
|||
"array-bracket-spacing": "off", |
|||
"array-callback-return": "warn", |
|||
"arrow-body-style": "warn", |
|||
"arrow-parens": "warn", |
|||
"arrow-spacing": "off", |
|||
"accessor-pairs": "warn", |
|||
"block-scoped-var": "off", |
|||
"block-spacing": ["warn", "always"], |
|||
"brace-style": "warn", |
|||
"callback-return": "warn", |
|||
"camelcase": "off", |
|||
"capitalized-comments": ["warn", "always", { |
|||
"ignoreConsecutiveComments": true, |
|||
"ignoreInlineComments": true |
|||
}], |
|||
"comma-dangle": ["warn", "always-multiline"], |
|||
"comma-spacing": ["warn", { |
|||
"before": false, |
|||
"after": true |
|||
}], |
|||
"comma-style": "warn", |
|||
"complexity": [ |
|||
"warn", |
|||
15 |
|||
], |
|||
"computed-property-spacing": "off", |
|||
"consistent-return": "off", |
|||
"consistent-this": "off", |
|||
"constructor-super": "warn", |
|||
"curly": "warn", |
|||
"default-case": "off", |
|||
"dot-location": ["warn", "property"], |
|||
"dot-notation": "warn", |
|||
"eol-last": "warn", |
|||
"eqeqeq": "warn", |
|||
"func-names": "off", |
|||
"func-style": "off", |
|||
"generator-star-spacing": "off", |
|||
"global-require": "warn", |
|||
"guard-for-in": "off", |
|||
"handle-callback-err": "warn", |
|||
"id-blacklist": "warn", |
|||
"id-length": "off", |
|||
"id-match": "warn", |
|||
"indent": "warn", |
|||
"init-declarations": "warn", |
|||
"jsx-quotes": "warn", |
|||
"key-spacing": "off", |
|||
"keyword-spacing": "warn", |
|||
"linebreak-style": [ |
|||
"warn", |
|||
"unix" |
|||
], |
|||
"lines-around-comment": "warn", |
|||
"max-depth": "warn", |
|||
"max-len": ["warn", { |
|||
"code": 88, |
|||
"ignorePattern": "odoo\\.define\\(", |
|||
"tabWidth": 4 |
|||
}], |
|||
"max-lines": "off", |
|||
"max-nested-callbacks": "warn", |
|||
"max-params": "off", |
|||
"max-statements": "off", |
|||
"max-statements-per-line": "warn", |
|||
"multiline-ternary": "off", |
|||
"new-cap": "off", |
|||
"new-parens": "warn", |
|||
"newline-after-var": "off", |
|||
"newline-before-return": "off", |
|||
"newline-per-chained-call": "off", |
|||
"object-curly-newline": ["warn", { "consistent": true }], |
|||
"object-curly-spacing": ["warn", "never"], |
|||
"object-property-newline": ["warn", { |
|||
"allowAllPropertiesOnSameLine": true |
|||
}], |
|||
"object-shorthand": "off", |
|||
"one-var": "off", |
|||
"one-var-declaration-per-line": "off", |
|||
"operator-assignment": "warn", |
|||
"operator-linebreak": "warn", |
|||
"padded-blocks": "off", |
|||
"prefer-arrow-callback": "off", |
|||
"prefer-const": "warn", |
|||
"prefer-reflect": "off", |
|||
"prefer-rest-params": "off", |
|||
"prefer-spread": "off", |
|||
"prefer-template": "off", |
|||
"quote-props": "off", |
|||
"quotes": "off", |
|||
"radix": "warn", |
|||
"require-yield": "warn", |
|||
"rest-spread-spacing": "off", |
|||
"semi": [ |
|||
"warn", |
|||
"always" |
|||
], |
|||
"semi-spacing": "warn", |
|||
"sort-imports": "warn", |
|||
"sort-vars": "off", |
|||
"space-before-blocks": "warn", |
|||
"space-before-function-paren": "warn", |
|||
"space-in-parens": "off", |
|||
"space-infix-ops": "off", |
|||
"space-unary-ops": "off", |
|||
"spaced-comment": ["warn", "always"], |
|||
"strict": ["warn", "function"], |
|||
"template-curly-spacing": "off", |
|||
"unicode-bom": "warn", |
|||
"use-isnan": "warn", |
|||
"valid-jsdoc": ["warn", { |
|||
"prefer": { |
|||
"arg": "param", |
|||
"argument": "param", |
|||
"augments": "extends", |
|||
"constructor": "class", |
|||
"exception": "throws", |
|||
"func": "function", |
|||
"method": "function", |
|||
"prop": "property", |
|||
"return": "returns", |
|||
"virtual": "abstract", |
|||
"yield": "yields" |
|||
}, |
|||
"preferType": { |
|||
"array": "Array", |
|||
"bool": "Boolean", |
|||
"boolean": "Boolean", |
|||
"number": "Number", |
|||
"object": "Object", |
|||
"str": "String", |
|||
"string": "String" |
|||
}, |
|||
"requireParamDescription": false, |
|||
"requireReturn": false, |
|||
"requireReturnDescription": false, |
|||
"requireReturnType": false |
|||
}], |
|||
"valid-typeof": "warn", |
|||
"vars-on-top": "off", |
|||
"wrap-iife": "warn", |
|||
"wrap-regex": "warn", |
|||
"yield-star-spacing": "off", |
|||
"yoda": "warn" |
|||
}, |
|||
"parserOptions": { |
|||
"ecmaVersion": 2017 |
|||
} |
|||
} |
@ -0,0 +1,10 @@ |
|||
[flake8] |
|||
max-line-length = 79 |
|||
max-complexity = 16 |
|||
# B = bugbear |
|||
# B9 = bugbear opinionated (incl line length) |
|||
select = C,E,F,W,B,B9 |
|||
# E203: whitespace before ':' (black behaviour) |
|||
# E501: flake8 line length (covered by bugbear B950) |
|||
# W503: line break before binary operator (black behaviour) |
|||
ignore = E203,E501,W503 |
@ -0,0 +1,12 @@ |
|||
[settings] |
|||
; see https://github.com/psf/black |
|||
multi_line_output=3 |
|||
include_trailing_comma=True |
|||
force_grid_wrap=0 |
|||
combine_as_imports=True |
|||
use_parentheses=True |
|||
line_length=79 |
|||
known_odoo=odoo |
|||
known_odoo_addons=odoo.addons |
|||
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER |
|||
known_third_party=addons,cStringIO,openerp,requests,werkzeug,xlsxwriter |
@ -0,0 +1,69 @@ |
|||
exclude: "^setup/|/static/lib/|/static/src/lib/" |
|||
default_language_version: |
|||
python: python3 |
|||
repos: |
|||
- repo: https://github.com/psf/black |
|||
rev: 19.3b0 |
|||
hooks: |
|||
- id: black |
|||
args: [-l 79] |
|||
- repo: https://github.com/pre-commit/pre-commit-hooks |
|||
rev: v2.3.0 |
|||
hooks: |
|||
- id: trailing-whitespace |
|||
# exclude autogenerated files |
|||
exclude: /README\.rst$|\.pot?$ |
|||
- id: end-of-file-fixer |
|||
# exclude autogenerated files |
|||
exclude: /README\.rst$|\.pot?$ |
|||
- id: debug-statements |
|||
- id: flake8 |
|||
name: flake8 except __init__.py |
|||
exclude: /__init__\.py$ |
|||
additional_dependencies: ["flake8-bugbear==19.8.0"] |
|||
- id: flake8 |
|||
name: flake8 only __init__.py |
|||
args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py |
|||
files: /__init__\.py$ |
|||
additional_dependencies: ["flake8-bugbear==19.8.0"] |
|||
- id: fix-encoding-pragma |
|||
args: ["--remove"] |
|||
- id: check-case-conflict |
|||
- id: check-docstring-first |
|||
- id: check-executables-have-shebangs |
|||
- id: check-merge-conflict |
|||
- id: check-symlinks |
|||
# - id: check-xml |
|||
- id: mixed-line-ending |
|||
args: ["--fix=lf"] |
|||
- repo: https://github.com/pre-commit/mirrors-pylint |
|||
rev: v2.3.1 |
|||
hooks: |
|||
- id: pylint |
|||
name: pylint with optional checks |
|||
args: ["--rcfile=.pylintrc", "--exit-zero"] |
|||
verbose: true |
|||
additional_dependencies: ["pylint-odoo==3.0.3"] |
|||
- id: pylint |
|||
name: pylint with mandatory checks |
|||
args: ["--rcfile=.pylintrc-mandatory"] |
|||
additional_dependencies: ["pylint-odoo==3.0.3"] |
|||
- repo: https://github.com/asottile/pyupgrade |
|||
rev: v1.24.0 |
|||
hooks: |
|||
- id: pyupgrade |
|||
- repo: https://github.com/asottile/seed-isort-config |
|||
rev: v1.9.3 |
|||
hooks: |
|||
- id: seed-isort-config |
|||
- repo: https://github.com/pre-commit/mirrors-isort |
|||
rev: v4.3.21 |
|||
hooks: |
|||
- id: isort |
|||
name: isort except __init__.py |
|||
exclude: /__init__\.py$ |
|||
#- repo: https://github.com/pre-commit/mirrors-eslint |
|||
# rev: v6.5.1 |
|||
# hooks: |
|||
# - id: eslint |
|||
# verbose: true |
@ -0,0 +1,86 @@ |
|||
[MASTER] |
|||
load-plugins=pylint_odoo |
|||
score=n |
|||
|
|||
[ODOOLINT] |
|||
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" |
|||
# manifest_required_authors= |
|||
manifest_required_keys=license |
|||
manifest_deprecated_keys=description,active |
|||
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3 |
|||
valid_odoo_versions=12.0 |
|||
|
|||
[MESSAGES CONTROL] |
|||
disable=all |
|||
|
|||
# This .pylintrc contains optional AND mandatory checks and is meant to be |
|||
# loaded in an IDE to have it check everything, in the hope this will make |
|||
# optional checks more visible to contributors who otherwise never look at a |
|||
# green travis to see optional checks that failed. |
|||
# .pylintrc-mandatory containing only mandatory checks is used the pre-commit |
|||
# config as a blocking check. |
|||
|
|||
enable=anomalous-backslash-in-string, |
|||
api-one-deprecated, |
|||
api-one-multi-together, |
|||
assignment-from-none, |
|||
attribute-deprecated, |
|||
class-camelcase, |
|||
dangerous-default-value, |
|||
dangerous-view-replace-wo-priority, |
|||
duplicate-id-csv, |
|||
duplicate-key, |
|||
duplicate-xml-fields, |
|||
duplicate-xml-record-id, |
|||
eval-referenced, |
|||
eval-used, |
|||
incoherent-interpreter-exec-perm, |
|||
license-allowed, |
|||
manifest-author-string, |
|||
manifest-deprecated-key, |
|||
manifest-required-key, |
|||
manifest-version-format, |
|||
method-compute, |
|||
method-inverse, |
|||
method-required-super, |
|||
method-search, |
|||
missing-import-error, |
|||
missing-manifest-dependency, |
|||
openerp-exception-warning, |
|||
pointless-statement, |
|||
pointless-string-statement, |
|||
print-used, |
|||
redundant-keyword-arg, |
|||
redundant-modulename-xml, |
|||
reimported, |
|||
relative-import, |
|||
return-in-init, |
|||
rst-syntax-error, |
|||
sql-injection, |
|||
too-few-format-args, |
|||
translation-field, |
|||
translation-required, |
|||
unreachable, |
|||
use-vim-comment, |
|||
wrong-tabs-instead-of-spaces, |
|||
xml-syntax-error, |
|||
# messages that do not cause the lint step to fail |
|||
consider-merging-classes-inherited, |
|||
create-user-wo-reset-password, |
|||
dangerous-filter-wo-user, |
|||
deprecated-module, |
|||
file-not-used, |
|||
invalid-commit, |
|||
missing-newline-extrafiles, |
|||
missing-readme, |
|||
no-utf8-coding-comment, |
|||
odoo-addons-relative-import, |
|||
old-api7-method-defined, |
|||
redefined-builtin, |
|||
too-complex, |
|||
unnecessary-utf8-coding-comment |
|||
|
|||
[REPORTS] |
|||
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} |
|||
output-format=colorized |
|||
reports=no |
@ -0,0 +1,64 @@ |
|||
[MASTER] |
|||
load-plugins=pylint_odoo |
|||
score=n |
|||
|
|||
[ODOOLINT] |
|||
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" |
|||
# manifest_required_authors= |
|||
manifest_required_keys=license |
|||
manifest_deprecated_keys=description,active |
|||
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3 |
|||
valid_odoo_versions=12.0 |
|||
|
|||
[MESSAGES CONTROL] |
|||
disable=all |
|||
|
|||
enable=anomalous-backslash-in-string, |
|||
api-one-deprecated, |
|||
api-one-multi-together, |
|||
assignment-from-none, |
|||
attribute-deprecated, |
|||
class-camelcase, |
|||
dangerous-default-value, |
|||
dangerous-view-replace-wo-priority, |
|||
duplicate-id-csv, |
|||
duplicate-key, |
|||
duplicate-xml-fields, |
|||
duplicate-xml-record-id, |
|||
eval-referenced, |
|||
eval-used, |
|||
incoherent-interpreter-exec-perm, |
|||
license-allowed, |
|||
manifest-author-string, |
|||
manifest-deprecated-key, |
|||
manifest-required-key, |
|||
manifest-version-format, |
|||
method-compute, |
|||
method-inverse, |
|||
method-required-super, |
|||
method-search, |
|||
missing-import-error, |
|||
missing-manifest-dependency, |
|||
openerp-exception-warning, |
|||
pointless-statement, |
|||
pointless-string-statement, |
|||
print-used, |
|||
redundant-keyword-arg, |
|||
redundant-modulename-xml, |
|||
reimported, |
|||
relative-import, |
|||
return-in-init, |
|||
rst-syntax-error, |
|||
sql-injection, |
|||
too-few-format-args, |
|||
translation-field, |
|||
translation-required, |
|||
unreachable, |
|||
use-vim-comment, |
|||
wrong-tabs-instead-of-spaces, |
|||
xml-syntax-error |
|||
|
|||
[REPORTS] |
|||
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} |
|||
output-format=colorized |
|||
reports=no |
@ -0,0 +1,34 @@ |
|||
language: python |
|||
sudo: false |
|||
cache: pip |
|||
|
|||
python: |
|||
- "3.5" |
|||
|
|||
addons: |
|||
postgresql: "9.6" |
|||
apt: |
|||
packages: |
|||
- expect-dev # provides unbuffer utility |
|||
|
|||
env: |
|||
global: |
|||
- VERSION="12.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" |
|||
|
|||
matrix: |
|||
- LINT_CHECK="1" |
|||
- TESTS="1" ODOO_REPO="OCA/OCB" |
|||
- TESTS="1" ODOO_REPO="OCA/OCB" UNIT_TEST="1" |
|||
|
|||
|
|||
install: |
|||
- git clone --depth=1 https://github.com/coopiteasy/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools |
|||
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} |
|||
- travis_install_nightly |
|||
- pip install unidecode |
|||
|
|||
script: |
|||
- travis_run_tests |
|||
|
|||
after_success: |
|||
- travis_after_tests_success |
@ -1,2 +1,44 @@ |
|||
# vertical-cooperative |
|||
This repository gather odoo modules for cooperatives |
|||
|
|||
# MAKE TRAVIS GREEN AGAIN |
|||
|
|||
pre-commit still issues these messages. They need to be fixed. |
|||
|
|||
``` |
|||
************* Module easy_my_coop.models.partner |
|||
easy_my_coop/models/partner.py:56: [E8103(sql-injection), ResPartner._invoice_total] SQL injection risk. Use parameters if you can. - More info https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#no-sql-injection |
|||
************* Module partner_age.models.partner |
|||
partner_age/models/partner.py:13: [E8103(sql-injection), ResPartner._search_age] SQL injection risk. Use parameters if you can. - More info https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#no-sql-injection |
|||
************* Module easy_my_coop_taxshelter_report.models.tax_shelter_declaration |
|||
easy_my_coop_taxshelter_report/models/tax_shelter_declaration.py:325: [E8102(invalid-commit), TaxShelterCertificate.send_certificates] Use of cr.commit() directly - More info https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#never-commit-the-transaction |
|||
************* Module easy_my_coop.models.account_invoice |
|||
easy_my_coop/models/account_invoice.py:11: [C8104(class-camelcase), account_invoice] Use `CamelCase` "AccountInvoice" in class name "account_invoice". You can use oca-autopep8 of https://github.com/OCA/maintainer-tools to auto fix it. |
|||
************* Module easy_my_coop.models.operation_request |
|||
easy_my_coop/models/operation_request.py:12: [C8104(class-camelcase), operation_request] Use `CamelCase` "OperationRequest" in class name "operation_request". You can use oca-autopep8 of https://github.com/OCA/maintainer-tools to auto fix it. |
|||
************* Module easy_my_coop.models.coop |
|||
easy_my_coop/models/coop.py:287: [C8108(method-compute), SubscriptionRequest] Name of compute method should start with "_compute_" |
|||
************* Module website_recaptcha_reloaded.models.res_config |
|||
website_recaptcha_reloaded/models/res_config.py:7: [C8104(class-camelcase), website_config_settings] Use `CamelCase` "WebsiteConfigSettings" in class name "website_config_settings". You can use oca-autopep8 of https://github.com/OCA/maintainer-tools to auto fix it. |
|||
************* Module easy_my_coop.models.company |
|||
easy_my_coop/models/company.py:61: [C8108(method-compute), ResCompany] Name of compute method should start with "_compute_" |
|||
|
|||
pylint with mandatory checks.............................................Failed |
|||
- hook id: pylint |
|||
- exit code: 18 |
|||
|
|||
************* Module easy_my_coop.models.partner |
|||
easy_my_coop/models/partner.py:56: [E8103(sql-injection), ResPartner._invoice_total] SQL injection risk. Use parameters if you can. - More info https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#no-sql-injection |
|||
************* Module partner_age.models.partner |
|||
partner_age/models/partner.py:13: [E8103(sql-injection), ResPartner._search_age] SQL injection risk. Use parameters if you can. - More info https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#no-sql-injection |
|||
************* Module easy_my_coop.models.account_invoice |
|||
easy_my_coop/models/account_invoice.py:11: [C8104(class-camelcase), account_invoice] Use `CamelCase` "AccountInvoice" in class name "account_invoice". You can use oca-autopep8 of https://github.com/OCA/maintainer-tools to auto fix it. |
|||
************* Module easy_my_coop.models.operation_request |
|||
easy_my_coop/models/operation_request.py:12: [C8104(class-camelcase), operation_request] Use `CamelCase` "OperationRequest" in class name "operation_request". You can use oca-autopep8 of https://github.com/OCA/maintainer-tools to auto fix it. |
|||
************* Module easy_my_coop.models.coop |
|||
easy_my_coop/models/coop.py:287: [C8108(method-compute), SubscriptionRequest] Name of compute method should start with "_compute_" |
|||
************* Module website_recaptcha_reloaded.models.res_config |
|||
website_recaptcha_reloaded/models/res_config.py:7: [C8104(class-camelcase), website_config_settings] Use `CamelCase` "WebsiteConfigSettings" in class name "website_config_settings". You can use oca-autopep8 of https://github.com/OCA/maintainer-tools to auto fix it. |
|||
************* Module easy_my_coop.models.company |
|||
easy_my_coop/models/company.py:61: [C8108(method-compute), ResCompany] Name of compute method should start with "_compute_" |
|||
``` |
@ -0,0 +1,58 @@ |
|||
============ |
|||
Easy My Coop |
|||
============ |
|||
|
|||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
!! This file is generated by oca-gen-addon-readme !! |
|||
!! changes will be overwritten. !! |
|||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
|
|||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
|||
:target: https://odoo-community.org/page/development-status |
|||
:alt: Beta |
|||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png |
|||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
.. |badge3| image:: https://img.shields.io/badge/github-coopiteasy%2Fvertical--cooperative-lightgray.png?logo=github |
|||
:target: https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop |
|||
:alt: coopiteasy/vertical-cooperative |
|||
|
|||
|badge1| |badge2| |badge3| |
|||
|
|||
This module allows to manage the cooperator subscription and all the cooperative business processes. |
|||
|
|||
**Table of contents** |
|||
|
|||
.. contents:: |
|||
:local: |
|||
|
|||
Bug Tracker |
|||
=========== |
|||
|
|||
Bugs are tracked on `GitHub Issues <https://github.com/coopiteasy/vertical-cooperative/issues>`_. |
|||
In case of trouble, please check there if your issue has already been reported. |
|||
If you spotted it first, help us smashing it by providing a detailed and welcomed |
|||
`feedback <https://github.com/coopiteasy/vertical-cooperative/issues/new?body=module:%20easy_my_coop%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
|||
|
|||
Do not contact contributors directly about support or help with technical issues. |
|||
|
|||
Credits |
|||
======= |
|||
|
|||
Authors |
|||
~~~~~~~ |
|||
|
|||
* Coop IT Easy SCRLfs |
|||
|
|||
Contributors |
|||
~~~~~~~~~~~~ |
|||
|
|||
* Coop IT Easy SCRLfs |
|||
|
|||
|
|||
Maintainers |
|||
~~~~~~~~~~~ |
|||
|
|||
This module is part of the `coopiteasy/vertical-cooperative <https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop>`_ project on GitHub. |
|||
|
|||
You are welcome to contribute. |
@ -1,3 +1,3 @@ |
|||
from . import models |
|||
from . import report |
|||
from . import wizard |
|||
from . import models |
|||
from . import report |
|||
from . import wizard |
@ -1,43 +1,44 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data noupdate="1"> |
|||
<record model="ir.module.category" id="module_category_cooperator_management"> |
|||
<field name="name">Cooperative Management</field> |
|||
<field name="description">Manage your cooperative.</field> |
|||
<field name="sequence">3</field> |
|||
</record> |
|||
|
|||
<!-- Product --> |
|||
<record id="product_category_company_share" model="product.category"> |
|||
<field name="name">Company Share</field> |
|||
</record> |
|||
|
|||
<record id="sequence_subscription_journal" model="ir.sequence"> |
|||
<field name="name">Account Default Subscription Journal</field> |
|||
<field eval="3" name="padding"/> |
|||
<field name="prefix">SUBJ/%(year)s/</field> |
|||
<field name="use_date_range">True</field> |
|||
</record> |
|||
|
|||
<record id="subscription_journal" model="account.journal"> |
|||
<field name="name">Subscription Journal</field> |
|||
<field name="code">SUBJ</field> |
|||
<field name="type">sale</field> |
|||
<field name="sequence_id" ref="sequence_subscription_journal"/> |
|||
</record> |
|||
|
|||
<record id="sequence_subscription" model="ir.sequence"> |
|||
<field name="name">Subscription Register</field> |
|||
<field name="code">subscription.register</field> |
|||
<field eval="1" name="number_next"/> |
|||
<field eval="1" name="number_increment"/> |
|||
</record> |
|||
|
|||
<record id="sequence_register_operation" model="ir.sequence"> |
|||
<field name="name">Register Operation</field> |
|||
<field name="code">register.operation</field> |
|||
<field eval="1" name="number_next"/> |
|||
<field eval="1" name="number_increment"/> |
|||
</record> |
|||
</data> |
|||
</openerp> |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data noupdate="1"> |
|||
<record model="ir.module.category" |
|||
id="module_category_cooperator_management"> |
|||
<field name="name">Cooperative Management</field> |
|||
<field name="description">Manage your cooperative.</field> |
|||
<field name="sequence">3</field> |
|||
</record> |
|||
|
|||
<!-- Product --> |
|||
<record id="product_category_company_share" model="product.category"> |
|||
<field name="name">Company Share</field> |
|||
</record> |
|||
|
|||
<record id="sequence_subscription_journal" model="ir.sequence"> |
|||
<field name="name">Account Default Subscription Journal</field> |
|||
<field eval="3" name="padding"/> |
|||
<field name="prefix">SUBJ/%(year)s/</field> |
|||
<field name="use_date_range">True</field> |
|||
</record> |
|||
|
|||
<record id="subscription_journal" model="account.journal"> |
|||
<field name="name">Subscription Journal</field> |
|||
<field name="code">SUBJ</field> |
|||
<field name="type">sale</field> |
|||
<field name="sequence_id" ref="sequence_subscription_journal"/> |
|||
</record> |
|||
|
|||
<record id="sequence_subscription" model="ir.sequence"> |
|||
<field name="name">Subscription Register</field> |
|||
<field name="code">subscription.register</field> |
|||
<field eval="1" name="number_next"/> |
|||
<field eval="1" name="number_increment"/> |
|||
</record> |
|||
|
|||
<record id="sequence_register_operation" model="ir.sequence"> |
|||
<field name="name">Register Operation</field> |
|||
<field name="code">register.operation</field> |
|||
<field eval="1" name="number_next"/> |
|||
<field eval="1" name="number_increment"/> |
|||
</record> |
|||
</data> |
|||
</openerp> |
@ -1,443 +1,497 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- Mail template are declared in a NOUPDATE block |
|||
so users can freely customize/delete them --> |
|||
<data noupdate="1"> |
|||
<!--Request to release capital Email template --> |
|||
<record id="email_template_release_capital" model="mail.template"> |
|||
<field name="name">Request to Release Capital - Send by Email</field> |
|||
<field name="email_from">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="subject">${object.company_id.name} Request to Release Capital (Ref ${object.number or 'n/a'})</field> |
|||
<field name="partner_to">${object.partner_id.id}</field> |
|||
<field name="reply_to">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="model_id" ref="account.model_account_invoice"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="report_template" ref="action_cooperator_invoices"/> |
|||
<field name="report_name">${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field> |
|||
<field name="lang">${object.partner_id.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.partner_id.name},</p> |
|||
|
|||
<p>You will find in attachment all the necessary information for the payment. We kindly remind you that your subscription will be effective only once we received the payment.</p> |
|||
|
|||
<p>Do not forget to add the structured communication to the payment.</p> |
|||
|
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_confirmation" model="mail.template"> |
|||
<field name="name">Confirmation Email</field> |
|||
<field name="email_from">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="subject">Subscription request confirmation</field> |
|||
<field name="email_to">${object.email}</field> |
|||
<field name="reply_to">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="model_id" ref="model_subscription_request"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>Your request will be soon processed by our team. If all the provided info are correct you will soon receive the payment information in another email</p> |
|||
|
|||
<br/> |
|||
<p>If you have any question, do not hesitate to contact us.</p> |
|||
<br/> |
|||
|
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_waiting_list" model="mail.template"> |
|||
<field name="name">Waiting List Email</field> |
|||
<field name="email_from">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="subject">Subscription request added on waiting list. </field> |
|||
<field name="email_to">${object.email}</field> |
|||
<field name="reply_to">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="model_id" ref="model_subscription_request"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>Thank you for your subscription request. There are currently no project to raise funds for, thus we added it on waiting list. |
|||
We will contact you as soon as the subscription requests are re-opened. |
|||
</p> |
|||
|
|||
<br/> |
|||
<p>If you have any question, do not hesitate to contact us.</p> |
|||
<br/> |
|||
|
|||
<p>Sustainably yours,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_confirmation_company" model="mail.template"> |
|||
<field name="name">Company Confirmation Email</field> |
|||
<field name="email_from">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="subject">Subscription request confirmation</field> |
|||
<field name="email_to">${object.email},${object.company_email}</field> |
|||
<field name="reply_to">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="model_id" ref="model_subscription_request"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>We have received your subscription request for ${object.company_id.name}. Thank you for your support.</p> |
|||
|
|||
<p>Your request will be soon processed by our team "gestion et participation des membres". If all the provided info are correct you will soon receive the payment information in another email</p> |
|||
|
|||
<br/> |
|||
<p>If you have any question, do not hesitate to contact us.</p> |
|||
<br/> |
|||
|
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_certificat" model="mail.template"> |
|||
<field name="name">Payment Received Confirmation - Send By Email</field> |
|||
<field name="email_from">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="subject">Payment Received Confirmation</field> |
|||
<field name="partner_to">${object.id}</field> |
|||
<field name="reply_to">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="model_id" ref="model_res_partner"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="report_template" ref="action_cooperator_report_certificat"/> |
|||
<field name="report_name">Certificat ${(object.cooperator_register_number or '')}</field> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>We confirm the reception of you payment. You are now shareholder of our cooperative</p> |
|||
|
|||
<br/> |
|||
<p>Find in attachment your ${object.company_id.name} certificate.</p> |
|||
<p>Thank you for choosing ${object.company_id.name or 'us'}!</p> |
|||
<br/> |
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_certificat_increase" model="mail.template"> |
|||
<field name="name">Share Increase - Payment Received Confirmation - Send By Email</field> |
|||
<field name="email_from">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="subject">Payment Received Confirmation</field> |
|||
<field name="partner_to">${object.id}</field> |
|||
<field name="reply_to">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="model_id" ref="model_res_partner"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="report_template" ref="action_cooperator_report_certificat"/> |
|||
<field name="report_name">Certificat ${(object.cooperator_register_number or '')}</field> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>We confirm the reception of you payment for the new share(s) you have taken.</p> |
|||
|
|||
<br/> |
|||
<p>Find in attachment your ${object.company_id.name} certificate.</p> |
|||
<p>Thank you for trusting ${object.company_id.name or 'us'}!</p> |
|||
<br/> |
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_share_transfer" model="mail.template"> |
|||
<field name="name">Share transfer - Send By Email</field> |
|||
<field name="email_from">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="subject">Share transfert</field> |
|||
<field name="partner_to">${object.id}</field> |
|||
<field name="reply_to">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="model_id" ref="model_res_partner"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="report_template" ref="action_cooperator_report_certificat"/> |
|||
<field name="report_name">Certificat ${(object.cooperator_register_number or '')}</field> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>We confirm you that the shares have been transfered to you. If you was not already cooperator, you are now shareholder of our cooperative</p> |
|||
|
|||
<br/> |
|||
<p>Find in attachment your ${object.company_id.name} certificate.</p> |
|||
<p>Thank you for choosing ${object.company_id.name or 'us'}!</p> |
|||
<br/> |
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_share_update" model="mail.template"> |
|||
<field name="name">Share update - Send By Email</field> |
|||
<field name="email_from">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="subject">Share update</field> |
|||
<field name="partner_to">${object.id}</field> |
|||
<field name="reply_to">${(object.company_id.coop_email_contact or object.user_id.email)|safe}</field> |
|||
<field name="model_id" ref="model_res_partner"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="report_template" ref="action_cooperator_report_certificat"/> |
|||
<field name="report_name">Certificat ${(object.cooperator_register_number or '')}</field> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>We confirm you that the adaptation on shares portfolio has been succesfully performed. Your cooperator certificate has been adapted accordingly</p> |
|||
|
|||
<br/> |
|||
<p>Find in attachment your ${object.company_id.name} certificate.</p> |
|||
<p>Thank you for choosing ${object.company_id.name or 'us'}!</p> |
|||
<br/> |
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- Mail template are declared in a NOUPDATE block |
|||
so users can freely customize/delete them --> |
|||
<data noupdate="1"> |
|||
<!--Request to release capital Email template --> |
|||
<record id="email_template_release_capital" model="mail.template"> |
|||
<field name="name">Request to Release Capital - Send by Email |
|||
</field> |
|||
<field name="email_from"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="subject">${object.company_id.name} Request to Release |
|||
Capital (Ref ${object.number or 'n/a'}) |
|||
</field> |
|||
<field name="partner_to">${object.partner_id.id}</field> |
|||
<field name="reply_to"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="model_id" ref="account.model_account_invoice"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="report_template" ref="action_cooperator_invoices"/> |
|||
<field name="report_name"> |
|||
${(object.number or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''} |
|||
</field> |
|||
<field name="lang">${object.partner_id.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.partner_id.name},</p> |
|||
|
|||
<p>You will find in attachment all the necessary information for the payment. We kindly remind you that your subscription will be effective only once we received the payment.</p> |
|||
|
|||
<p>Do not forget to add the structured communication to the payment.</p> |
|||
|
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_confirmation" model="mail.template"> |
|||
<field name="name">Confirmation Email</field> |
|||
<field name="email_from"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="subject">Subscription request confirmation</field> |
|||
<field name="email_to">${object.email}</field> |
|||
<field name="reply_to"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="model_id" ref="model_subscription_request"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>Your request will be soon processed by our team. If all the provided info are correct you will soon receive the payment information in another email</p> |
|||
|
|||
<br/> |
|||
<p>If you have any question, do not hesitate to contact us.</p> |
|||
<br/> |
|||
|
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_waiting_list" model="mail.template"> |
|||
<field name="name">Waiting List Email</field> |
|||
<field name="email_from"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="subject">Subscription request added on waiting list. |
|||
</field> |
|||
<field name="email_to">${object.email}</field> |
|||
<field name="reply_to"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="model_id" ref="model_subscription_request"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>Thank you for your subscription request. There are currently no project to raise funds for, thus we added it on waiting list. |
|||
We will contact you as soon as the subscription requests are re-opened. |
|||
</p> |
|||
|
|||
<br/> |
|||
<p>If you have any question, do not hesitate to contact us.</p> |
|||
<br/> |
|||
|
|||
<p>Sustainably yours,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_confirmation_company" model="mail.template"> |
|||
<field name="name">Company Confirmation Email</field> |
|||
<field name="email_from"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="subject">Subscription request confirmation</field> |
|||
<field name="email_to">${object.email},${object.company_email} |
|||
</field> |
|||
<field name="reply_to"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="model_id" ref="model_subscription_request"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>We have received your subscription request for ${object.company_id.name}. Thank you for your support.</p> |
|||
|
|||
<p>Your request will be soon processed by our team "gestion et participation des membres". If all the provided info are correct you will soon receive the payment information in another email</p> |
|||
|
|||
<br/> |
|||
<p>If you have any question, do not hesitate to contact us.</p> |
|||
<br/> |
|||
|
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_certificat" model="mail.template"> |
|||
<field name="name">Payment Received Confirmation - Send By Email |
|||
</field> |
|||
<field name="email_from"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="subject">Payment Received Confirmation</field> |
|||
<field name="partner_to">${object.id}</field> |
|||
<field name="reply_to"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="model_id" ref="model_res_partner"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="report_template" |
|||
ref="action_cooperator_report_certificat"/> |
|||
<field name="report_name">Certificat |
|||
${(object.cooperator_register_number or '')} |
|||
</field> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>We confirm the reception of you payment. You are now shareholder of our cooperative</p> |
|||
|
|||
<br/> |
|||
<p>Find in attachment your ${object.company_id.name} certificate.</p> |
|||
<p>Thank you for choosing ${object.company_id.name or 'us'}!</p> |
|||
<br/> |
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_certificat_increase" model="mail.template"> |
|||
<field name="name">Share Increase - Payment Received Confirmation - |
|||
Send By Email |
|||
</field> |
|||
<field name="email_from"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="subject">Payment Received Confirmation</field> |
|||
<field name="partner_to">${object.id}</field> |
|||
<field name="reply_to"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="model_id" ref="model_res_partner"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="report_template" |
|||
ref="action_cooperator_report_certificat"/> |
|||
<field name="report_name">Certificat |
|||
${(object.cooperator_register_number or '')} |
|||
</field> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>We confirm the reception of you payment for the new share(s) you have taken.</p> |
|||
|
|||
<br/> |
|||
<p>Find in attachment your ${object.company_id.name} certificate.</p> |
|||
<p>Thank you for trusting ${object.company_id.name or 'us'}!</p> |
|||
<br/> |
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_share_transfer" model="mail.template"> |
|||
<field name="name">Share transfer - Send By Email</field> |
|||
<field name="email_from"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="subject">Share transfert</field> |
|||
<field name="partner_to">${object.id}</field> |
|||
<field name="reply_to"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="model_id" ref="model_res_partner"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="report_template" |
|||
ref="action_cooperator_report_certificat"/> |
|||
<field name="report_name">Certificat |
|||
${(object.cooperator_register_number or '')} |
|||
</field> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>We confirm you that the shares have been transfered to you. If you was not already cooperator, you are now shareholder of our cooperative</p> |
|||
|
|||
<br/> |
|||
<p>Find in attachment your ${object.company_id.name} certificate.</p> |
|||
<p>Thank you for choosing ${object.company_id.name or 'us'}!</p> |
|||
<br/> |
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
|
|||
<record id="email_template_share_update" model="mail.template"> |
|||
<field name="name">Share update - Send By Email</field> |
|||
<field name="email_from"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="subject">Share update</field> |
|||
<field name="partner_to">${object.id}</field> |
|||
<field name="reply_to"> |
|||
${(object.company_id.coop_email_contact or object.user_id.email)|safe} |
|||
</field> |
|||
<field name="model_id" ref="model_res_partner"/> |
|||
<field name="auto_delete" eval="True"/> |
|||
<field name="report_template" |
|||
ref="action_cooperator_report_certificat"/> |
|||
<field name="report_name">Certificat |
|||
${(object.cooperator_register_number or '')} |
|||
</field> |
|||
<field name="lang">${object.lang}</field> |
|||
<field name="easy_my_coop" eval="True"/> |
|||
<field name="body_html"><![CDATA[ |
|||
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> |
|||
|
|||
<p>Hello ${object.name},</p> |
|||
|
|||
<p>We confirm you that the adaptation on shares portfolio has been succesfully performed. Your cooperator certificate has been adapted accordingly</p> |
|||
|
|||
<br/> |
|||
<p>Find in attachment your ${object.company_id.name} certificate.</p> |
|||
<p>Thank you for choosing ${object.company_id.name or 'us'}!</p> |
|||
<br/> |
|||
<p>Sustainably your,</p> |
|||
<p>${object.company_id.name}.</p> |
|||
|
|||
% if object.company_id.street: |
|||
${object.company_id.street} |
|||
% endif |
|||
% if object.company_id.street2: |
|||
${object.company_id.street2}<br/> |
|||
% endif |
|||
% if object.company_id.city or object.company_id.zip: |
|||
${object.company_id.zip} ${object.company_id.city}<br/> |
|||
% endif |
|||
% if object.company_id.country_id: |
|||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/> |
|||
% endif |
|||
% if object.company_id.phone: |
|||
Phone: ${object.company_id.phone} |
|||
% endif |
|||
|
|||
% if object.company_id.website: |
|||
<div> |
|||
Web : <a href="${object.company_id.website}">${object.company_id.website}</a> |
|||
</div> |
|||
%endif |
|||
|
|||
<div> |
|||
<img src=${object.company_id.logo_url}> |
|||
</div> |
|||
</div> |
|||
]]></field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -1,30 +1,29 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from openerp.openupgrade import openupgrade |
|||
import logging |
|||
|
|||
logger = logging.getLogger('OpenUpgrade') |
|||
|
|||
column_renames = { |
|||
'job_sync_line': [ |
|||
('adresse', 'address'), |
|||
('ville', 'city'), |
|||
('codepostal', 'zip'), |
|||
('sync_date','date'), |
|||
], |
|||
} |
|||
|
|||
tables_renames = [ |
|||
('job_sync_line','subscription_request'), |
|||
('job_sync',None), |
|||
('external_db',None), |
|||
] |
|||
|
|||
@openupgrade.migrate() |
|||
def migrate(cr, version): |
|||
if not version: |
|||
return |
|||
|
|||
openupgrade.rename_columns(cr, column_renames) |
|||
openupgrade.rename_tables(cr, tables_renames) |
|||
|
|||
import logging |
|||
|
|||
from openerp.openupgrade import openupgrade |
|||
|
|||
logger = logging.getLogger("OpenUpgrade") |
|||
|
|||
column_renames = { |
|||
"job_sync_line": [ |
|||
("adresse", "address"), |
|||
("ville", "city"), |
|||
("codepostal", "zip"), |
|||
("sync_date", "date"), |
|||
] |
|||
} |
|||
|
|||
tables_renames = [ |
|||
("job_sync_line", "subscription_request"), |
|||
("job_sync", None), |
|||
("external_db", None), |
|||
] |
|||
|
|||
|
|||
@openupgrade.migrate() |
|||
def migrate(cr, version): |
|||
if not version: |
|||
return |
|||
|
|||
openupgrade.rename_columns(cr, column_renames) |
|||
openupgrade.rename_tables(cr, tables_renames) |
@ -1,175 +1,197 @@ |
|||
# Copyright 2019 Coop IT Easy SCRL fs |
|||
# Houssine Bakkali <houssine@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from datetime import datetime |
|||
|
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class account_invoice(models.Model): |
|||
_inherit = 'account.invoice' |
|||
|
|||
subscription_request = fields.Many2one('subscription.request', |
|||
string='Subscription request') |
|||
release_capital_request = fields.Boolean( |
|||
string='Release of capital request') |
|||
|
|||
@api.model |
|||
def _prepare_refund(self, invoice, date_invoice=None, date=None, |
|||
description=None, journal_id=None): |
|||
values = super(account_invoice, self)._prepare_refund( |
|||
invoice, date_invoice, date, |
|||
description, journal_id) |
|||
values['release_capital_request'] = self.release_capital_request |
|||
|
|||
return values |
|||
|
|||
def create_user(self, partner): |
|||
user_obj = self.env['res.users'] |
|||
email = partner.email |
|||
|
|||
user = user_obj.search([('login', '=', email)]) |
|||
if not user: |
|||
user = user_obj.search([('login', '=', email), |
|||
('active', '=', False)]) |
|||
if user: |
|||
user.sudo().write({'active': True}) |
|||
else: |
|||
user_values = {'partner_id': partner.id, 'login': email} |
|||
user = user_obj.sudo()._signup_create_user(user_values) |
|||
user.sudo().with_context({'create_user': True}).action_reset_password() |
|||
|
|||
return user |
|||
|
|||
def get_mail_template_certificate(self): |
|||
if self.partner_id.member: |
|||
mail_template = 'easy_my_coop.email_template_certificat_increase' |
|||
else: |
|||
mail_template = 'easy_my_coop.email_template_certificat' |
|||
return self.env.ref(mail_template) |
|||
|
|||
def get_sequence_register(self): |
|||
return self.env.ref('easy_my_coop.sequence_subscription', False) |
|||
|
|||
def get_sequence_operation(self): |
|||
return self.env.ref('easy_my_coop.sequence_register_operation', False) |
|||
|
|||
def get_share_line_vals(self, line, effective_date): |
|||
return { |
|||
'share_number': line.quantity, |
|||
'share_product_id': line.product_id.id, |
|||
'partner_id': self.partner_id.id, |
|||
'share_unit_price': line.price_unit, |
|||
'effective_date': effective_date |
|||
} |
|||
|
|||
def get_subscription_register_vals(self, line, effective_date): |
|||
return { |
|||
'partner_id': self.partner_id.id, |
|||
'quantity': line.quantity, |
|||
'share_product_id': line.product_id.id, |
|||
'share_unit_price': line.price_unit, |
|||
'date': effective_date, |
|||
'type': 'subscription' |
|||
} |
|||
|
|||
def get_membership_vals(self): |
|||
# flag the partner as an effective member |
|||
# if not yet cooperator we generate a cooperator number |
|||
vals = {} |
|||
if self.partner_id.member is False \ |
|||
and self.partner_id.old_member is False: |
|||
sequence_id = self.get_sequence_register() |
|||
sub_reg_num = sequence_id.next_by_id() |
|||
vals = {'member': True, 'old_member': False, |
|||
'cooperator_register_number': int(sub_reg_num) |
|||
} |
|||
elif self.partner_id.old_member: |
|||
vals = {'member': True, 'old_member': False} |
|||
|
|||
return vals |
|||
|
|||
def set_membership(self): |
|||
vals = self.get_membership_vals() |
|||
self.partner_id.write(vals) |
|||
|
|||
return True |
|||
|
|||
def send_certificate_email(self, certificate_email_template, sub_reg_line): |
|||
# we send the email with the certificate in attachment |
|||
certificate_email_template.sudo().send_mail(self.partner_id.id, False) |
|||
|
|||
def set_cooperator_effective(self, effective_date): |
|||
sub_register_obj = self.env['subscription.register'] |
|||
share_line_obj = self.env['share.line'] |
|||
|
|||
certificate_email_template = self.get_mail_template_certificate() |
|||
|
|||
self.set_membership() |
|||
|
|||
sequence_operation = self.get_sequence_operation() |
|||
sub_reg_operation = sequence_operation.next_by_id() |
|||
|
|||
for line in self.invoice_line_ids: |
|||
sub_reg_vals = self.get_subscription_register_vals(line, |
|||
effective_date) |
|||
sub_reg_vals['name'] = sub_reg_operation |
|||
sub_reg_vals['register_number_operation'] = int(sub_reg_operation) |
|||
|
|||
sub_reg_line = sub_register_obj.create(sub_reg_vals) |
|||
|
|||
share_line_vals = self.get_share_line_vals(line, effective_date) |
|||
share_line_obj.create(share_line_vals) |
|||
|
|||
if line.product_id.mail_template: |
|||
certificate_email_template = line.product_id.mail_template |
|||
|
|||
self.send_certificate_email(certificate_email_template, sub_reg_line) |
|||
|
|||
if self.company_id.create_user: |
|||
self.create_user(self.partner_id) |
|||
|
|||
return True |
|||
|
|||
def post_process_confirm_paid(self, effective_date): |
|||
self.set_cooperator_effective(effective_date) |
|||
|
|||
return True |
|||
|
|||
def get_refund_domain(self, invoice): |
|||
return [ |
|||
('type', '=', 'out_refund'), |
|||
('origin', '=', invoice.move_name) |
|||
] |
|||
|
|||
@api.multi |
|||
def action_invoice_paid(self): |
|||
super(account_invoice, self).action_invoice_paid() |
|||
for invoice in self: |
|||
# we check if there is an open refund for this invoice. in this |
|||
# case we don't run the process_subscription function as the |
|||
# invoice has been reconciled with a refund and not a payment. |
|||
domain = self.get_refund_domain(invoice) |
|||
refund = self.search(domain) |
|||
|
|||
if invoice.partner_id.cooperator \ |
|||
and invoice.release_capital_request \ |
|||
and invoice.type == 'out_invoice' and not refund: |
|||
# take the effective date from the payment. |
|||
# by default the confirmation date is the payment date |
|||
effective_date = datetime.now().strftime("%d/%m/%Y") |
|||
|
|||
if invoice.payment_move_line_ids: |
|||
move_line = invoice.payment_move_line_ids[0] |
|||
effective_date = move_line.date |
|||
|
|||
invoice.subscription_request.state = 'paid' |
|||
invoice.post_process_confirm_paid(effective_date) |
|||
# if there is a open refund we mark the subscription as cancelled |
|||
elif invoice.partner_id.cooperator \ |
|||
and invoice.release_capital_request \ |
|||
and invoice.type == 'out_invoice' and refund: |
|||
invoice.subscription_request.state = 'cancelled' |
|||
return True |
|||
# Copyright 2019 Coop IT Easy SCRL fs |
|||
# Houssine Bakkali <houssine@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from datetime import datetime |
|||
|
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class AccountInvoice(models.Model): |
|||
_inherit = "account.invoice" |
|||
|
|||
subscription_request = fields.Many2one( |
|||
"subscription.request", string="Subscription request" |
|||
) |
|||
release_capital_request = fields.Boolean( |
|||
string="Release of capital request" |
|||
) |
|||
|
|||
@api.model |
|||
def _prepare_refund( |
|||
self, |
|||
invoice, |
|||
date_invoice=None, |
|||
date=None, |
|||
description=None, |
|||
journal_id=None, |
|||
): |
|||
values = super(AccountInvoice, self)._prepare_refund( |
|||
invoice, date_invoice, date, description, journal_id |
|||
) |
|||
values["release_capital_request"] = self.release_capital_request |
|||
|
|||
return values |
|||
|
|||
def create_user(self, partner): |
|||
user_obj = self.env["res.users"] |
|||
email = partner.email |
|||
|
|||
user = user_obj.search([("login", "=", email)]) |
|||
if not user: |
|||
user = user_obj.search( |
|||
[("login", "=", email), ("active", "=", False)] |
|||
) |
|||
if user: |
|||
user.sudo().write({"active": True}) |
|||
else: |
|||
user_values = {"partner_id": partner.id, "login": email} |
|||
user = user_obj.sudo()._signup_create_user(user_values) |
|||
user.sudo().with_context( |
|||
{"create_user": True} |
|||
).action_reset_password() |
|||
|
|||
return user |
|||
|
|||
def get_mail_template_certificate(self): |
|||
if self.partner_id.member: |
|||
mail_template = "easy_my_coop.email_template_certificat_increase" |
|||
else: |
|||
mail_template = "easy_my_coop.email_template_certificat" |
|||
return self.env.ref(mail_template) |
|||
|
|||
def get_sequence_register(self): |
|||
return self.env.ref("easy_my_coop.sequence_subscription", False) |
|||
|
|||
def get_sequence_operation(self): |
|||
return self.env.ref("easy_my_coop.sequence_register_operation", False) |
|||
|
|||
def get_share_line_vals(self, line, effective_date): |
|||
return { |
|||
"share_number": line.quantity, |
|||
"share_product_id": line.product_id.id, |
|||
"partner_id": self.partner_id.id, |
|||
"share_unit_price": line.price_unit, |
|||
"effective_date": effective_date, |
|||
} |
|||
|
|||
def get_subscription_register_vals(self, line, effective_date): |
|||
return { |
|||
"partner_id": self.partner_id.id, |
|||
"quantity": line.quantity, |
|||
"share_product_id": line.product_id.id, |
|||
"share_unit_price": line.price_unit, |
|||
"date": effective_date, |
|||
"type": "subscription", |
|||
} |
|||
|
|||
def get_membership_vals(self): |
|||
# flag the partner as an effective member |
|||
# if not yet cooperator we generate a cooperator number |
|||
vals = {} |
|||
if ( |
|||
self.partner_id.member is False |
|||
and self.partner_id.old_member is False |
|||
): |
|||
sequence_id = self.get_sequence_register() |
|||
sub_reg_num = sequence_id.next_by_id() |
|||
vals = { |
|||
"member": True, |
|||
"old_member": False, |
|||
"cooperator_register_number": int(sub_reg_num), |
|||
} |
|||
elif self.partner_id.old_member: |
|||
vals = {"member": True, "old_member": False} |
|||
|
|||
return vals |
|||
|
|||
def set_membership(self): |
|||
vals = self.get_membership_vals() |
|||
self.partner_id.write(vals) |
|||
|
|||
return True |
|||
|
|||
def send_certificate_email(self, certificate_email_template, sub_reg_line): |
|||
# we send the email with the certificate in attachment |
|||
certificate_email_template.sudo().send_mail(self.partner_id.id, False) |
|||
|
|||
def set_cooperator_effective(self, effective_date): |
|||
sub_register_obj = self.env["subscription.register"] |
|||
share_line_obj = self.env["share.line"] |
|||
|
|||
certificate_email_template = self.get_mail_template_certificate() |
|||
|
|||
self.set_membership() |
|||
|
|||
sequence_operation = self.get_sequence_operation() |
|||
sub_reg_operation = sequence_operation.next_by_id() |
|||
|
|||
for line in self.invoice_line_ids: |
|||
sub_reg_vals = self.get_subscription_register_vals( |
|||
line, effective_date |
|||
) |
|||
sub_reg_vals["name"] = sub_reg_operation |
|||
sub_reg_vals["register_number_operation"] = int(sub_reg_operation) |
|||
|
|||
sub_reg_line = sub_register_obj.create(sub_reg_vals) |
|||
|
|||
share_line_vals = self.get_share_line_vals(line, effective_date) |
|||
share_line_obj.create(share_line_vals) |
|||
|
|||
if line.product_id.mail_template: |
|||
certificate_email_template = line.product_id.mail_template |
|||
|
|||
self.send_certificate_email(certificate_email_template, sub_reg_line) |
|||
|
|||
if self.company_id.create_user: |
|||
self.create_user(self.partner_id) |
|||
|
|||
return True |
|||
|
|||
def post_process_confirm_paid(self, effective_date): |
|||
self.set_cooperator_effective(effective_date) |
|||
|
|||
return True |
|||
|
|||
def get_refund_domain(self, invoice): |
|||
return [ |
|||
("type", "=", "out_refund"), |
|||
("origin", "=", invoice.move_name), |
|||
] |
|||
|
|||
@api.multi |
|||
def action_invoice_paid(self): |
|||
super(AccountInvoice, self).action_invoice_paid() |
|||
for invoice in self: |
|||
# we check if there is an open refund for this invoice. in this |
|||
# case we don't run the process_subscription function as the |
|||
# invoice has been reconciled with a refund and not a payment. |
|||
domain = self.get_refund_domain(invoice) |
|||
refund = self.search(domain) |
|||
|
|||
if ( |
|||
invoice.partner_id.cooperator |
|||
and invoice.release_capital_request |
|||
and invoice.type == "out_invoice" |
|||
and not refund |
|||
): |
|||
# take the effective date from the payment. |
|||
# by default the confirmation date is the payment date |
|||
effective_date = datetime.now().strftime("%d/%m/%Y") |
|||
|
|||
if invoice.payment_move_line_ids: |
|||
move_line = invoice.payment_move_line_ids[0] |
|||
effective_date = move_line.date |
|||
|
|||
invoice.subscription_request.state = "paid" |
|||
invoice.post_process_confirm_paid(effective_date) |
|||
# if there is a open refund we mark the subscription as cancelled |
|||
elif ( |
|||
invoice.partner_id.cooperator |
|||
and invoice.release_capital_request |
|||
and invoice.type == "out_invoice" |
|||
and refund |
|||
): |
|||
invoice.subscription_request.state = "cancelled" |
|||
return True |
@ -1,14 +1,13 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2019 Coop IT Easy SCRL fs |
|||
# Houssine Bakkali <houssine@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from odoo import fields, models |
|||
|
|||
|
|||
class AccountJournal(models.Model): |
|||
_inherit = "account.journal" |
|||
|
|||
get_cooperator_payment = fields.Boolean('Get cooperator payments?') |
|||
get_general_payment = fields.Boolean(string='Get general payments?') |
|||
# Copyright 2019 Coop IT Easy SCRL fs |
|||
# Houssine Bakkali <houssine@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from odoo import fields, models |
|||
|
|||
|
|||
class AccountJournal(models.Model): |
|||
_inherit = "account.journal" |
|||
|
|||
get_cooperator_payment = fields.Boolean("Get cooperator payments?") |
|||
get_general_payment = fields.Boolean(string="Get general payments?") |
@ -1,83 +1,93 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2019 Coop IT Easy SCRL fs |
|||
# Houssine Bakkali <houssine@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class ResCompany(models.Model): |
|||
_inherit = 'res.company' |
|||
|
|||
def _get_base_logo(self): |
|||
base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url') |
|||
self.logo_url = base_url + "/logo.png" |
|||
|
|||
coop_email_contact = fields.Char(string="Contact email address for the" |
|||
" cooperator") |
|||
subscription_maximum_amount = fields.Float(string="Maximum authorised" |
|||
" subscription amount") |
|||
default_country_id = fields.Many2one('res.country', |
|||
string="Default country", |
|||
default=lambda self: self.country_id) |
|||
default_lang_id = fields.Many2one('res.lang', |
|||
string="Default lang") |
|||
allow_id_card_upload = fields.Boolean(string="Allow ID Card upload") |
|||
create_user = fields.Boolean(string="Create user for cooperator", |
|||
default=False) |
|||
board_representative = fields.Char(string="Board representative name") |
|||
signature_scan = fields.Binary(string="Board representative signature") |
|||
property_cooperator_account = fields.Many2one('account.account', |
|||
company_dependent=True, |
|||
string="Cooperator Account", |
|||
domain=[('internal_type', '=', 'receivable'), |
|||
('deprecated', '=', False)], |
|||
help="This account will be" |
|||
" the default one as the" |
|||
" receivable account for the" |
|||
" cooperators", |
|||
required=True) |
|||
unmix_share_type = fields.Boolean(string="Unmix share type", |
|||
default=True, |
|||
help="If checked, A cooperator will be" |
|||
" authorised to have only one type" |
|||
" of share") |
|||
display_logo1 = fields.Boolean(string="Display logo 1") |
|||
display_logo2 = fields.Boolean(string="Display logo 2") |
|||
bottom_logo1 = fields.Binary(string="Bottom logo 1") |
|||
bottom_logo2 = fields.Binary(string="Bottom logo 2") |
|||
logo_url = fields.Char(string="logo url", |
|||
compute="_get_base_logo") |
|||
display_data_policy_approval = fields.Boolean( |
|||
help="Choose to display a data policy checkbox on the cooperator" |
|||
" website form." |
|||
) |
|||
data_policy_approval_required = fields.Boolean( |
|||
string="Is data policy approval required?" |
|||
) |
|||
data_policy_approval_text = fields.Html( |
|||
translate=True, |
|||
help="Text to display aside the checkbox to approve data policy." |
|||
) |
|||
display_internal_rules_approval = fields.Boolean( |
|||
help="Choose to display an internal rules checkbox on the" |
|||
" cooperator website form." |
|||
) |
|||
internal_rules_approval_required = fields.Boolean( |
|||
string="Is internal rules approval required?" |
|||
) |
|||
internal_rules_approval_text = fields.Html( |
|||
translate=True, |
|||
help="Text to display aside the checkbox to approve internal rules." |
|||
) |
|||
|
|||
@api.onchange('data_policy_approval_required') |
|||
def onchange_data_policy_approval_required(self): |
|||
if self.data_policy_approval_required: |
|||
self.display_data_policy_approval = True |
|||
|
|||
@api.onchange('internal_rules_approval_required') |
|||
def onchange_internal_rules_approval_required(self): |
|||
if self.internal_rules_approval_required: |
|||
self.display_internal_rules_approval = True |
|||
# Copyright 2019 Coop IT Easy SCRL fs |
|||
# Houssine Bakkali <houssine@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class ResCompany(models.Model): |
|||
_inherit = "res.company" |
|||
|
|||
def _compute_base_logo(self): |
|||
base_url = ( |
|||
self.env["ir.config_parameter"].sudo().get_param("web.base.url") |
|||
) |
|||
self.logo_url = base_url + "/logo.png" |
|||
|
|||
coop_email_contact = fields.Char( |
|||
string="Contact email address for the" " cooperator" |
|||
) |
|||
subscription_maximum_amount = fields.Float( |
|||
string="Maximum authorised" " subscription amount" |
|||
) |
|||
default_country_id = fields.Many2one( |
|||
"res.country", |
|||
string="Default country", |
|||
default=lambda self: self.country_id, |
|||
) |
|||
default_lang_id = fields.Many2one("res.lang", string="Default lang") |
|||
allow_id_card_upload = fields.Boolean(string="Allow ID Card upload") |
|||
create_user = fields.Boolean( |
|||
string="Create user for cooperator", default=False |
|||
) |
|||
board_representative = fields.Char(string="Board representative name") |
|||
signature_scan = fields.Binary(string="Board representative signature") |
|||
property_cooperator_account = fields.Many2one( |
|||
"account.account", |
|||
company_dependent=True, |
|||
string="Cooperator Account", |
|||
domain=[ |
|||
("internal_type", "=", "receivable"), |
|||
("deprecated", "=", False), |
|||
], |
|||
help="This account will be" |
|||
" the default one as the" |
|||
" receivable account for the" |
|||
" cooperators", |
|||
required=True, |
|||
) |
|||
unmix_share_type = fields.Boolean( |
|||
string="Unmix share type", |
|||
default=True, |
|||
help="If checked, A cooperator will be" |
|||
" authorised to have only one type" |
|||
" of share", |
|||
) |
|||
display_logo1 = fields.Boolean(string="Display logo 1") |
|||
display_logo2 = fields.Boolean(string="Display logo 2") |
|||
bottom_logo1 = fields.Binary(string="Bottom logo 1") |
|||
bottom_logo2 = fields.Binary(string="Bottom logo 2") |
|||
logo_url = fields.Char(string="logo url", compute="_compute_base_logo") |
|||
display_data_policy_approval = fields.Boolean( |
|||
help="Choose to display a data policy checkbox on the cooperator" |
|||
" website form." |
|||
) |
|||
data_policy_approval_required = fields.Boolean( |
|||
string="Is data policy approval required?" |
|||
) |
|||
data_policy_approval_text = fields.Html( |
|||
translate=True, |
|||
help="Text to display aside the checkbox to approve data policy.", |
|||
) |
|||
display_internal_rules_approval = fields.Boolean( |
|||
help="Choose to display an internal rules checkbox on the" |
|||
" cooperator website form." |
|||
) |
|||
internal_rules_approval_required = fields.Boolean( |
|||
string="Is internal rules approval required?" |
|||
) |
|||
internal_rules_approval_text = fields.Html( |
|||
translate=True, |
|||
help="Text to display aside the checkbox to approve internal rules.", |
|||
) |
|||
|
|||
@api.onchange("data_policy_approval_required") |
|||
def onchange_data_policy_approval_required(self): |
|||
if self.data_policy_approval_required: |
|||
self.display_data_policy_approval = True |
|||
|
|||
@api.onchange("internal_rules_approval_required") |
|||
def onchange_internal_rules_approval_required(self): |
|||
if self.internal_rules_approval_required: |
|||
self.display_internal_rules_approval = True |
1714
easy_my_coop/models/coop.py
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,335 +1,436 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2019 Coop IT Easy SCRL fs |
|||
# Houssine Bakkali <houssine@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from datetime import datetime |
|||
|
|||
from odoo import api, fields, models, _ |
|||
from odoo.exceptions import ValidationError |
|||
|
|||
|
|||
class operation_request(models.Model): |
|||
_name = 'operation.request' |
|||
_description = "Operation request" |
|||
|
|||
def get_date_now(self): |
|||
# fixme odoo 12 uses date types |
|||
return datetime.strftime(datetime.now(), '%Y-%m-%d') |
|||
|
|||
@api.multi |
|||
@api.depends('share_product_id', 'share_product_id.list_price', 'quantity') |
|||
def _compute_subscription_amount(self): |
|||
for operation_request in self: |
|||
operation_request.subscription_amount = (operation_request. |
|||
share_product_id. |
|||
list_price * |
|||
operation_request. |
|||
quantity) |
|||
|
|||
request_date = fields.Date(string='Request date', |
|||
default=lambda self: self.get_date_now()) |
|||
partner_id = fields.Many2one('res.partner', |
|||
string='Cooperator', |
|||
domain=[('member', '=', True)], |
|||
required=True) |
|||
partner_id_to = fields.Many2one('res.partner', |
|||
string='Transfered to', |
|||
domain=[('cooperator', '=', True)]) |
|||
operation_type = fields.Selection([('subscription', 'Subscription'), |
|||
('transfer', 'Transfer'), |
|||
('sell_back', 'Sell Back'), |
|||
('convert', 'Conversion')], |
|||
string='Operation Type', |
|||
required=True) |
|||
share_product_id = fields.Many2one('product.product', |
|||
string='Share type', |
|||
domain=[('is_share', '=', True)], |
|||
required=True) |
|||
share_to_product_id = fields.Many2one('product.product', |
|||
string='Convert to this share type', |
|||
domain=[('is_share', '=', True)]) |
|||
share_short_name = fields.Char(related='share_product_id.short_name', |
|||
string='Share type name') |
|||
share_to_short_name = fields.Char(related='share_to_product_id.short_name', |
|||
string='Share to type name') |
|||
share_unit_price = fields.Float(related='share_product_id.list_price', |
|||
string='Share price') |
|||
share_to_unit_price = fields.Float(related='share_to_product_id.list_price', |
|||
string='Share to price') |
|||
subscription_amount = fields.Float(compute='_compute_subscription_amount', |
|||
string='Operation amount') |
|||
quantity = fields.Integer(string='Number of share', |
|||
required=True) |
|||
state = fields.Selection([('draft', 'Draft'), |
|||
('waiting', 'Waiting'), |
|||
('approved', 'Approved'), |
|||
('done', 'Done'), |
|||
('cancelled', 'Cancelled'), |
|||
('refused', 'Refused')], |
|||
string='State', |
|||
required=True, |
|||
default='draft') |
|||
user_id = fields.Many2one('res.users', |
|||
string='Responsible', |
|||
readonly=True, |
|||
default=lambda self: self.env.user) |
|||
subscription_request = fields.One2many('subscription.request', |
|||
'operation_request_id', |
|||
string="Share Receiver Info", |
|||
help="In case on a transfer of" |
|||
" share. If the share receiver" |
|||
" isn't a effective member then a" |
|||
" subscription form should" |
|||
" be filled.") |
|||
receiver_not_member = fields.Boolean(string='Receiver is not a member') |
|||
company_id = fields.Many2one('res.company', |
|||
string='Company', |
|||
required=True, |
|||
change_default=True, |
|||
readonly=True, |
|||
default=lambda self: self.env['res.company']._company_default_get()) |
|||
|
|||
invoice = fields.Many2one('account.invoice', |
|||
string="Invoice") |
|||
|
|||
@api.multi |
|||
def approve_operation(self): |
|||
for rec in self: |
|||
rec.write({'state': 'approved'}) |
|||
|
|||
@api.multi |
|||
def refuse_operation(self): |
|||
for rec in self: |
|||
rec.write({'state': 'refused'}) |
|||
|
|||
@api.multi |
|||
def submit_operation(self): |
|||
for rec in self: |
|||
rec.validate() |
|||
rec.write({'state': 'waiting'}) |
|||
|
|||
@api.multi |
|||
def cancel_operation(self): |
|||
for rec in self: |
|||
rec.write({'state': 'cancelled'}) |
|||
|
|||
@api.multi |
|||
def reset_to_draft(self): |
|||
for rec in self: |
|||
rec.write({'state': 'draft'}) |
|||
|
|||
def get_total_share_dic(self, partner): |
|||
total_share_dic = {} |
|||
share_products = self.env['product.product'].search([('is_share', '=', True)]) |
|||
|
|||
for share_product in share_products: |
|||
total_share_dic[share_product.id] = 0 |
|||
|
|||
for line in partner.share_ids: |
|||
total_share_dic[line.share_product_id.id] += line.share_number |
|||
|
|||
return total_share_dic |
|||
|
|||
# This function doesn't handle the case of a cooperator can own |
|||
# different kinds of share type |
|||
def hand_share_over(self, partner, share_product_id, quantity): |
|||
if not partner.member: |
|||
raise ValidationError(_("This operation can't be executed if the" |
|||
" cooperator is not an effective member")) |
|||
|
|||
share_ind = len(partner.share_ids) |
|||
i = 1 |
|||
while quantity > 0: |
|||
line = self.partner_id.share_ids[share_ind-i] |
|||
if line.share_product_id.id == share_product_id.id: |
|||
if quantity > line.share_number: |
|||
quantity -= line.share_number |
|||
line.unlink() |
|||
else: |
|||
share_left = line.share_number - quantity |
|||
quantity = 0 |
|||
line.write({'share_number': share_left}) |
|||
i += 1 |
|||
# if the cooperator sold all his shares he's no more |
|||
# an effective member |
|||
remaning_share_dict = 0 |
|||
for share_quant in self.get_total_share_dic(partner).values(): |
|||
remaning_share_dict += share_quant |
|||
if remaning_share_dict == 0: |
|||
self.partner_id.write({'member': False, 'old_member': True}) |
|||
|
|||
def has_share_type(self): |
|||
for line in self.partner_id.share_ids: |
|||
if line.share_product_id.id == self.share_product_id.id: |
|||
return True |
|||
return False |
|||
|
|||
def validate(self): |
|||
if not self.has_share_type() and \ |
|||
self.operation_type in ['sell_back', 'transfer']: |
|||
raise ValidationError(_("The cooperator doesn't own this share" |
|||
" type. Please choose the appropriate" |
|||
" share type.")) |
|||
|
|||
if self.operation_type in ['sell_back', 'convert', 'transfer']: |
|||
total_share_dic = self.get_total_share_dic(self.partner_id) |
|||
|
|||
if self.quantity > total_share_dic[self.share_product_id.id]: |
|||
raise ValidationError(_("The cooperator can't hand over more" |
|||
" shares that he/she owns.")) |
|||
|
|||
if self.operation_type == 'convert': |
|||
if self.company_id.unmix_share_type: |
|||
if self.share_product_id.code == self.share_to_product_id.code: |
|||
raise ValidationError(_("You can't convert the share to" |
|||
" the same share type.")) |
|||
if self.subscription_amount != self.partner_id.total_value: |
|||
raise ValidationError(_("You must convert all the shares" |
|||
" to the selected type.")) |
|||
else: |
|||
if self.subscription_amount != self.partner_id.total_value: |
|||
raise ValidationError(_("Converting just part of the" |
|||
" shares is not yet implemented")) |
|||
elif self.operation_type == 'transfer': |
|||
if not self.receiver_not_member and self.company_id.unmix_share_type \ |
|||
and (self.partner_id_to.cooperator_type |
|||
and self.partner_id.cooperator_type != self.partner_id_to.cooperator_type): |
|||
raise ValidationError(_("This share type could not be" |
|||
" transfered to " + |
|||
self.partner_id_to.name)) |
|||
if self.partner_id_to.is_company \ |
|||
and not self.share_product_id.by_company: |
|||
raise ValidationError(_("This share can not be" |
|||
" subscribed by a company")) |
|||
if not self.partner_id_to.is_company \ |
|||
and not self.share_product_id.by_individual: |
|||
raise ValidationError(_("This share can not be" |
|||
" subscribed an individual")) |
|||
if self.receiver_not_member and self.subscription_request \ |
|||
and not self.subscription_request.validated: |
|||
raise ValidationError(_("The information of the receiver" |
|||
" are not correct. Please correct" |
|||
" the information before" |
|||
" submitting")) |
|||
|
|||
def get_share_trans_mail_template(self): |
|||
return self.env.ref('easy_my_coop.email_template_share_transfer', |
|||
False) |
|||
|
|||
def get_share_update_mail_template(self): |
|||
return self.env.ref('easy_my_coop.email_template_share_update', |
|||
False) |
|||
|
|||
def send_share_trans_mail(self, sub_register_line): # Unused argument is used in synergie project. Do not remove. |
|||
cert_email_template = self.get_share_trans_mail_template() |
|||
cert_email_template.send_mail(self.partner_id_to.id, False) |
|||
|
|||
def send_share_update_mail(self, sub_register_line): # Unused argument is used in synergie project. Do not remove. |
|||
cert_email_template = self.get_share_update_mail_template() |
|||
cert_email_template.send_mail(self.partner_id.id, False) |
|||
|
|||
def get_subscription_register_vals(self, effective_date): |
|||
return { |
|||
'partner_id': self.partner_id.id, 'quantity': self.quantity, |
|||
'share_product_id': self.share_product_id.id, |
|||
'type': self.operation_type, |
|||
'share_unit_price': self.share_unit_price, |
|||
'date': effective_date, |
|||
} |
|||
|
|||
@api.multi |
|||
def execute_operation(self): |
|||
self.ensure_one() |
|||
|
|||
effective_date = self.get_date_now() |
|||
sub_request = self.env['subscription.request'] |
|||
|
|||
self.validate() |
|||
|
|||
if self.state != 'approved': |
|||
raise ValidationError(_("This operation must be approved" |
|||
" before to be executed")) |
|||
|
|||
values = self.get_subscription_register_vals(effective_date) |
|||
|
|||
if self.operation_type == 'sell_back': |
|||
self.hand_share_over(self.partner_id, self.share_product_id, |
|||
self.quantity) |
|||
elif self.operation_type == 'convert': |
|||
amount_to_convert = self.share_unit_price * self.quantity |
|||
convert_quant = int(amount_to_convert / self.share_to_product_id.list_price) |
|||
remainder = amount_to_convert % self.share_to_product_id.list_price |
|||
|
|||
if convert_quant > 0 and remainder == 0: |
|||
share_ids = self.partner_id.share_ids |
|||
line = share_ids[0] |
|||
if len(share_ids) > 1: |
|||
share_ids[1:len(share_ids)].unlink() |
|||
line.write({ |
|||
'share_number': convert_quant, |
|||
'share_product_id': self.share_to_product_id.id, |
|||
'share_unit_price': self.share_to_unit_price, |
|||
'share_short_name': self.share_to_short_name |
|||
}) |
|||
values['share_to_product_id'] = self.share_to_product_id.id |
|||
values['quantity_to'] = convert_quant |
|||
else: |
|||
raise ValidationError(_("Converting just part of the" |
|||
" shares is not yet implemented")) |
|||
elif self.operation_type == 'transfer': |
|||
sequence_id = self.env.ref('easy_my_coop.sequence_subscription', False) |
|||
partner_vals = {'member': True} |
|||
if self.receiver_not_member: |
|||
partner = self.subscription_request.create_coop_partner() |
|||
# get cooperator number |
|||
sub_reg_num = int(sequence_id.next_by_id()) |
|||
partner_vals.update(sub_request.get_eater_vals( |
|||
partner, |
|||
self.share_product_id)) |
|||
partner_vals['cooperator_register_number'] = sub_reg_num |
|||
partner.write(partner_vals) |
|||
self.partner_id_to = partner |
|||
else: |
|||
# means an old member or cooperator candidate |
|||
if not self.partner_id_to.member: |
|||
if self.partner_id_to.cooperator_register_number == 0: |
|||
sub_reg_num = int(sequence_id.next_by_id()) |
|||
partner_vals['cooperator_register_number'] = sub_reg_num |
|||
partner_vals.update(sub_request.get_eater_vals( |
|||
self.partner_id_to, |
|||
self.share_product_id)) |
|||
partner_vals['old_member'] = False |
|||
self.partner_id_to.write(partner_vals) |
|||
# remove the parts to the giver |
|||
self.hand_share_over(self.partner_id, |
|||
self.share_product_id, |
|||
self.quantity) |
|||
# give the share to the receiver |
|||
self.env['share.line'].create({ |
|||
'share_number': self.quantity, |
|||
'partner_id': self.partner_id_to.id, |
|||
'share_product_id': self.share_product_id.id, |
|||
'share_unit_price': self.share_unit_price, |
|||
'effective_date': effective_date}) |
|||
values['partner_id_to'] = self.partner_id_to.id |
|||
else: |
|||
raise ValidationError(_("This operation is not yet" |
|||
" implemented.")) |
|||
|
|||
sequence_operation = self.env.ref('easy_my_coop.sequence_register_operation', False) #noqa |
|||
sub_reg_operation = sequence_operation.next_by_id() |
|||
|
|||
values['name'] = sub_reg_operation |
|||
values['register_number_operation'] = int(sub_reg_operation) |
|||
|
|||
self.write({'state': 'done'}) |
|||
|
|||
sub_register_line = self.env['subscription.register'].create(values) |
|||
|
|||
# send mail to the receiver |
|||
if self.operation_type == 'transfer': |
|||
self.send_share_trans_mail(sub_register_line) |
|||
|
|||
self.send_share_update_mail(sub_register_line) |
|||
# Copyright 2019 Coop IT Easy SCRL fs |
|||
# Houssine Bakkali <houssine@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from datetime import datetime |
|||
|
|||
from odoo import _, api, fields, models |
|||
from odoo.exceptions import ValidationError |
|||
|
|||
|
|||
class OperationRequest(models.Model): |
|||
_name = "operation.request" |
|||
_description = "Operation request" |
|||
|
|||
def get_date_now(self): |
|||
# fixme odoo 12 uses date types |
|||
return datetime.strftime(datetime.now(), "%Y-%m-%d") |
|||
|
|||
@api.multi |
|||
@api.depends("share_product_id", "share_product_id.list_price", "quantity") |
|||
def _compute_subscription_amount(self): |
|||
for operation_request in self: |
|||
operation_request.subscription_amount = ( |
|||
operation_request.share_product_id.list_price |
|||
* operation_request.quantity |
|||
) |
|||
|
|||
request_date = fields.Date( |
|||
string="Request date", default=lambda self: self.get_date_now() |
|||
) |
|||
partner_id = fields.Many2one( |
|||
"res.partner", |
|||
string="Cooperator", |
|||
domain=[("member", "=", True)], |
|||
required=True, |
|||
) |
|||
partner_id_to = fields.Many2one( |
|||
"res.partner", |
|||
string="Transfered to", |
|||
domain=[("cooperator", "=", True)], |
|||
) |
|||
operation_type = fields.Selection( |
|||
[ |
|||
("subscription", "Subscription"), |
|||
("transfer", "Transfer"), |
|||
("sell_back", "Sell Back"), |
|||
("convert", "Conversion"), |
|||
], |
|||
string="Operation Type", |
|||
required=True, |
|||
) |
|||
share_product_id = fields.Many2one( |
|||
"product.product", |
|||
string="Share type", |
|||
domain=[("is_share", "=", True)], |
|||
required=True, |
|||
) |
|||
share_to_product_id = fields.Many2one( |
|||
"product.product", |
|||
string="Convert to this share type", |
|||
domain=[("is_share", "=", True)], |
|||
) |
|||
share_short_name = fields.Char( |
|||
related="share_product_id.short_name", string="Share type name" |
|||
) |
|||
share_to_short_name = fields.Char( |
|||
related="share_to_product_id.short_name", string="Share to type name" |
|||
) |
|||
share_unit_price = fields.Float( |
|||
related="share_product_id.list_price", string="Share price" |
|||
) |
|||
share_to_unit_price = fields.Float( |
|||
related="share_to_product_id.list_price", string="Share to price" |
|||
) |
|||
subscription_amount = fields.Float( |
|||
compute="_compute_subscription_amount", string="Operation amount" |
|||
) |
|||
quantity = fields.Integer(string="Number of share", required=True) |
|||
state = fields.Selection( |
|||
[ |
|||
("draft", "Draft"), |
|||
("waiting", "Waiting"), |
|||
("approved", "Approved"), |
|||
("done", "Done"), |
|||
("cancelled", "Cancelled"), |
|||
("refused", "Refused"), |
|||
], |
|||
string="State", |
|||
required=True, |
|||
default="draft", |
|||
) |
|||
user_id = fields.Many2one( |
|||
"res.users", |
|||
string="Responsible", |
|||
readonly=True, |
|||
default=lambda self: self.env.user, |
|||
) |
|||
subscription_request = fields.One2many( |
|||
"subscription.request", |
|||
"operation_request_id", |
|||
string="Share Receiver Info", |
|||
help="In case on a transfer of" |
|||
" share. If the share receiver" |
|||
" isn't a effective member then a" |
|||
" subscription form should" |
|||
" be filled.", |
|||
) |
|||
receiver_not_member = fields.Boolean(string="Receiver is not a member") |
|||
company_id = fields.Many2one( |
|||
"res.company", |
|||
string="Company", |
|||
required=True, |
|||
change_default=True, |
|||
readonly=True, |
|||
default=lambda self: self.env["res.company"]._company_default_get(), |
|||
) |
|||
|
|||
invoice = fields.Many2one("account.invoice", string="Invoice") |
|||
|
|||
@api.multi |
|||
def approve_operation(self): |
|||
for rec in self: |
|||
rec.write({"state": "approved"}) |
|||
|
|||
@api.multi |
|||
def refuse_operation(self): |
|||
for rec in self: |
|||
rec.write({"state": "refused"}) |
|||
|
|||
@api.multi |
|||
def submit_operation(self): |
|||
for rec in self: |
|||
rec.validate() |
|||
rec.write({"state": "waiting"}) |
|||
|
|||
@api.multi |
|||
def cancel_operation(self): |
|||
for rec in self: |
|||
rec.write({"state": "cancelled"}) |
|||
|
|||
@api.multi |
|||
def reset_to_draft(self): |
|||
for rec in self: |
|||
rec.write({"state": "draft"}) |
|||
|
|||
def get_total_share_dic(self, partner): |
|||
total_share_dic = {} |
|||
share_products = self.env["product.product"].search( |
|||
[("is_share", "=", True)] |
|||
) |
|||
|
|||
for share_product in share_products: |
|||
total_share_dic[share_product.id] = 0 |
|||
|
|||
for line in partner.share_ids: |
|||
total_share_dic[line.share_product_id.id] += line.share_number |
|||
|
|||
return total_share_dic |
|||
|
|||
# This function doesn't handle the case of a cooperator can own |
|||
# different kinds of share type |
|||
def hand_share_over(self, partner, share_product_id, quantity): |
|||
if not partner.member: |
|||
raise ValidationError( |
|||
_( |
|||
"This operation can't be executed if the" |
|||
" cooperator is not an effective member" |
|||
) |
|||
) |
|||
|
|||
share_ind = len(partner.share_ids) |
|||
i = 1 |
|||
while quantity > 0: |
|||
line = self.partner_id.share_ids[share_ind - i] |
|||
if line.share_product_id.id == share_product_id.id: |
|||
if quantity > line.share_number: |
|||
quantity -= line.share_number |
|||
line.unlink() |
|||
else: |
|||
share_left = line.share_number - quantity |
|||
quantity = 0 |
|||
line.write({"share_number": share_left}) |
|||
i += 1 |
|||
# if the cooperator sold all his shares he's no more |
|||
# an effective member |
|||
remaning_share_dict = 0 |
|||
for share_quant in self.get_total_share_dic(partner).values(): |
|||
remaning_share_dict += share_quant |
|||
if remaning_share_dict == 0: |
|||
self.partner_id.write({"member": False, "old_member": True}) |
|||
|
|||
def has_share_type(self): |
|||
for line in self.partner_id.share_ids: |
|||
if line.share_product_id.id == self.share_product_id.id: |
|||
return True |
|||
return False |
|||
|
|||
def validate(self): |
|||
if not self.has_share_type() and self.operation_type in [ |
|||
"sell_back", |
|||
"transfer", |
|||
]: |
|||
raise ValidationError( |
|||
_( |
|||
"The cooperator doesn't own this share" |
|||
" type. Please choose the appropriate" |
|||
" share type." |
|||
) |
|||
) |
|||
|
|||
if self.operation_type in ["sell_back", "convert", "transfer"]: |
|||
total_share_dic = self.get_total_share_dic(self.partner_id) |
|||
|
|||
if self.quantity > total_share_dic[self.share_product_id.id]: |
|||
raise ValidationError( |
|||
_( |
|||
"The cooperator can't hand over more" |
|||
" shares that he/she owns." |
|||
) |
|||
) |
|||
|
|||
if self.operation_type == "convert": |
|||
if self.company_id.unmix_share_type: |
|||
if self.share_product_id.code == self.share_to_product_id.code: |
|||
raise ValidationError( |
|||
_( |
|||
"You can't convert the share to" |
|||
" the same share type." |
|||
) |
|||
) |
|||
if self.subscription_amount != self.partner_id.total_value: |
|||
raise ValidationError( |
|||
_( |
|||
"You must convert all the shares" |
|||
" to the selected type." |
|||
) |
|||
) |
|||
else: |
|||
if self.subscription_amount != self.partner_id.total_value: |
|||
raise ValidationError( |
|||
_( |
|||
"Converting just part of the" |
|||
" shares is not yet implemented" |
|||
) |
|||
) |
|||
elif self.operation_type == "transfer": |
|||
if ( |
|||
not self.receiver_not_member |
|||
and self.company_id.unmix_share_type |
|||
and ( |
|||
self.partner_id_to.cooperator_type |
|||
and self.partner_id.cooperator_type |
|||
!= self.partner_id_to.cooperator_type |
|||
) |
|||
): |
|||
raise ValidationError( |
|||
_( |
|||
"This share type could not be" |
|||
" transfered to " + self.partner_id_to.name |
|||
) |
|||
) |
|||
if ( |
|||
self.partner_id_to.is_company |
|||
and not self.share_product_id.by_company |
|||
): |
|||
raise ValidationError( |
|||
_("This share can not be" " subscribed by a company") |
|||
) |
|||
if ( |
|||
not self.partner_id_to.is_company |
|||
and not self.share_product_id.by_individual |
|||
): |
|||
raise ValidationError( |
|||
_("This share can not be" " subscribed an individual") |
|||
) |
|||
if ( |
|||
self.receiver_not_member |
|||
and self.subscription_request |
|||
and not self.subscription_request.validated |
|||
): |
|||
raise ValidationError( |
|||
_( |
|||
"The information of the receiver" |
|||
" are not correct. Please correct" |
|||
" the information before" |
|||
" submitting" |
|||
) |
|||
) |
|||
|
|||
def get_share_trans_mail_template(self): |
|||
return self.env.ref( |
|||
"easy_my_coop.email_template_share_transfer", False |
|||
) |
|||
|
|||
def get_share_update_mail_template(self): |
|||
return self.env.ref("easy_my_coop.email_template_share_update", False) |
|||
|
|||
def send_share_trans_mail( |
|||
self, sub_register_line |
|||
): # Unused argument is used in synergie project. Do not remove. |
|||
cert_email_template = self.get_share_trans_mail_template() |
|||
cert_email_template.send_mail(self.partner_id_to.id, False) |
|||
|
|||
def send_share_update_mail( |
|||
self, sub_register_line |
|||
): # Unused argument is used in synergie project. Do not remove. |
|||
cert_email_template = self.get_share_update_mail_template() |
|||
cert_email_template.send_mail(self.partner_id.id, False) |
|||
|
|||
def get_subscription_register_vals(self, effective_date): |
|||
return { |
|||
"partner_id": self.partner_id.id, |
|||
"quantity": self.quantity, |
|||
"share_product_id": self.share_product_id.id, |
|||
"type": self.operation_type, |
|||
"share_unit_price": self.share_unit_price, |
|||
"date": effective_date, |
|||
} |
|||
|
|||
@api.multi |
|||
def execute_operation(self): |
|||
self.ensure_one() |
|||
|
|||
effective_date = self.get_date_now() |
|||
sub_request = self.env["subscription.request"] |
|||
|
|||
self.validate() |
|||
|
|||
if self.state != "approved": |
|||
raise ValidationError( |
|||
_("This operation must be approved" " before to be executed") |
|||
) |
|||
|
|||
values = self.get_subscription_register_vals(effective_date) |
|||
|
|||
if self.operation_type == "sell_back": |
|||
self.hand_share_over( |
|||
self.partner_id, self.share_product_id, self.quantity |
|||
) |
|||
elif self.operation_type == "convert": |
|||
amount_to_convert = self.share_unit_price * self.quantity |
|||
convert_quant = int( |
|||
amount_to_convert / self.share_to_product_id.list_price |
|||
) |
|||
remainder = amount_to_convert % self.share_to_product_id.list_price |
|||
|
|||
if convert_quant > 0 and remainder == 0: |
|||
share_ids = self.partner_id.share_ids |
|||
line = share_ids[0] |
|||
if len(share_ids) > 1: |
|||
share_ids[1 : len(share_ids)].unlink() |
|||
line.write( |
|||
{ |
|||
"share_number": convert_quant, |
|||
"share_product_id": self.share_to_product_id.id, |
|||
"share_unit_price": self.share_to_unit_price, |
|||
"share_short_name": self.share_to_short_name, |
|||
} |
|||
) |
|||
values["share_to_product_id"] = self.share_to_product_id.id |
|||
values["quantity_to"] = convert_quant |
|||
else: |
|||
raise ValidationError( |
|||
_( |
|||
"Converting just part of the" |
|||
" shares is not yet implemented" |
|||
) |
|||
) |
|||
elif self.operation_type == "transfer": |
|||
sequence_id = self.env.ref( |
|||
"easy_my_coop.sequence_subscription", False |
|||
) |
|||
partner_vals = {"member": True} |
|||
if self.receiver_not_member: |
|||
partner = self.subscription_request.create_coop_partner() |
|||
# get cooperator number |
|||
sub_reg_num = int(sequence_id.next_by_id()) |
|||
partner_vals.update( |
|||
sub_request.get_eater_vals(partner, self.share_product_id) |
|||
) |
|||
partner_vals["cooperator_register_number"] = sub_reg_num |
|||
partner.write(partner_vals) |
|||
self.partner_id_to = partner |
|||
else: |
|||
# means an old member or cooperator candidate |
|||
if not self.partner_id_to.member: |
|||
if self.partner_id_to.cooperator_register_number == 0: |
|||
sub_reg_num = int(sequence_id.next_by_id()) |
|||
partner_vals[ |
|||
"cooperator_register_number" |
|||
] = sub_reg_num |
|||
partner_vals.update( |
|||
sub_request.get_eater_vals( |
|||
self.partner_id_to, self.share_product_id |
|||
) |
|||
) |
|||
partner_vals["old_member"] = False |
|||
self.partner_id_to.write(partner_vals) |
|||
# remove the parts to the giver |
|||
self.hand_share_over( |
|||
self.partner_id, self.share_product_id, self.quantity |
|||
) |
|||
# give the share to the receiver |
|||
self.env["share.line"].create( |
|||
{ |
|||
"share_number": self.quantity, |
|||
"partner_id": self.partner_id_to.id, |
|||
"share_product_id": self.share_product_id.id, |
|||
"share_unit_price": self.share_unit_price, |
|||
"effective_date": effective_date, |
|||
} |
|||
) |
|||
values["partner_id_to"] = self.partner_id_to.id |
|||
else: |
|||
raise ValidationError( |
|||
_("This operation is not yet" " implemented.") |
|||
) |
|||
|
|||
sequence_operation = self.env.ref( |
|||
"easy_my_coop.sequence_register_operation", False |
|||
) # noqa |
|||
sub_reg_operation = sequence_operation.next_by_id() |
|||
|
|||
values["name"] = sub_reg_operation |
|||
values["register_number_operation"] = int(sub_reg_operation) |
|||
|
|||
self.write({"state": "done"}) |
|||
|
|||
sub_register_line = self.env["subscription.register"].create(values) |
|||
|
|||
# send mail to the receiver |
|||
if self.operation_type == "transfer": |
|||
self.send_share_trans_mail(sub_register_line) |
|||
|
|||
self.send_share_update_mail(sub_register_line) |
@ -1,37 +1,41 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2019 Coop IT Easy SCRL fs |
|||
# Houssine Bakkali <houssine@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class ProductTemplate(models.Model): |
|||
_inherit = 'product.template' |
|||
|
|||
is_share = fields.Boolean(string="Is share?") |
|||
short_name = fields.Char(string="Short name") |
|||
display_on_website = fields.Boolean(string="Display on website") |
|||
default_share_product = fields.Boolean(string="Default share product") |
|||
minimum_quantity = fields.Integer(string="Minimum quantity", default=1) |
|||
force_min_qty = fields.Boolean(String="Force minimum quantity?") |
|||
by_company = fields.Boolean(string="Can be subscribed by companies?") |
|||
by_individual = fields.Boolean(string="Can be subscribed by individuals?") |
|||
customer = fields.Boolean(string="Become customer") |
|||
mail_template = fields.Many2one('mail.template', |
|||
string="Mail template") |
|||
|
|||
@api.multi |
|||
def get_web_share_products(self, is_company): |
|||
if is_company is True: |
|||
product_templates = self.env['product.template'].search([ |
|||
('is_share', '=', True), |
|||
('display_on_website', '=', True), |
|||
('by_company', '=', True)]) |
|||
else: |
|||
product_templates = self.env['product.template'].search([ |
|||
('is_share', '=', True), |
|||
('display_on_website', '=', True), |
|||
('by_individual', '=', True)]) |
|||
return product_templates |
|||
# Copyright 2019 Coop IT Easy SCRL fs |
|||
# Houssine Bakkali <houssine@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class ProductTemplate(models.Model): |
|||
_inherit = "product.template" |
|||
|
|||
is_share = fields.Boolean(string="Is share?") |
|||
short_name = fields.Char(string="Short name") |
|||
display_on_website = fields.Boolean(string="Display on website") |
|||
default_share_product = fields.Boolean(string="Default share product") |
|||
minimum_quantity = fields.Integer(string="Minimum quantity", default=1) |
|||
force_min_qty = fields.Boolean(String="Force minimum quantity?") |
|||
by_company = fields.Boolean(string="Can be subscribed by companies?") |
|||
by_individual = fields.Boolean(string="Can be subscribed by individuals?") |
|||
customer = fields.Boolean(string="Become customer") |
|||
mail_template = fields.Many2one("mail.template", string="Mail template") |
|||
|
|||
@api.multi |
|||
def get_web_share_products(self, is_company): |
|||
if is_company is True: |
|||
product_templates = self.env["product.template"].search( |
|||
[ |
|||
("is_share", "=", True), |
|||
("display_on_website", "=", True), |
|||
("by_company", "=", True), |
|||
] |
|||
) |
|||
else: |
|||
product_templates = self.env["product.template"].search( |
|||
[ |
|||
("is_share", "=", True), |
|||
("display_on_website", "=", True), |
|||
("by_individual", "=", True), |
|||
] |
|||
) |
|||
return product_templates |
@ -1,15 +1,14 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2019 Coop IT Easy SCRL fs |
|||
# Houssine Bakkali <houssine@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from odoo import models |
|||
|
|||
|
|||
class ResPartnerBank(models.Model): |
|||
_inherit = 'res.partner.bank' |
|||
|
|||
_sql_constraints = [ |
|||
('unique_number', 'Check(1=1)', 'Account Number must be unique!'), |
|||
] |
|||
# Copyright 2019 Coop IT Easy SCRL fs |
|||
# Houssine Bakkali <houssine@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from odoo import models |
|||
|
|||
|
|||
class ResPartnerBank(models.Model): |
|||
_inherit = "res.partner.bank" |
|||
|
|||
_sql_constraints = [ |
|||
("unique_number", "Check(1=1)", "Account Number must be unique!") |
|||
] |
@ -0,0 +1 @@ |
|||
* Coop IT Easy SCRLfs |
@ -0,0 +1 @@ |
|||
This module allows to manage the cooperator subscription and all the cooperative business processes. |
@ -1,13 +1,19 @@ |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class AccountInvoiceReport(models.Model): |
|||
_inherit = "account.invoice.report" |
|||
|
|||
release_capital_request = fields.Boolean(string="Release capital request") |
|||
|
|||
def _select(self): |
|||
return super(AccountInvoiceReport, self)._select() + ", sub.release_capital_request as release_capital_request" |
|||
|
|||
def _sub_select(self): |
|||
return super(AccountInvoiceReport, self)._sub_select() + ", ai.release_capital_request as release_capital_request" |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class AccountInvoiceReport(models.Model): |
|||
_inherit = "account.invoice.report" |
|||
|
|||
release_capital_request = fields.Boolean(string="Release capital request") |
|||
|
|||
def _select(self): |
|||
return ( |
|||
super(AccountInvoiceReport, self)._select() |
|||
+ ", sub.release_capital_request as release_capital_request" |
|||
) |
|||
|
|||
def _sub_select(self): |
|||
return ( |
|||
super(AccountInvoiceReport, self)._sub_select() |
|||
+ ", ai.release_capital_request as release_capital_request" |
|||
) |
@ -1,121 +1,145 @@ |
|||
<odoo> |
|||
<template id="cooperator_register_G001"> |
|||
<t t-call="web.html_container"> |
|||
<template id="cooperator_register_G001"> |
|||
<t t-call="web.html_container"> |
|||
|
|||
<t t-set="data_report_margin_top" t-value="5"/> |
|||
<t t-set="data_report_header_spacing" t-value="0"/> |
|||
<t t-set="data_report_dpi" t-value="110"/> |
|||
|
|||
<!--<t t-call="theme_light.report_layout_002">--> |
|||
<t t-set="data_report_margin_top" t-value="5"/> |
|||
<t t-set="data_report_header_spacing" t-value="0"/> |
|||
<t t-set="data_report_dpi" t-value="110"/> |
|||
|
|||
<div class="page"> |
|||
<head> |
|||
<!--<link href="/theme_light/static/css/invoice_G002.css" rel="stylesheet"/>--> |
|||
</head> |
|||
|
|||
<!--<t t-call="theme_light.list_header_G002"/>--> |
|||
<!--<t t-call="theme_light.report_layout_002">--> |
|||
|
|||
<br/><br/><br/><br/><br/> |
|||
<table class="title_table"> |
|||
<tr> |
|||
<td> |
|||
<span class="color_text" t-esc="time.strftime('%Y-%m-%d')"/> |
|||
</td> |
|||
<td> |
|||
<div class="title_doc" style="font-size:16px"> |
|||
<span>COOPERATOR REGISTER</span> |
|||
</div> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<div class="page"> |
|||
<head> |
|||
<!--<link href="/theme_light/static/css/invoice_G002.css" rel="stylesheet"/>--> |
|||
</head> |
|||
|
|||
<br/><br/><br/><br/><br/> |
|||
<!--<t t-call="theme_light.list_header_G002"/>--> |
|||
|
|||
|
|||
<table class="list_line_table_head" width="100%" > |
|||
|
|||
<t t-set="total_quantity" t-value="0"/> |
|||
<t t-set="total_amount" t-value="0"/> |
|||
|
|||
<br /> |
|||
<tr> |
|||
<th width="15%" style="text-align: center;" >Number</th> |
|||
<th width="25%" style="text-align: center;" >Name</th> |
|||
<th width="20%" style="text-align: center;" >Email</th> |
|||
<th width="15%" style="text-align: center;" >Effective date</th> |
|||
<th width="10%" style="text-align: center;" >Quantity</th> |
|||
<th width="15%" style="text-align: center;" >Total</th> |
|||
</tr> |
|||
<t t-set="nb_ligne" t-value="0"/> |
|||
|
|||
<t t-foreach="docs" t-as="partner"> |
|||
<t t-set="new_partner" t-value="0"/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<table class="title_table"> |
|||
<tr> |
|||
<td> |
|||
<span class="color_text" |
|||
t-esc="time.strftime('%Y-%m-%d')"/> |
|||
</td> |
|||
<td> |
|||
<div class="title_doc" style="font-size:16px"> |
|||
<span>COOPERATOR REGISTER</span> |
|||
</div> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
|
|||
<t t-foreach="partner.share_ids" t-as="line"> |
|||
<t t-set="nb_ligne" t-value="nb_ligne+1"/> |
|||
<tr height="40px"> |
|||
<div t-if="(nb_ligne%2)==1" > |
|||
<div t-if="(new_partner)==0"> |
|||
<td class="lgn_impair" style="text-align:left;text-indent:20px;"> |
|||
<span t-field="partner.cooperator_register_number" ></span> |
|||
</td> |
|||
<td style="text-align:left"> |
|||
<span t-field="partner.name" ></span> |
|||
</td> |
|||
<td style="text-align:left"> |
|||
<span t-field="partner.email" ></span> |
|||
</td> |
|||
</div> |
|||
|
|||
<div t-if="(new_partner)!=0"> |
|||
<td class="lgn_impair" style="text-align:left;text-indent:20px;" colspan="3"> |
|||
</td> |
|||
</div> |
|||
<td> |
|||
<span t-field="line.effective_date" ></span> |
|||
</td> |
|||
<td> |
|||
<span t-field="line.share_number" ></span> |
|||
</td> |
|||
<td> |
|||
<span t-field="line.total_amount_line" |
|||
t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> |
|||
</td> |
|||
</div> |
|||
<div t-if="(nb_ligne%2)==0" > |
|||
<div t-if="(new_partner)==0" > |
|||
<td class="lgn_pair" style="text-align:left;text-indent:20px;background-color:#ffffff"> |
|||
<span t-field="partner.cooperator_register_number" ></span> |
|||
</td> |
|||
<td class="lgn_pair" style="background-color:#ffffff;text-align:left"> |
|||
<span t-field="partner.name" ></span> |
|||
</td> |
|||
<td class="lgn_pair" style="background-color:#ffffff;text-align:left"> |
|||
<span t-field="partner.email" ></span> |
|||
</td> |
|||
</div> |
|||
<div t-if="(new_partner)!=0" style="background-color:#ffffff"> |
|||
<td class="lgn_pair" style="text-align:left;text-indent:20px;background-color:#ffffff" colspan="3"> |
|||
</td> |
|||
</div> |
|||
<td class="lgn_pair" style="background-color:#ffffff"> |
|||
<span t-field="line.effective_date"> </span> |
|||
</td> |
|||
<td class="lgn_pair" style="background-color:#ffffff"> |
|||
<span t-field="line.share_number" ></span> |
|||
</td> |
|||
<td class="lgn_pair" style="background-color:#ffffff"> |
|||
<span t-field="line.total_amount_line" |
|||
t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> |
|||
</td> |
|||
</div> |
|||
</tr> |
|||
<t t-set="new_partner" t-value="new_partner+1"/> |
|||
</t> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</t> |
|||
<!--</t>--> |
|||
</template> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
|
|||
|
|||
<table class="list_line_table_head" width="100%"> |
|||
|
|||
<t t-set="total_quantity" t-value="0"/> |
|||
<t t-set="total_amount" t-value="0"/> |
|||
|
|||
<br/> |
|||
<tr> |
|||
<th width="15%" style="text-align: center;">Number</th> |
|||
<th width="25%" style="text-align: center;">Name</th> |
|||
<th width="20%" style="text-align: center;">Email</th> |
|||
<th width="15%" style="text-align: center;">Effective |
|||
date |
|||
</th> |
|||
<th width="10%" style="text-align: center;">Quantity |
|||
</th> |
|||
<th width="15%" style="text-align: center;">Total</th> |
|||
</tr> |
|||
<t t-set="nb_ligne" t-value="0"/> |
|||
|
|||
<t t-foreach="docs" t-as="partner"> |
|||
<t t-set="new_partner" t-value="0"/> |
|||
|
|||
<t t-foreach="partner.share_ids" t-as="line"> |
|||
<t t-set="nb_ligne" t-value="nb_ligne+1"/> |
|||
<tr height="40px"> |
|||
<div t-if="(nb_ligne%2)==1"> |
|||
<div t-if="(new_partner)==0"> |
|||
<td class="lgn_impair" |
|||
style="text-align:left;text-indent:20px;"> |
|||
<span t-field="partner.cooperator_register_number"></span> |
|||
</td> |
|||
<td style="text-align:left"> |
|||
<span t-field="partner.name"></span> |
|||
</td> |
|||
<td style="text-align:left"> |
|||
<span t-field="partner.email"></span> |
|||
</td> |
|||
</div> |
|||
|
|||
<div t-if="(new_partner)!=0"> |
|||
<td class="lgn_impair" |
|||
style="text-align:left;text-indent:20px;" |
|||
colspan="3"> |
|||
</td> |
|||
</div> |
|||
<td> |
|||
<span t-field="line.effective_date"></span> |
|||
</td> |
|||
<td> |
|||
<span t-field="line.share_number"></span> |
|||
</td> |
|||
<td> |
|||
<span t-field="line.total_amount_line" |
|||
t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> |
|||
</td> |
|||
</div> |
|||
<div t-if="(nb_ligne%2)==0"> |
|||
<div t-if="(new_partner)==0"> |
|||
<td class="lgn_pair" |
|||
style="text-align:left;text-indent:20px;background-color:#ffffff"> |
|||
<span t-field="partner.cooperator_register_number"></span> |
|||
</td> |
|||
<td class="lgn_pair" |
|||
style="background-color:#ffffff;text-align:left"> |
|||
<span t-field="partner.name"></span> |
|||
</td> |
|||
<td class="lgn_pair" |
|||
style="background-color:#ffffff;text-align:left"> |
|||
<span t-field="partner.email"></span> |
|||
</td> |
|||
</div> |
|||
<div t-if="(new_partner)!=0" |
|||
style="background-color:#ffffff"> |
|||
<td class="lgn_pair" |
|||
style="text-align:left;text-indent:20px;background-color:#ffffff" |
|||
colspan="3"> |
|||
</td> |
|||
</div> |
|||
<td class="lgn_pair" |
|||
style="background-color:#ffffff"> |
|||
<span t-field="line.effective_date"></span> |
|||
</td> |
|||
<td class="lgn_pair" |
|||
style="background-color:#ffffff"> |
|||
<span t-field="line.share_number"></span> |
|||
</td> |
|||
<td class="lgn_pair" |
|||
style="background-color:#ffffff"> |
|||
<span t-field="line.total_amount_line" |
|||
t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/> |
|||
</td> |
|||
</div> |
|||
</tr> |
|||
<t t-set="new_partner" t-value="new_partner+1"/> |
|||
</t> |
|||
</t> |
|||
</table> |
|||
</div> |
|||
</t> |
|||
<!--</t>--> |
|||
</template> |
|||
</odoo> |
@ -1,106 +1,130 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<template id="cooperator_subscription_G001"> |
|||
<t t-call="web.html_container"> |
|||
<template id="cooperator_subscription_G001"> |
|||
<t t-call="web.html_container"> |
|||
|
|||
<t t-set="data_report_margin_top" t-value="5"/> |
|||
<t t-set="data_report_header_spacing" t-value="0"/> |
|||
<t t-set="data_report_dpi" t-value="110"/> |
|||
|
|||
<!--<t t-call="theme_light.report_layout_002">--> |
|||
<t t-set="data_report_margin_top" t-value="5"/> |
|||
<t t-set="data_report_header_spacing" t-value="0"/> |
|||
<t t-set="data_report_dpi" t-value="110"/> |
|||
|
|||
<div class="page"> |
|||
<head> |
|||
<!--<link href="/theme_light/static/css/invoice_G002.css" rel="stylesheet"/>--> |
|||
</head> |
|||
|
|||
<!--<t t-call="theme_light.list_header_G002"/>--> |
|||
<!--<t t-call="theme_light.report_layout_002">--> |
|||
|
|||
<br/><br/><br/><br/><br/> |
|||
|
|||
<table class="title_table"> |
|||
<tr> |
|||
<td> |
|||
<span class="color_text" t-esc="time.strftime('%Y-%m-%d')"/> |
|||
</td> |
|||
<td> |
|||
<div class="title_doc" style="font-size:16px"> |
|||
<span>SUBSCRIPTION REGISTER</span> |
|||
</div> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<div class="page"> |
|||
<head> |
|||
<!--<link href="/theme_light/static/css/invoice_G002.css" rel="stylesheet"/>--> |
|||
</head> |
|||
|
|||
<br/><br/><br/><br/><br/> |
|||
|
|||
<table class="list_line_table_head" width="100%" > |
|||
<br /> |
|||
<tr> |
|||
<th width="15%" style="text-align: center;" >Operation number</th> |
|||
<th width="30%" style="text-align: left;text-indent:15px" >Cooperator</th> |
|||
<th width="15%" style="text-align: center;" >Subscription date</th> |
|||
<th width="25%" style="text-align: center;" >Operation type</th> |
|||
<th width="15%" style="text-align: center;" >Share number</th> |
|||
</tr> |
|||
<t t-set="nb_ligne" t-value="0"/> |
|||
|
|||
<p t-foreach="docs" t-as="transaction"> |
|||
<t t-set="nb_ligne" t-value="nb_ligne+1"/> |
|||
<tr height="40px"> |
|||
<div t-if="(nb_ligne%2)==1" > |
|||
<td class="lgn_impair" style="text-align:left;text-indent:10px"> |
|||
<span t-field="transaction.register_number_operation" ></span> |
|||
</td> |
|||
<td style="text-align:left;text-indent:15px"> |
|||
<span t-field="transaction.partner_id.name" ></span> |
|||
</td> |
|||
<td style="text-align:center"> |
|||
<span t-field="transaction.date" ></span> |
|||
</td> |
|||
<td style="text-align:center"> |
|||
<span t-field="transaction.type"/> |
|||
</td> |
|||
<td style="text-align:center"> |
|||
<span t-field="transaction.quantity" ></span> |
|||
</td> |
|||
|
|||
</div> |
|||
<div t-if="(nb_ligne%2)==0" > |
|||
<td class="lgn_pair" style="text-align:left;text-indent:10px;background-color:#ffffff"> |
|||
<span t-field="transaction.register_number_operation" ></span> |
|||
</td> |
|||
<td class="lgn_pair" style="text-align:left;text-indent:15px;background-color:#ffffff"> |
|||
<span t-field="transaction.partner_id.name" ></span> |
|||
</td> |
|||
<td style="text-align:center;background-color:#ffffff"> |
|||
<span t-field="transaction.date" ></span> |
|||
</td> |
|||
<td style="text-align:center;background-color:#ffffff"> |
|||
<span t-field="transaction.type"/> |
|||
</td> |
|||
<td style="text-align:center;background-color:#ffffff"> |
|||
<span t-field="transaction.quantity" ></span> |
|||
</td> |
|||
</div> |
|||
</tr> |
|||
</p> |
|||
</table> |
|||
|
|||
<table width="100%" > |
|||
<br /> |
|||
<tr height="40px"> |
|||
<th width="15%"></th> |
|||
<th width="30%"></th> |
|||
<th width="15%"></th> |
|||
<th class="total_table color_text" width="25%"> TOTAL : </th> |
|||
|
|||
<th class="total_table" style="text-align:center" width="15%"> |
|||
<span t-esc="sum(t.quantity for t in docs)"/> |
|||
</th> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
</t> |
|||
<!--</t>--> |
|||
</template> |
|||
<!--<t t-call="theme_light.list_header_G002"/>--> |
|||
|
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
|
|||
<table class="title_table"> |
|||
<tr> |
|||
<td> |
|||
<span class="color_text" |
|||
t-esc="time.strftime('%Y-%m-%d')"/> |
|||
</td> |
|||
<td> |
|||
<div class="title_doc" style="font-size:16px"> |
|||
<span>SUBSCRIPTION REGISTER</span> |
|||
</div> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
|
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
<br/> |
|||
|
|||
<table class="list_line_table_head" width="100%"> |
|||
<br/> |
|||
<tr> |
|||
<th width="15%" style="text-align: center;">Operation |
|||
number |
|||
</th> |
|||
<th width="30%" |
|||
style="text-align: left;text-indent:15px">Cooperator |
|||
</th> |
|||
<th width="15%" style="text-align: center;">Subscription |
|||
date |
|||
</th> |
|||
<th width="25%" style="text-align: center;">Operation |
|||
type |
|||
</th> |
|||
<th width="15%" style="text-align: center;">Share |
|||
number |
|||
</th> |
|||
</tr> |
|||
<t t-set="nb_ligne" t-value="0"/> |
|||
|
|||
<p t-foreach="docs" t-as="transaction"> |
|||
<t t-set="nb_ligne" t-value="nb_ligne+1"/> |
|||
<tr height="40px"> |
|||
<div t-if="(nb_ligne%2)==1"> |
|||
<td class="lgn_impair" |
|||
style="text-align:left;text-indent:10px"> |
|||
<span t-field="transaction.register_number_operation"></span> |
|||
</td> |
|||
<td style="text-align:left;text-indent:15px"> |
|||
<span t-field="transaction.partner_id.name"></span> |
|||
</td> |
|||
<td style="text-align:center"> |
|||
<span t-field="transaction.date"></span> |
|||
</td> |
|||
<td style="text-align:center"> |
|||
<span t-field="transaction.type"/> |
|||
</td> |
|||
<td style="text-align:center"> |
|||
<span t-field="transaction.quantity"></span> |
|||
</td> |
|||
|
|||
</div> |
|||
<div t-if="(nb_ligne%2)==0"> |
|||
<td class="lgn_pair" |
|||
style="text-align:left;text-indent:10px;background-color:#ffffff"> |
|||
<span t-field="transaction.register_number_operation"></span> |
|||
</td> |
|||
<td class="lgn_pair" |
|||
style="text-align:left;text-indent:15px;background-color:#ffffff"> |
|||
<span t-field="transaction.partner_id.name"></span> |
|||
</td> |
|||
<td style="text-align:center;background-color:#ffffff"> |
|||
<span t-field="transaction.date"></span> |
|||
</td> |
|||
<td style="text-align:center;background-color:#ffffff"> |
|||
<span t-field="transaction.type"/> |
|||
</td> |
|||
<td style="text-align:center;background-color:#ffffff"> |
|||
<span t-field="transaction.quantity"></span> |
|||
</td> |
|||
</div> |
|||
</tr> |
|||
</p> |
|||
</table> |
|||
|
|||
<table width="100%"> |
|||
<br/> |
|||
<tr height="40px"> |
|||
<th width="15%"></th> |
|||
<th width="30%"></th> |
|||
<th width="15%"></th> |
|||
<th class="total_table color_text" width="25%">TOTAL : |
|||
</th> |
|||
|
|||
<th class="total_table" style="text-align:center" |
|||
width="15%"> |
|||
<span t-esc="sum(t.quantity for t in docs)"/> |
|||
</th> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
</t> |
|||
<!--</t>--> |
|||
</template> |
|||
</odoo> |
@ -1,49 +1,49 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
|
|||
<data noupdate="1"> |
|||
|
|||
<report |
|||
id="action_cooperator_invoices" |
|||
model="account.invoice" |
|||
string="Capital release request" |
|||
report_type="qweb-pdf" |
|||
name="easy_my_coop.theme_invoice_G002" |
|||
file="easy_my_coop.cooperator_invoice_G002.xml" |
|||
attachment="(object.state in ('open','paid')) and ('SUBJ'+(object.number or '').replace('/','')+'.pdf')" |
|||
<data noupdate="1"> |
|||
|
|||
<report |
|||
id="action_cooperator_invoices" |
|||
model="account.invoice" |
|||
string="Capital release request" |
|||
report_type="qweb-pdf" |
|||
name="easy_my_coop.theme_invoice_G002" |
|||
file="easy_my_coop.cooperator_invoice_G002.xml" |
|||
attachment="(object.state in ('open','paid')) and ('SUBJ'+(object.number or '').replace('/','')+'.pdf')" |
|||
/> |
|||
|
|||
<report |
|||
id="action_cooperator_subscription_report" |
|||
model="subscription.register" |
|||
string="Subscription Register Report" |
|||
report_type="qweb-pdf" |
|||
name="easy_my_coop.cooperator_subscription_G001" |
|||
file="easy_my_coop.cooperator_subscription_G001.xml" |
|||
multi="True" |
|||
menu="True" |
|||
id="action_cooperator_subscription_report" |
|||
model="subscription.register" |
|||
string="Subscription Register Report" |
|||
report_type="qweb-pdf" |
|||
name="easy_my_coop.cooperator_subscription_G001" |
|||
file="easy_my_coop.cooperator_subscription_G001.xml" |
|||
multi="True" |
|||
menu="True" |
|||
/> |
|||
|
|||
<report |
|||
id="action_cooperator_report_certificat" |
|||
model="res.partner" |
|||
string="Cooperator certificat" |
|||
report_type="qweb-pdf" |
|||
name="easy_my_coop.cooperator_certificat_G001" |
|||
file="easy_my_coop.cooperator_certificat_G001.xml" |
|||
multi="True" |
|||
menu="True" |
|||
|
|||
<report |
|||
id="action_cooperator_report_certificat" |
|||
model="res.partner" |
|||
string="Cooperator certificat" |
|||
report_type="qweb-pdf" |
|||
name="easy_my_coop.cooperator_certificat_G001" |
|||
file="easy_my_coop.cooperator_certificat_G001.xml" |
|||
multi="True" |
|||
menu="True" |
|||
/> |
|||
|
|||
|
|||
<report |
|||
id="action_report_cooperator_register" |
|||
model="res.partner" |
|||
string="Cooperator register" |
|||
report_type="qweb-pdf" |
|||
name="easy_my_coop.cooperator_register_G001" |
|||
file="easy_my_coop.cooperator_register_G001.xml" |
|||
multi="True" |
|||
menu="True" |
|||
id="action_report_cooperator_register" |
|||
model="res.partner" |
|||
string="Cooperator register" |
|||
report_type="qweb-pdf" |
|||
name="easy_my_coop.cooperator_register_G001" |
|||
file="easy_my_coop.cooperator_register_G001.xml" |
|||
multi="True" |
|||
menu="True" |
|||
/> |
|||
</data> |
|||
</data> |
|||
</odoo> |
@ -1,16 +1,16 @@ |
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
|||
access_product_product_easy_my_coop_user,access_product_product_easy_my_coop_user,product.model_product_product,group_easy_my_coop_user,1,1,0,0 |
|||
access_product_product_easy_my_coop_manager,access_product_product_easy_my_coop_manager,product.model_product_product,group_easy_my_coop_manager,1,1,1,1 |
|||
access_product_template_easy_my_coop_user,access_product_template_easy_my_coop_user,product.model_product_template,group_easy_my_coop_user,1,1,0,0 |
|||
access_product_template_easy_my_coop_manager,access_product_template_easy_my_coop_manager,product.model_product_template,group_easy_my_coop_manager,1,1,1,1 |
|||
access_subscription_request_user,access_subscription_request_user.subscription,model_subscription_request,base.group_user,1,0,0,0 |
|||
access_subscription_request_easy_my_coop_user,access_subscription_request_easy_my_coop_user,model_subscription_request,group_easy_my_coop_user,1,1,1,0 |
|||
access_subscription_request_easy_my_coop_manager,access_subscription_request_easy_my_coop_manager,model_subscription_request,group_easy_my_coop_manager,1,1,1,1 |
|||
access_share_line_user,access_share_line_user,model_share_line,base.group_user,1,0,0,0 |
|||
access_share_line_easy_my_coop_user,access_share_line_easy_my_coop_user,model_share_line,group_easy_my_coop_user,1,1,1,0 |
|||
access_share_line_easy_my_coop_manager,access_share_line_easy_my_coop_manager,model_share_line,group_easy_my_coop_manager,1,1,1,1 |
|||
access_res_partner_easy_my_coop_user,access_res_partner_easy_my_coop_user,base.model_res_partner,group_easy_my_coop_user,1,1,1,0 |
|||
access_account_invoice_easy_my_coop_user,access_account_invoice_easy_my_coop_user,model_account_invoice,group_easy_my_coop_user,1,1,1,0 |
|||
access_subscription_register_easy_my_coop_user,access_subscription_register_easy_my_coop_user,model_subscription_register,group_easy_my_coop_user,1,1,1,0 |
|||
access_operation_request_easy_my_coop_user,access_operation_request_easy_my_coop_user,model_operation_request,group_easy_my_coop_user,1,1,1,0 |
|||
access_operation_request_easy_my_coop_manager,access_operation_request_easy_my_coop_manager,model_operation_request,group_easy_my_coop_manager,1,1,1,1 |
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
|||
access_product_product_easy_my_coop_user,access_product_product_easy_my_coop_user,product.model_product_product,group_easy_my_coop_user,1,1,0,0 |
|||
access_product_product_easy_my_coop_manager,access_product_product_easy_my_coop_manager,product.model_product_product,group_easy_my_coop_manager,1,1,1,1 |
|||
access_product_template_easy_my_coop_user,access_product_template_easy_my_coop_user,product.model_product_template,group_easy_my_coop_user,1,1,0,0 |
|||
access_product_template_easy_my_coop_manager,access_product_template_easy_my_coop_manager,product.model_product_template,group_easy_my_coop_manager,1,1,1,1 |
|||
access_subscription_request_user,access_subscription_request_user.subscription,model_subscription_request,base.group_user,1,0,0,0 |
|||
access_subscription_request_easy_my_coop_user,access_subscription_request_easy_my_coop_user,model_subscription_request,group_easy_my_coop_user,1,1,1,0 |
|||
access_subscription_request_easy_my_coop_manager,access_subscription_request_easy_my_coop_manager,model_subscription_request,group_easy_my_coop_manager,1,1,1,1 |
|||
access_share_line_user,access_share_line_user,model_share_line,base.group_user,1,0,0,0 |
|||
access_share_line_easy_my_coop_user,access_share_line_easy_my_coop_user,model_share_line,group_easy_my_coop_user,1,1,1,0 |
|||
access_share_line_easy_my_coop_manager,access_share_line_easy_my_coop_manager,model_share_line,group_easy_my_coop_manager,1,1,1,1 |
|||
access_res_partner_easy_my_coop_user,access_res_partner_easy_my_coop_user,base.model_res_partner,group_easy_my_coop_user,1,1,1,0 |
|||
access_account_invoice_easy_my_coop_user,access_account_invoice_easy_my_coop_user,model_account_invoice,group_easy_my_coop_user,1,1,1,0 |
|||
access_subscription_register_easy_my_coop_user,access_subscription_register_easy_my_coop_user,model_subscription_register,group_easy_my_coop_user,1,1,1,0 |
|||
access_operation_request_easy_my_coop_user,access_operation_request_easy_my_coop_user,model_operation_request,group_easy_my_coop_user,1,1,1,0 |
|||
access_operation_request_easy_my_coop_manager,access_operation_request_easy_my_coop_manager,model_operation_request,group_easy_my_coop_manager,1,1,1,1 |
@ -0,0 +1,414 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" /> |
|||
<title>Easy My Coop</title> |
|||
<style type="text/css"> |
|||
|
|||
/* |
|||
:Author: David Goodger (goodger@python.org) |
|||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $ |
|||
:Copyright: This stylesheet has been placed in the public domain. |
|||
|
|||
Default cascading style sheet for the HTML output of Docutils. |
|||
|
|||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to |
|||
customize this style sheet. |
|||
*/ |
|||
|
|||
/* used to remove borders from tables and images */ |
|||
.borderless, table.borderless td, table.borderless th { |
|||
border: 0 } |
|||
|
|||
table.borderless td, table.borderless th { |
|||
/* Override padding for "table.docutils td" with "! important". |
|||
The right padding separates the table cells. */ |
|||
padding: 0 0.5em 0 0 ! important } |
|||
|
|||
.first { |
|||
/* Override more specific margin styles with "! important". */ |
|||
margin-top: 0 ! important } |
|||
|
|||
.last, .with-subtitle { |
|||
margin-bottom: 0 ! important } |
|||
|
|||
.hidden { |
|||
display: none } |
|||
|
|||
.subscript { |
|||
vertical-align: sub; |
|||
font-size: smaller } |
|||
|
|||
.superscript { |
|||
vertical-align: super; |
|||
font-size: smaller } |
|||
|
|||
a.toc-backref { |
|||
text-decoration: none ; |
|||
color: black } |
|||
|
|||
blockquote.epigraph { |
|||
margin: 2em 5em ; } |
|||
|
|||
dl.docutils dd { |
|||
margin-bottom: 0.5em } |
|||
|
|||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { |
|||
overflow: hidden; |
|||
} |
|||
|
|||
/* Uncomment (and remove this text!) to get bold-faced definition list terms |
|||
dl.docutils dt { |
|||
font-weight: bold } |
|||
*/ |
|||
|
|||
div.abstract { |
|||
margin: 2em 5em } |
|||
|
|||
div.abstract p.topic-title { |
|||
font-weight: bold ; |
|||
text-align: center } |
|||
|
|||
div.admonition, div.attention, div.caution, div.danger, div.error, |
|||
div.hint, div.important, div.note, div.tip, div.warning { |
|||
margin: 2em ; |
|||
border: medium outset ; |
|||
padding: 1em } |
|||
|
|||
div.admonition p.admonition-title, div.hint p.admonition-title, |
|||
div.important p.admonition-title, div.note p.admonition-title, |
|||
div.tip p.admonition-title { |
|||
font-weight: bold ; |
|||
font-family: sans-serif } |
|||
|
|||
div.attention p.admonition-title, div.caution p.admonition-title, |
|||
div.danger p.admonition-title, div.error p.admonition-title, |
|||
div.warning p.admonition-title, .code .error { |
|||
color: red ; |
|||
font-weight: bold ; |
|||
font-family: sans-serif } |
|||
|
|||
/* Uncomment (and remove this text!) to get reduced vertical space in |
|||
compound paragraphs. |
|||
div.compound .compound-first, div.compound .compound-middle { |
|||
margin-bottom: 0.5em } |
|||
|
|||
div.compound .compound-last, div.compound .compound-middle { |
|||
margin-top: 0.5em } |
|||
*/ |
|||
|
|||
div.dedication { |
|||
margin: 2em 5em ; |
|||
text-align: center ; |
|||
font-style: italic } |
|||
|
|||
div.dedication p.topic-title { |
|||
font-weight: bold ; |
|||
font-style: normal } |
|||
|
|||
div.figure { |
|||
margin-left: 2em ; |
|||
margin-right: 2em } |
|||
|
|||
div.footer, div.header { |
|||
clear: both; |
|||
font-size: smaller } |
|||
|
|||
div.line-block { |
|||
display: block ; |
|||
margin-top: 1em ; |
|||
margin-bottom: 1em } |
|||
|
|||
div.line-block div.line-block { |
|||
margin-top: 0 ; |
|||
margin-bottom: 0 ; |
|||
margin-left: 1.5em } |
|||
|
|||
div.sidebar { |
|||
margin: 0 0 0.5em 1em ; |
|||
border: medium outset ; |
|||
padding: 1em ; |
|||
background-color: #ffffee ; |
|||
width: 40% ; |
|||
float: right ; |
|||
clear: right } |
|||
|
|||
div.sidebar p.rubric { |
|||
font-family: sans-serif ; |
|||
font-size: medium } |
|||
|
|||
div.system-messages { |
|||
margin: 5em } |
|||
|
|||
div.system-messages h1 { |
|||
color: red } |
|||
|
|||
div.system-message { |
|||
border: medium outset ; |
|||
padding: 1em } |
|||
|
|||
div.system-message p.system-message-title { |
|||
color: red ; |
|||
font-weight: bold } |
|||
|
|||
div.topic { |
|||
margin: 2em } |
|||
|
|||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, |
|||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { |
|||
margin-top: 0.4em } |
|||
|
|||
h1.title { |
|||
text-align: center } |
|||
|
|||
h2.subtitle { |
|||
text-align: center } |
|||
|
|||
hr.docutils { |
|||
width: 75% } |
|||
|
|||
img.align-left, .figure.align-left, object.align-left, table.align-left { |
|||
clear: left ; |
|||
float: left ; |
|||
margin-right: 1em } |
|||
|
|||
img.align-right, .figure.align-right, object.align-right, table.align-right { |
|||
clear: right ; |
|||
float: right ; |
|||
margin-left: 1em } |
|||
|
|||
img.align-center, .figure.align-center, object.align-center { |
|||
display: block; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
table.align-center { |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
.align-left { |
|||
text-align: left } |
|||
|
|||
.align-center { |
|||
clear: both ; |
|||
text-align: center } |
|||
|
|||
.align-right { |
|||
text-align: right } |
|||
|
|||
/* reset inner alignment in figures */ |
|||
div.align-right { |
|||
text-align: inherit } |
|||
|
|||
/* div.align-center * { */ |
|||
/* text-align: left } */ |
|||
|
|||
.align-top { |
|||
vertical-align: top } |
|||
|
|||
.align-middle { |
|||
vertical-align: middle } |
|||
|
|||
.align-bottom { |
|||
vertical-align: bottom } |
|||
|
|||
ol.simple, ul.simple { |
|||
margin-bottom: 1em } |
|||
|
|||
ol.arabic { |
|||
list-style: decimal } |
|||
|
|||
ol.loweralpha { |
|||
list-style: lower-alpha } |
|||
|
|||
ol.upperalpha { |
|||
list-style: upper-alpha } |
|||
|
|||
ol.lowerroman { |
|||
list-style: lower-roman } |
|||
|
|||
ol.upperroman { |
|||
list-style: upper-roman } |
|||
|
|||
p.attribution { |
|||
text-align: right ; |
|||
margin-left: 50% } |
|||
|
|||
p.caption { |
|||
font-style: italic } |
|||
|
|||
p.credits { |
|||
font-style: italic ; |
|||
font-size: smaller } |
|||
|
|||
p.label { |
|||
white-space: nowrap } |
|||
|
|||
p.rubric { |
|||
font-weight: bold ; |
|||
font-size: larger ; |
|||
color: maroon ; |
|||
text-align: center } |
|||
|
|||
p.sidebar-title { |
|||
font-family: sans-serif ; |
|||
font-weight: bold ; |
|||
font-size: larger } |
|||
|
|||
p.sidebar-subtitle { |
|||
font-family: sans-serif ; |
|||
font-weight: bold } |
|||
|
|||
p.topic-title { |
|||
font-weight: bold } |
|||
|
|||
pre.address { |
|||
margin-bottom: 0 ; |
|||
margin-top: 0 ; |
|||
font: inherit } |
|||
|
|||
pre.literal-block, pre.doctest-block, pre.math, pre.code { |
|||
margin-left: 2em ; |
|||
margin-right: 2em } |
|||
|
|||
pre.code .ln { color: grey; } /* line numbers */ |
|||
pre.code, code { background-color: #eeeeee } |
|||
pre.code .comment, code .comment { color: #5C6576 } |
|||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } |
|||
pre.code .literal.string, code .literal.string { color: #0C5404 } |
|||
pre.code .name.builtin, code .name.builtin { color: #352B84 } |
|||
pre.code .deleted, code .deleted { background-color: #DEB0A1} |
|||
pre.code .inserted, code .inserted { background-color: #A3D289} |
|||
|
|||
span.classifier { |
|||
font-family: sans-serif ; |
|||
font-style: oblique } |
|||
|
|||
span.classifier-delimiter { |
|||
font-family: sans-serif ; |
|||
font-weight: bold } |
|||
|
|||
span.interpreted { |
|||
font-family: sans-serif } |
|||
|
|||
span.option { |
|||
white-space: nowrap } |
|||
|
|||
span.pre { |
|||
white-space: pre } |
|||
|
|||
span.problematic { |
|||
color: red } |
|||
|
|||
span.section-subtitle { |
|||
/* font-size relative to parent (h1..h6 element) */ |
|||
font-size: 80% } |
|||
|
|||
table.citation { |
|||
border-left: solid 1px gray; |
|||
margin-left: 1px } |
|||
|
|||
table.docinfo { |
|||
margin: 2em 4em } |
|||
|
|||
table.docutils { |
|||
margin-top: 0.5em ; |
|||
margin-bottom: 0.5em } |
|||
|
|||
table.footnote { |
|||
border-left: solid 1px black; |
|||
margin-left: 1px } |
|||
|
|||
table.docutils td, table.docutils th, |
|||
table.docinfo td, table.docinfo th { |
|||
padding-left: 0.5em ; |
|||
padding-right: 0.5em ; |
|||
vertical-align: top } |
|||
|
|||
table.docutils th.field-name, table.docinfo th.docinfo-name { |
|||
font-weight: bold ; |
|||
text-align: left ; |
|||
white-space: nowrap ; |
|||
padding-left: 0 } |
|||
|
|||
/* "booktabs" style (no vertical lines) */ |
|||
table.docutils.booktabs { |
|||
border: 0px; |
|||
border-top: 2px solid; |
|||
border-bottom: 2px solid; |
|||
border-collapse: collapse; |
|||
} |
|||
table.docutils.booktabs * { |
|||
border: 0px; |
|||
} |
|||
table.docutils.booktabs th { |
|||
border-bottom: thin solid; |
|||
text-align: left; |
|||
} |
|||
|
|||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, |
|||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { |
|||
font-size: 100% } |
|||
|
|||
ul.auto-toc { |
|||
list-style-type: none } |
|||
|
|||
</style> |
|||
</head> |
|||
<body> |
|||
<div class="document" id="easy-my-coop"> |
|||
<h1 class="title">Easy My Coop</h1> |
|||
|
|||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
!! This file is generated by oca-gen-addon-readme !! |
|||
!! changes will be overwritten. !! |
|||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> |
|||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop"><img alt="coopiteasy/vertical-cooperative" src="https://img.shields.io/badge/github-coopiteasy%2Fvertical--cooperative-lightgray.png?logo=github" /></a></p> |
|||
<p>This module allows to manage the cooperator subscription and all the cooperative business processes.</p> |
|||
<p><strong>Table of contents</strong></p> |
|||
<div class="contents local topic" id="contents"> |
|||
<ul class="simple"> |
|||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li> |
|||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul> |
|||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li> |
|||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li> |
|||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li> |
|||
</ul> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="bug-tracker"> |
|||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1> |
|||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/issues">GitHub Issues</a>. |
|||
In case of trouble, please check there if your issue has already been reported. |
|||
If you spotted it first, help us smashing it by providing a detailed and welcomed |
|||
<a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/issues/new?body=module:%20easy_my_coop%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> |
|||
<p>Do not contact contributors directly about support or help with technical issues.</p> |
|||
</div> |
|||
<div class="section" id="credits"> |
|||
<h1><a class="toc-backref" href="#id2">Credits</a></h1> |
|||
<div class="section" id="authors"> |
|||
<h2><a class="toc-backref" href="#id3">Authors</a></h2> |
|||
<ul class="simple"> |
|||
<li>Coop IT Easy SCRLfs</li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="contributors"> |
|||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2> |
|||
<ul class="simple"> |
|||
<li>Coop IT Easy SCRLfs</li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="maintainers"> |
|||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2> |
|||
<p>This module is part of the <a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop">coopiteasy/vertical-cooperative</a> project on GitHub.</p> |
|||
<p>You are welcome to contribute.</p> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</body> |
|||
</html> |
@ -1,27 +1,27 @@ |
|||
.border-top-easymy-coop td { |
|||
border-top: 1pt solid #e7511e !important; |
|||
} |
|||
|
|||
.border-easymy-coop th { |
|||
border-bottom: 1pt solid #e7511e !important; |
|||
} |
|||
|
|||
.border-top-easymy-coop-cert td { |
|||
border-top: 1pt solid #fcc300 !important; |
|||
} |
|||
|
|||
.border-easymy-coop-cert th { |
|||
border-bottom: 1pt solid #fcc300 !important; |
|||
} |
|||
|
|||
.easymy-coop-normal { |
|||
font-family:Roboto-Regular; |
|||
font-size:12pt; |
|||
line-height:16pt; |
|||
} |
|||
|
|||
.easymy-coop-info-title { |
|||
font-family:Roboto-Bold; |
|||
font-size:12pt; |
|||
line-height:16pt; |
|||
} |
|||
.border-top-easymy-coop td { |
|||
border-top: 1pt solid #e7511e !important; |
|||
} |
|||
|
|||
.border-easymy-coop th { |
|||
border-bottom: 1pt solid #e7511e !important; |
|||
} |
|||
|
|||
.border-top-easymy-coop-cert td { |
|||
border-top: 1pt solid #fcc300 !important; |
|||
} |
|||
|
|||
.border-easymy-coop-cert th { |
|||
border-bottom: 1pt solid #fcc300 !important; |
|||
} |
|||
|
|||
.easymy-coop-normal { |
|||
font-family:Roboto-Regular; |
|||
font-size:12pt; |
|||
line-height:16pt; |
|||
} |
|||
|
|||
.easymy-coop-info-title { |
|||
font-family:Roboto-Bold; |
|||
font-size:12pt; |
|||
line-height:16pt; |
|||
} |
@ -1,52 +1,52 @@ |
|||
odoo.define('easy_my_coop.oe_easymy_coop', function (require) { |
|||
$(document).ready(function () { |
|||
"use strict"; |
|||
var ajax = require('web.ajax'); |
|||
|
|||
$('.oe_easymy_coop').each(function () { |
|||
var oe_easymy_coop = this; |
|||
|
|||
$('#share_product_id').change(function () { |
|||
var share_product_id = $("#share_product_id").val(); |
|||
ajax.jsonRpc("/subscription/get_share_product", 'call', { |
|||
'share_product_id': share_product_id |
|||
}) |
|||
.then(function (data) { |
|||
$('#share_price').text(data[share_product_id].list_price); |
|||
$('input.js_quantity').val(data[share_product_id].min_qty); |
|||
if(data[share_product_id].force_min_qty == true){ |
|||
$('input.js_quantity').data("min",data[share_product_id].min_qty); |
|||
} |
|||
$('input.js_quantity').change(); |
|||
var $share_price = $('#share_price').text() |
|||
$('input[name="total_parts"]').val($('input.js_quantity').val()*$share_price); |
|||
$('input[name="total_parts"]').change(); |
|||
}); |
|||
}); |
|||
|
|||
$(oe_easymy_coop).on('click', 'a.js_add_cart_json', function (ev) { |
|||
var $share_price = $('#share_price').text() |
|||
var $link = $(ev.currentTarget); |
|||
var $input = $link.parent().parent().find("input"); |
|||
var $input_total = $("div").find(".total"); |
|||
var min = parseFloat($input.data("min") || 1); |
|||
var amount_max = parseFloat($('input[name="total_parts"]').data("max")); |
|||
var quantity = ($link.has(".fa-minus").length ? -1 : 1) + parseFloat($input.val(),10); |
|||
var total_part = quantity * $share_price; |
|||
var quantity_max = amount_max / $share_price; |
|||
$input.val(quantity > min ? (total_part <= amount_max ? quantity : quantity_max) : min); |
|||
$input.change(); |
|||
$('input[name="total_parts"]').val($input.val()*$share_price); |
|||
return false; |
|||
}); |
|||
|
|||
$(oe_easymy_coop).on('focusout', 'input.js_quantity', function (ev) { |
|||
$('a.js_add_cart_json').trigger('click'); |
|||
}); |
|||
|
|||
$('#share_product_id').trigger('change'); |
|||
|
|||
$("[name='birthdate']").inputmask(); |
|||
}); |
|||
$(document).ready(function () { |
|||
"use strict"; |
|||
var ajax = require('web.ajax'); |
|||
|
|||
$('.oe_easymy_coop').each(function () { |
|||
var oe_easymy_coop = this; |
|||
|
|||
$('#share_product_id').change(function () { |
|||
var share_product_id = $("#share_product_id").val(); |
|||
ajax.jsonRpc("/subscription/get_share_product", 'call', { |
|||
'share_product_id': share_product_id, |
|||
}) |
|||
.then(function (data) { |
|||
$('#share_price').text(data[share_product_id].list_price); |
|||
$('input.js_quantity').val(data[share_product_id].min_qty); |
|||
if (data[share_product_id].force_min_qty == true) { |
|||
$('input.js_quantity').data("min", data[share_product_id].min_qty); |
|||
} |
|||
$('input.js_quantity').change(); |
|||
var $share_price = $('#share_price').text(); |
|||
$('input[name="total_parts"]').val($('input.js_quantity').val() * $share_price); |
|||
$('input[name="total_parts"]').change(); |
|||
}); |
|||
}); |
|||
|
|||
$(oe_easymy_coop).on('click', 'a.js_add_cart_json', function (ev) { |
|||
var $share_price = $('#share_price').text(); |
|||
var $link = $(ev.currentTarget); |
|||
var $input = $link.parent().parent().find("input"); |
|||
var $input_total = $("div").find(".total"); |
|||
var min = parseFloat($input.data("min") || 1); |
|||
var amount_max = parseFloat($('input[name="total_parts"]').data("max")); |
|||
var quantity = ($link.has(".fa-minus").length ? -1 : 1) + parseFloat($input.val(), 10); |
|||
var total_part = quantity * $share_price; |
|||
var quantity_max = amount_max / $share_price; |
|||
$input.val(quantity > min ? total_part <= amount_max ? quantity : quantity_max : min); |
|||
$input.change(); |
|||
$('input[name="total_parts"]').val($input.val() * $share_price); |
|||
return false; |
|||
}); |
|||
|
|||
$(oe_easymy_coop).on('focusout', 'input.js_quantity', function (ev) { |
|||
$('a.js_add_cart_json').trigger('click'); |
|||
}); |
|||
|
|||
$('#share_product_id').trigger('change'); |
|||
|
|||
$("[name='birthdate']").inputmask(); |
|||
}); |
|||
}); |
|||
}); |
|||
}); |
3125
easy_my_coop/static/src/js/jquery.inputmask.bundle.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,73 +1,93 @@ |
|||
<odoo> |
|||
<record id="invoice_form" model="ir.ui.view"> |
|||
<field name="name">account.invoice.form</field> |
|||
<field name="model">account.invoice</field> |
|||
<field name="inherit_id" ref="account.invoice_form" /> |
|||
<field name="arch" type="xml"> |
|||
<field name="move_id" position="after"> |
|||
<field name="subscription_request" /> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_invoice_tree_coop" model="ir.actions.act_window"> |
|||
<field name="name">Cooperator Invoices</field> |
|||
<field name="res_model">account.invoice</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field> |
|||
<field eval="False" name="view_id"/> |
|||
<field name="domain">[('type','in',('out_invoice', 'out_refund')),('release_capital_request','=',True)]</field> |
|||
<field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field> |
|||
<field name="search_view_id" ref="account.view_account_invoice_filter"/> |
|||
<field name="help" type="html"> |
|||
<p class="o_view_nocontent_smiling_face"> |
|||
Create a customer invoice |
|||
</p><p> |
|||
Create invoices, register payments and keep track of the discussions with your customers. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_invoice_tree1_view1" model="ir.actions.act_window.view"> |
|||
<field eval="1" name="sequence"/> |
|||
<field name="view_mode">tree</field> |
|||
<field name="view_id" ref="account.invoice_tree"/> |
|||
<field name="act_window_id" ref="action_invoice_tree_coop"/> |
|||
</record> |
|||
|
|||
<record id="action_invoice_tree1_view2" model="ir.actions.act_window.view"> |
|||
<field eval="2" name="sequence"/> |
|||
<field name="view_mode">form</field> |
|||
<field name="view_id" ref="account.invoice_form"/> |
|||
<field name="act_window_id" ref="action_invoice_tree_coop"/> |
|||
</record> |
|||
|
|||
<record id="account.action_invoice_tree1" model="ir.actions.act_window"> |
|||
<field name="name">Customer Invoices</field> |
|||
<field name="res_model">account.invoice</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field> |
|||
<field eval="False" name="view_id"/> |
|||
<field name="domain">[('type','in',('out_invoice', 'out_refund')),('release_capital_request','=',False)]</field> |
|||
<field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field> |
|||
<field name="search_view_id" ref="account.view_account_invoice_filter"/> |
|||
<field name="help" type="html"> |
|||
<p class="o_view_nocontent_smiling_face"> |
|||
Create a customer invoice |
|||
</p><p> |
|||
Create invoices, register payments and keep track of the discussions with your customers. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="account.action_invoice_refund_out_tree" model="ir.actions.act_window"> |
|||
<field name="name">Invoices</field> |
|||
<field name="res_model">account.invoice</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,form,kanban,calendar,graph,pivot</field> |
|||
<field name="view_id" ref="account.invoice_tree"/> |
|||
<field name="domain">[('type','in', ['out_invoice', 'out_refund']), ('state', 'not in', ['draft', 'cancel']),('release_capital_request','=',False)]</field> |
|||
<field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field> |
|||
<field name="search_view_id" ref="account.view_account_invoice_filter"/> |
|||
</record> |
|||
</odoo> |
|||
<odoo> |
|||
<record id="invoice_form" model="ir.ui.view"> |
|||
<field name="name">account.invoice.form</field> |
|||
<field name="model">account.invoice</field> |
|||
<field name="inherit_id" ref="account.invoice_form"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="move_id" position="after"> |
|||
<field name="subscription_request"/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_invoice_tree_coop" model="ir.actions.act_window"> |
|||
<field name="name">Cooperator Invoices</field> |
|||
<field name="res_model">account.invoice</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity |
|||
</field> |
|||
<field eval="False" name="view_id"/> |
|||
<field name="domain">[('type','in',('out_invoice', |
|||
'out_refund')),('release_capital_request','=',True)] |
|||
</field> |
|||
<field name="context">{'default_type':'out_invoice', |
|||
'type':'out_invoice', 'journal_type': 'sale'} |
|||
</field> |
|||
<field name="search_view_id" ref="account.view_account_invoice_filter"/> |
|||
<field name="help" type="html"> |
|||
<p class="o_view_nocontent_smiling_face"> |
|||
Create a customer invoice |
|||
</p> |
|||
<p> |
|||
Create invoices, register payments and keep track of the |
|||
discussions with your customers. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_invoice_tree1_view1" model="ir.actions.act_window.view"> |
|||
<field eval="1" name="sequence"/> |
|||
<field name="view_mode">tree</field> |
|||
<field name="view_id" ref="account.invoice_tree"/> |
|||
<field name="act_window_id" ref="action_invoice_tree_coop"/> |
|||
</record> |
|||
|
|||
<record id="action_invoice_tree1_view2" model="ir.actions.act_window.view"> |
|||
<field eval="2" name="sequence"/> |
|||
<field name="view_mode">form</field> |
|||
<field name="view_id" ref="account.invoice_form"/> |
|||
<field name="act_window_id" ref="action_invoice_tree_coop"/> |
|||
</record> |
|||
|
|||
<record id="account.action_invoice_tree1" model="ir.actions.act_window"> |
|||
<field name="name">Customer Invoices</field> |
|||
<field name="res_model">account.invoice</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity |
|||
</field> |
|||
<field eval="False" name="view_id"/> |
|||
<field name="domain">[('type','in',('out_invoice', |
|||
'out_refund')),('release_capital_request','=',False)] |
|||
</field> |
|||
<field name="context">{'default_type':'out_invoice', |
|||
'type':'out_invoice', 'journal_type': 'sale'} |
|||
</field> |
|||
<field name="search_view_id" ref="account.view_account_invoice_filter"/> |
|||
<field name="help" type="html"> |
|||
<p class="o_view_nocontent_smiling_face"> |
|||
Create a customer invoice |
|||
</p> |
|||
<p> |
|||
Create invoices, register payments and keep track of the |
|||
discussions with your customers. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="account.action_invoice_refund_out_tree" |
|||
model="ir.actions.act_window"> |
|||
<field name="name">Invoices</field> |
|||
<field name="res_model">account.invoice</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,form,kanban,calendar,graph,pivot</field> |
|||
<field name="view_id" ref="account.invoice_tree"/> |
|||
<field name="domain">[('type','in', ['out_invoice', 'out_refund']), |
|||
('state', 'not in', ['draft', |
|||
'cancel']),('release_capital_request','=',False)] |
|||
</field> |
|||
<field name="context">{'default_type':'out_invoice', |
|||
'type':'out_invoice', 'journal_type': 'sale'} |
|||
</field> |
|||
<field name="search_view_id" ref="account.view_account_invoice_filter"/> |
|||
</record> |
|||
</odoo> |
@ -1,26 +1,28 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<record id="view_account_journal_form_coop" model="ir.ui.view"> |
|||
<field name="name">account.journal.form</field> |
|||
<field name="model">account.journal</field> |
|||
<field name="inherit_id" ref="account.view_account_journal_form"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="bank_id" position="after"> |
|||
<field name="get_cooperator_payment" groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
<field name="get_general_payment"/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_account_bank_journal_form_coop" model="ir.ui.view"> |
|||
<field name="name">account.bank.journal.form</field> |
|||
<field name="model">account.journal</field> |
|||
<field name="inherit_id" ref="account.view_account_bank_journal_form"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="currency_id" position="after"> |
|||
<field name="get_cooperator_payment" groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
<field name="get_general_payment"/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
</odoo> |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<record id="view_account_journal_form_coop" model="ir.ui.view"> |
|||
<field name="name">account.journal.form</field> |
|||
<field name="model">account.journal</field> |
|||
<field name="inherit_id" ref="account.view_account_journal_form"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="bank_id" position="after"> |
|||
<field name="get_cooperator_payment" |
|||
groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
<field name="get_general_payment"/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_account_bank_journal_form_coop" model="ir.ui.view"> |
|||
<field name="name">account.bank.journal.form</field> |
|||
<field name="model">account.journal</field> |
|||
<field name="inherit_id" ref="account.view_account_bank_journal_form"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="currency_id" position="after"> |
|||
<field name="get_cooperator_payment" |
|||
groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
<field name="get_general_payment"/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -1,77 +1,84 @@ |
|||
<odoo> |
|||
<record id="subscription_register_tree" model="ir.ui.view"> |
|||
<field name="name">subscription.register.tree</field> |
|||
<field name="model">subscription.register</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Subscription Register"> |
|||
<field name="register_number_operation"/> |
|||
<field name="date"/> |
|||
<field name="partner_id"/> |
|||
<field name="share_short_name"/> |
|||
<field name="quantity" sum="Total quantity"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="total_amount_line" sum="Total amount"/> |
|||
<field name="type"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="subscription_register_form" model="ir.ui.view"> |
|||
<field name="name">subscription.register.form</field> |
|||
<field name="model">subscription.register</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Subscription Register"> |
|||
<group> |
|||
<group> |
|||
<field name="register_number_operation"/> |
|||
<field name="date"/> |
|||
<field name="partner_id"/> |
|||
<field name="share_short_name"/> |
|||
<field name="quantity"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="total_amount_line"/> |
|||
</group> |
|||
<group> |
|||
<field name="partner_id_to" attrs="{'invisible':[('type','!=','transfer')]}"/> |
|||
<field name="type"/> |
|||
<field name="share_to_short_name"/> |
|||
<field name="quantity_to"/> |
|||
<field name="share_to_unit_price"/> |
|||
<field name="user_id" invisible="True"/> |
|||
</group> |
|||
</group> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_subscription_register_filter" model="ir.ui.view"> |
|||
<field name="name">Subscription Register Search</field> |
|||
<field name="model">subscription.register</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search Subscription Register"> |
|||
<field name="partner_id" |
|||
filter_domain="[('partner_id','ilike',self)]"/> |
|||
<field name="register_number_operation"/> |
|||
<separator/> |
|||
<filter string="Subscription" name="type_subscription" domain="[('type','=','subscription')]"/> |
|||
<filter string="Transfer" name="type_transfer" domain="[('type','=','transfer')]"/> |
|||
<filter string="Sell back" name="type_sell_back" domain="[('type','=','sell_back')]"/> |
|||
<filter string="Convert" name="type_convert" domain="[('type','=','convert')]"/> |
|||
<separator/> |
|||
<group expand="0" name="group_by" string="Group By"> |
|||
<filter name="entry_type" string="Entry type" context="{'group_by' : 'type'}" /> |
|||
<filter name="subscription_date" string="Subscription Date" context="{'group_by': 'date'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="subscription_register_action" model="ir.actions.act_window"> |
|||
<field name="name">Subscription Register</field> |
|||
<field name="res_model">subscription.register</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" ref="subscription_register_tree"/> |
|||
<field name="search_view_id" ref="view_subscription_register_filter"/> |
|||
</record> |
|||
|
|||
</odoo> |
|||
<odoo> |
|||
<record id="subscription_register_tree" model="ir.ui.view"> |
|||
<field name="name">subscription.register.tree</field> |
|||
<field name="model">subscription.register</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Subscription Register"> |
|||
<field name="register_number_operation"/> |
|||
<field name="date"/> |
|||
<field name="partner_id"/> |
|||
<field name="share_short_name"/> |
|||
<field name="quantity" sum="Total quantity"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="total_amount_line" sum="Total amount"/> |
|||
<field name="type"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="subscription_register_form" model="ir.ui.view"> |
|||
<field name="name">subscription.register.form</field> |
|||
<field name="model">subscription.register</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Subscription Register"> |
|||
<group> |
|||
<group> |
|||
<field name="register_number_operation"/> |
|||
<field name="date"/> |
|||
<field name="partner_id"/> |
|||
<field name="share_short_name"/> |
|||
<field name="quantity"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="total_amount_line"/> |
|||
</group> |
|||
<group> |
|||
<field name="partner_id_to" |
|||
attrs="{'invisible':[('type','!=','transfer')]}"/> |
|||
<field name="type"/> |
|||
<field name="share_to_short_name"/> |
|||
<field name="quantity_to"/> |
|||
<field name="share_to_unit_price"/> |
|||
<field name="user_id" invisible="True"/> |
|||
</group> |
|||
</group> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_subscription_register_filter" model="ir.ui.view"> |
|||
<field name="name">Subscription Register Search</field> |
|||
<field name="model">subscription.register</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search Subscription Register"> |
|||
<field name="partner_id" |
|||
filter_domain="[('partner_id','ilike',self)]"/> |
|||
<field name="register_number_operation"/> |
|||
<separator/> |
|||
<filter string="Subscription" name="type_subscription" |
|||
domain="[('type','=','subscription')]"/> |
|||
<filter string="Transfer" name="type_transfer" |
|||
domain="[('type','=','transfer')]"/> |
|||
<filter string="Sell back" name="type_sell_back" |
|||
domain="[('type','=','sell_back')]"/> |
|||
<filter string="Convert" name="type_convert" |
|||
domain="[('type','=','convert')]"/> |
|||
<separator/> |
|||
<group expand="0" name="group_by" string="Group By"> |
|||
<filter name="entry_type" string="Entry type" |
|||
context="{'group_by' : 'type'}"/> |
|||
<filter name="subscription_date" string="Subscription Date" |
|||
context="{'group_by': 'date'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="subscription_register_action" model="ir.actions.act_window"> |
|||
<field name="name">Subscription Register</field> |
|||
<field name="res_model">subscription.register</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" ref="subscription_register_tree"/> |
|||
<field name="search_view_id" ref="view_subscription_register_filter"/> |
|||
</record> |
|||
|
|||
</odoo> |
@ -1,15 +1,15 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
|
|||
<record model="ir.actions.act_window" |
|||
id="action_easy_my_coop_email_templates"> |
|||
<field name="name">Mail Templates</field> |
|||
<field name="res_model">mail.template</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">form,tree</field> |
|||
<field name="domain">[('easy_my_coop','=',True)]</field> |
|||
<field name="view_id" ref="mail.email_template_tree" /> |
|||
<field name="search_view_id" ref="mail.view_email_template_search" /> |
|||
</record> |
|||
|
|||
</odoo> |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
|
|||
<record model="ir.actions.act_window" |
|||
id="action_easy_my_coop_email_templates"> |
|||
<field name="name">Mail Templates</field> |
|||
<field name="res_model">mail.template</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">form,tree</field> |
|||
<field name="domain">[('easy_my_coop','=',True)]</field> |
|||
<field name="view_id" ref="mail.email_template_tree"/> |
|||
<field name="search_view_id" ref="mail.view_email_template_search"/> |
|||
</record> |
|||
|
|||
</odoo> |
@ -1,105 +1,133 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<record id="operation_request_tree" model="ir.ui.view"> |
|||
<field name="name">operation.request.tree</field> |
|||
<field name="model">operation.request</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Operation requests" colors="green:state in ('approved'); blue:state in ('draft');grey: state in ('done')"> |
|||
<field name="request_date"/> |
|||
<field name="partner_id"/> |
|||
<field name="operation_type"/> |
|||
<field name="quantity"/> |
|||
<field name="user_id"/> |
|||
<field name="state"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="operation_request_form" model="ir.ui.view"> |
|||
<field name="name">operation.request.form</field> |
|||
<field name="model">operation.request</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Operation request"> |
|||
<header> |
|||
<button string="Submit" type="object" name="submit_operation" states="draft"/> |
|||
<button string="Approve" type="object" name="approve_operation" states="waiting"/> |
|||
<button string="Refuse" type="object" name="refuse_operation" states="waiting"/> |
|||
<button string="Cancel" type="object" name="cancel_operation" states="draft,waiting,approved"/> |
|||
<button string="Draft" type="object" name="reset_to_draft" states="waiting,cancelled"/> |
|||
<button string="Execute" type="object" name="execute_operation" states="approved"/> |
|||
<field name="state" widget="statusbar" statusbar_visible="draft,done,cancelled,refused" statusbar_colors='{"draft":"grey","done":"green","cancelled":"orange","refused":"red"}'/> |
|||
</header> |
|||
<sheet> |
|||
<group> |
|||
<group> |
|||
<field name="request_date" attrs="{'readonly':[('state','!=','draft')]}"/> |
|||
<field name="operation_type" attrs="{'readonly':[('state','!=','draft')]}"/> |
|||
<field name="receiver_not_member" attrs="{'invisible':[('operation_type','!=','transfer')]}"/> |
|||
<field name="partner_id" options="{'no_create':True}" attrs="{'readonly':[('state','!=','draft')]}"/> |
|||
<field name="partner_id_to" options="{'no_create':True}" attrs="{'invisible':['|',('operation_type','!=','transfer'), ('receiver_not_member','=',True)]}"/> |
|||
</group> |
|||
<group> |
|||
<field name="user_id"/> |
|||
<field name="share_product_id" attrs="{'readonly':[('state','!=','draft')]}" widget="selection"/> |
|||
<field name="share_short_name" readonly="True"/> |
|||
<field name="share_to_product_id" attrs="{'invisible':[('operation_type','!=','convert')],'required':[('operation_type','=','convert')],'readonly':[('state','!=','draft')]}" widget="selection"/> |
|||
<field name="share_to_short_name" readonly="True"/> |
|||
<field name="quantity" attrs="{'readonly':[('state','!=','draft')]}"/> |
|||
<field name="share_unit_price" readonly="True"/> |
|||
<field name="subscription_amount" readonly="True" /> |
|||
</group> |
|||
</group> |
|||
<group> |
|||
<field name="subscription_request" attrs="{'invisible':['|',('operation_type','!=','transfer'),('receiver_not_member','=',False)]}" context="{'default_is_operation': True, 'default_ordered_parts':quantity,'default_share_product_id': share_product_id, 'default_source':'operation'}"> |
|||
<tree> |
|||
<field name="name"/> |
|||
<field name="birthdate"/> |
|||
<field name="phone"/> |
|||
<field name="email"/> |
|||
<field name="iban"/> |
|||
<field name="state" invisible="True"/> |
|||
</tree> |
|||
<form string="Subscription Requests"> |
|||
<sheet> |
|||
<group> |
|||
<group> |
|||
<field name="name"/> |
|||
<field name="firstname"/> |
|||
<field name="lastname"/> |
|||
<field name="birthdate"/> |
|||
<field name="gender"/> |
|||
<field name="email"/> |
|||
<field name="phone"/> |
|||
<field name="iban"/> |
|||
</group> |
|||
<group> |
|||
<field name="address"/> |
|||
<field name="zip_code"/> |
|||
<field name="city"/> |
|||
<field name="country_id"/> |
|||
<field name="lang"/> |
|||
<field name="validated"/> |
|||
<field name="skip_control_ng"/> |
|||
<field name="ordered_parts" invisible="True"/> |
|||
<field name="source" invisible="True"/> |
|||
<field name="state" invisible="True"/> |
|||
<field name="share_product_id" invisible="True"/> |
|||
</group> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="operation_request_action" model="ir.actions.act_window"> |
|||
<field name="name">Operation request</field> |
|||
<field name="res_model">operation.request</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" ref="operation_request_tree"/> |
|||
</record> |
|||
|
|||
</odoo> |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<record id="operation_request_tree" model="ir.ui.view"> |
|||
<field name="name">operation.request.tree</field> |
|||
<field name="model">operation.request</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Operation requests" |
|||
colors="green:state in ('approved'); blue:state in ('draft');grey: state in ('done')"> |
|||
<field name="request_date"/> |
|||
<field name="partner_id"/> |
|||
<field name="operation_type"/> |
|||
<field name="quantity"/> |
|||
<field name="user_id"/> |
|||
<field name="state"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="operation_request_form" model="ir.ui.view"> |
|||
<field name="name">operation.request.form</field> |
|||
<field name="model">operation.request</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Operation request"> |
|||
<header> |
|||
<button string="Submit" type="object" |
|||
name="submit_operation" states="draft"/> |
|||
<button string="Approve" type="object" |
|||
name="approve_operation" states="waiting"/> |
|||
<button string="Refuse" type="object" |
|||
name="refuse_operation" states="waiting"/> |
|||
<button string="Cancel" type="object" |
|||
name="cancel_operation" |
|||
states="draft,waiting,approved"/> |
|||
<button string="Draft" type="object" name="reset_to_draft" |
|||
states="waiting,cancelled"/> |
|||
<button string="Execute" type="object" |
|||
name="execute_operation" states="approved"/> |
|||
<field name="state" widget="statusbar" |
|||
statusbar_visible="draft,done,cancelled,refused" |
|||
statusbar_colors='{"draft":"grey","done":"green","cancelled":"orange","refused":"red"}'/> |
|||
</header> |
|||
<sheet> |
|||
<group> |
|||
<group> |
|||
<field name="request_date" |
|||
attrs="{'readonly':[('state','!=','draft')]}"/> |
|||
<field name="operation_type" |
|||
attrs="{'readonly':[('state','!=','draft')]}"/> |
|||
<field name="receiver_not_member" |
|||
attrs="{'invisible':[('operation_type','!=','transfer')]}"/> |
|||
<field name="partner_id" |
|||
options="{'no_create':True}" |
|||
attrs="{'readonly':[('state','!=','draft')]}"/> |
|||
<field name="partner_id_to" |
|||
options="{'no_create':True}" |
|||
attrs="{'invisible':['|',('operation_type','!=','transfer'), ('receiver_not_member','=',True)]}"/> |
|||
</group> |
|||
<group> |
|||
<field name="user_id"/> |
|||
<field name="share_product_id" |
|||
attrs="{'readonly':[('state','!=','draft')]}" |
|||
widget="selection"/> |
|||
<field name="share_short_name" readonly="True"/> |
|||
<field name="share_to_product_id" |
|||
attrs="{'invisible':[('operation_type','!=','convert')],'required':[('operation_type','=','convert')],'readonly':[('state','!=','draft')]}" |
|||
widget="selection"/> |
|||
<field name="share_to_short_name" readonly="True"/> |
|||
<field name="quantity" |
|||
attrs="{'readonly':[('state','!=','draft')]}"/> |
|||
<field name="share_unit_price" readonly="True"/> |
|||
<field name="subscription_amount" readonly="True"/> |
|||
</group> |
|||
</group> |
|||
<group> |
|||
<field name="subscription_request" |
|||
attrs="{'invisible':['|',('operation_type','!=','transfer'),('receiver_not_member','=',False)]}" |
|||
context="{'default_is_operation': True, 'default_ordered_parts':quantity,'default_share_product_id': share_product_id, 'default_source':'operation'}"> |
|||
<tree> |
|||
<field name="name"/> |
|||
<field name="birthdate"/> |
|||
<field name="phone"/> |
|||
<field name="email"/> |
|||
<field name="iban"/> |
|||
<field name="state" invisible="True"/> |
|||
</tree> |
|||
<form string="Subscription Requests"> |
|||
<sheet> |
|||
<group> |
|||
<group> |
|||
<field name="name"/> |
|||
<field name="firstname"/> |
|||
<field name="lastname"/> |
|||
<field name="birthdate"/> |
|||
<field name="gender"/> |
|||
<field name="email"/> |
|||
<field name="phone"/> |
|||
<field name="iban"/> |
|||
</group> |
|||
<group> |
|||
<field name="address"/> |
|||
<field name="zip_code"/> |
|||
<field name="city"/> |
|||
<field name="country_id"/> |
|||
<field name="lang"/> |
|||
<field name="validated"/> |
|||
<field name="skip_control_ng"/> |
|||
<field name="ordered_parts" |
|||
invisible="True"/> |
|||
<field name="source" |
|||
invisible="True"/> |
|||
<field name="state" |
|||
invisible="True"/> |
|||
<field name="share_product_id" |
|||
invisible="True"/> |
|||
</group> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="operation_request_action" model="ir.actions.act_window"> |
|||
<field name="name">Operation request</field> |
|||
<field name="res_model">operation.request</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" ref="operation_request_tree"/> |
|||
</record> |
|||
|
|||
</odoo> |
@ -1,153 +1,168 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<record id="product_template_share_form_view" model="ir.ui.view"> |
|||
<field name="name">product.template.share.form</field> |
|||
<field name="model">product.template</field> |
|||
<field name="inherit_id" ref="product.product_template_form_view"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//field[@name='purchase_ok']/.." position="after"> |
|||
<div groups="easy_my_coop.group_easy_my_coop_manager"> |
|||
<field name="is_share"/> |
|||
<label for="is_share"/> |
|||
</div> |
|||
<div attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_easy_my_coop_user"> |
|||
<field name="display_on_website"/> |
|||
<label for="display_on_website"/> |
|||
</div> |
|||
</xpath> |
|||
<page name="general_information" position="after"> |
|||
<page string="Share Information" name="share_information" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_easy_my_coop_user"> |
|||
<group> |
|||
<group name="Info" string="Info"> |
|||
<field name="short_name"/> |
|||
<field name="default_share_product"/> |
|||
<field name="mail_template"/> |
|||
</group> |
|||
<group name="configuration" string="Configuration"> |
|||
<field name="force_min_qty"/> |
|||
<field name="minimum_quantity"/> |
|||
<field name="customer" attrs="{'invisible':[('is_share','=',False)]}"/> |
|||
<field name="by_company"/> |
|||
<field name="by_individual"/> |
|||
</group> |
|||
</group> |
|||
</page> |
|||
</page> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="share_product_filter" model="ir.ui.view"> |
|||
<field name="name">product.template.share.filter</field> |
|||
<field name="model">product.template</field> |
|||
<field name="inherit_id" ref="product.product_template_search_view"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="." position="inside"> |
|||
<group expand="0" name="group_by" string="Group By"> |
|||
<filter name="Creation Date" context="{'group_by': 'create_date'}"/> |
|||
</group> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="product_template_only_form_view" model="ir.ui.view"> |
|||
<field name="name">product.template.product.form</field> |
|||
<field name="model">product.template</field> |
|||
<field name="inherit_id" ref="product.product_template_only_form_view"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="default_code" position="attributes"> |
|||
<attribute name="attrs">{'required': [('is_share', '=', True)]}</attribute> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="share_product_action" model="ir.actions.act_window"> |
|||
<field name="name">Share type</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">product.template</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">kanban,tree,form</field> |
|||
<!-- <field name="context">{"search_default_filter_to_purchase":1}</field> --> |
|||
<field name="search_view_id" eval="False" /> <!-- Force empty --> |
|||
<field name="view_id" eval="False" /> <!-- Force empty --> |
|||
<field name="domain">[('is_share','=',True)]</field> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to define a new share product. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
|
|||
<!-- overriding product views to not display share product in the purchase and sale views--> |
|||
|
|||
<record id="product.product_normal_action" model="ir.actions.act_window"> |
|||
<field name="name">Product</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">product.product</field> |
|||
<field name="view_mode">tree,form,kanban</field> |
|||
<field name="view_type">form</field> |
|||
<field name="search_view_id" ref="product.product_search_form_view"/> |
|||
<field name="view_id" eval="False"/> <!-- Force empty --> |
|||
<field name="domain">[('is_share','=',False)]</field> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to define a new product. |
|||
</p><p> |
|||
You must define a product for everything you sell, whether it's |
|||
a physical product, a consumable or a service you offer to |
|||
customers. |
|||
</p><p> |
|||
The product form contains information to simplify the sale |
|||
process: price, notes in the quotation, accounting data, |
|||
procurement methods, etc. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="product.product_template_action" model="ir.actions.act_window"> |
|||
<field name="name">Products</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">product.template</field> |
|||
<field name="view_mode">tree,form,kanban</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" ref="product.product_template_kanban_view"/> |
|||
<field name="context">{"search_default_filter_to_sell":1}</field> |
|||
<field name="domain">[('is_share','=',False)]</field> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to define a new product. |
|||
</p><p> |
|||
You must define a product for everything you sell, whether it's a physical product, a consumable or a service you offer to customers. |
|||
</p><p> |
|||
The product form contains information to simplify the sale process: price, notes in the quotation, accounting data, procurement methods, etc. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<!-- move this action to another module cause the original action has been |
|||
moved to purchase module. So we want to avoid make purchase module installed |
|||
<record id="product.product_normal_action_puchased" model="ir.actions.act_window"> |
|||
<field name="name">Products</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">product.template</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">kanban,tree,form</field> |
|||
<field name="context">{"search_default_filter_to_purchase":1}</field> |
|||
<field name="search_view_id" eval="False"/> Force empty |
|||
<field name="view_id" eval="False"/> Force empty |
|||
<field name="domain">[('is_share','=',False)]</field> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to define a new product. |
|||
</p><p> |
|||
You must define a product for everything you purchase, whether |
|||
it's a physical product, a consumable or services you buy to |
|||
subcontractants. |
|||
</p><p> |
|||
The product form contains detailed information to improve the |
|||
purchase process: prices, procurement logistics, accounting data, |
|||
available vendors, etc. |
|||
</p> |
|||
</field> |
|||
</record> --> |
|||
</odoo> |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<record id="product_template_share_form_view" model="ir.ui.view"> |
|||
<field name="name">product.template.share.form</field> |
|||
<field name="model">product.template</field> |
|||
<field name="inherit_id" ref="product.product_template_form_view"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//field[@name='purchase_ok']/.." position="after"> |
|||
<div groups="easy_my_coop.group_easy_my_coop_manager"> |
|||
<field name="is_share"/> |
|||
<label for="is_share"/> |
|||
</div> |
|||
<div attrs="{'invisible':[('is_share','=',False)]}" |
|||
groups="easy_my_coop.group_easy_my_coop_user"> |
|||
<field name="display_on_website"/> |
|||
<label for="display_on_website"/> |
|||
</div> |
|||
</xpath> |
|||
<page name="general_information" position="after"> |
|||
<page string="Share Information" name="share_information" |
|||
attrs="{'invisible':[('is_share','=',False)]}" |
|||
groups="easy_my_coop.group_easy_my_coop_user"> |
|||
<group> |
|||
<group name="Info" string="Info"> |
|||
<field name="short_name"/> |
|||
<field name="default_share_product"/> |
|||
<field name="mail_template"/> |
|||
</group> |
|||
<group name="configuration" string="Configuration"> |
|||
<field name="force_min_qty"/> |
|||
<field name="minimum_quantity"/> |
|||
<field name="customer" |
|||
attrs="{'invisible':[('is_share','=',False)]}"/> |
|||
<field name="by_company"/> |
|||
<field name="by_individual"/> |
|||
</group> |
|||
</group> |
|||
</page> |
|||
</page> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="share_product_filter" model="ir.ui.view"> |
|||
<field name="name">product.template.share.filter</field> |
|||
<field name="model">product.template</field> |
|||
<field name="inherit_id" ref="product.product_template_search_view"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="." position="inside"> |
|||
<group expand="0" name="group_by" string="Group By"> |
|||
<filter name="Creation Date" |
|||
context="{'group_by': 'create_date'}"/> |
|||
</group> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="product_template_only_form_view" model="ir.ui.view"> |
|||
<field name="name">product.template.product.form</field> |
|||
<field name="model">product.template</field> |
|||
<field name="inherit_id" ref="product.product_template_only_form_view"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="default_code" position="attributes"> |
|||
<attribute name="attrs">{'required': [('is_share', '=', |
|||
True)]} |
|||
</attribute> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="share_product_action" model="ir.actions.act_window"> |
|||
<field name="name">Share type</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">product.template</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">kanban,tree,form</field> |
|||
<!-- <field name="context">{"search_default_filter_to_purchase":1}</field> --> |
|||
<field name="search_view_id" eval="False"/> <!-- Force empty --> |
|||
<field name="view_id" eval="False"/> <!-- Force empty --> |
|||
<field name="domain">[('is_share','=',True)]</field> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to define a new share product. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
|
|||
<!-- overriding product views to not display share product in the purchase and sale views--> |
|||
|
|||
<record id="product.product_normal_action" model="ir.actions.act_window"> |
|||
<field name="name">Product</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">product.product</field> |
|||
<field name="view_mode">tree,form,kanban</field> |
|||
<field name="view_type">form</field> |
|||
<field name="search_view_id" ref="product.product_search_form_view"/> |
|||
<field name="view_id" eval="False"/> <!-- Force empty --> |
|||
<field name="domain">[('is_share','=',False)]</field> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to define a new product. |
|||
</p> |
|||
<p> |
|||
You must define a product for everything you sell, whether it's |
|||
a physical product, a consumable or a service you offer to |
|||
customers. |
|||
</p> |
|||
<p> |
|||
The product form contains information to simplify the sale |
|||
process: price, notes in the quotation, accounting data, |
|||
procurement methods, etc. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="product.product_template_action" model="ir.actions.act_window"> |
|||
<field name="name">Products</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">product.template</field> |
|||
<field name="view_mode">tree,form,kanban</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" ref="product.product_template_kanban_view"/> |
|||
<field name="context">{"search_default_filter_to_sell":1}</field> |
|||
<field name="domain">[('is_share','=',False)]</field> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to define a new product. |
|||
</p> |
|||
<p> |
|||
You must define a product for everything you sell, whether it's |
|||
a physical product, a consumable or a service you offer to |
|||
customers. |
|||
</p> |
|||
<p> |
|||
The product form contains information to simplify the sale |
|||
process: price, notes in the quotation, accounting data, |
|||
procurement methods, etc. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<!-- move this action to another module cause the original action has been |
|||
moved to purchase module. So we want to avoid make purchase module installed |
|||
<record id="product.product_normal_action_puchased" model="ir.actions.act_window"> |
|||
<field name="name">Products</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">product.template</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">kanban,tree,form</field> |
|||
<field name="context">{"search_default_filter_to_purchase":1}</field> |
|||
<field name="search_view_id" eval="False"/> Force empty |
|||
<field name="view_id" eval="False"/> Force empty |
|||
<field name="domain">[('is_share','=',False)]</field> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to define a new product. |
|||
</p><p> |
|||
You must define a product for everything you purchase, whether |
|||
it's a physical product, a consumable or services you buy to |
|||
subcontractants. |
|||
</p><p> |
|||
The product form contains detailed information to improve the |
|||
purchase process: prices, procurement logistics, accounting data, |
|||
available vendors, etc. |
|||
</p> |
|||
</field> |
|||
</record> --> |
|||
</odoo> |
@ -1,34 +1,35 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<record model="ir.ui.view" id="view_company_inherit_form2"> |
|||
<field name="name">res.company.form.easymy.coop</field> |
|||
<field name="inherit_id" ref="base.view_company_form"/> |
|||
<field name="model">res.company</field> |
|||
<field name="arch" type="xml"> |
|||
<group name="social_media" position="before"> |
|||
<group name="coop_grp" string="EasyMy Coop" groups="easy_my_coop.group_easy_my_coop_user"> |
|||
<field name="unmix_share_type"/> |
|||
<field name="allow_id_card_upload"/> |
|||
<field name="create_user"/> |
|||
<field name="display_logo1"/> |
|||
<field name="bottom_logo1"/> |
|||
<field name="display_logo2"/> |
|||
<field name="bottom_logo2"/> |
|||
<field name="coop_email_contact"/> |
|||
<field name="subscription_maximum_amount"/> |
|||
<field name="property_cooperator_account"/> |
|||
<field name="default_country_id"/> |
|||
<field name="default_lang_id"/> |
|||
<field name="board_representative"/> |
|||
<field name="signature_scan"/> |
|||
<field name="display_data_policy_approval"/> |
|||
<field name="data_policy_approval_required"/> |
|||
<field name="data_policy_approval_text"/> |
|||
<field name="display_internal_rules_approval"/> |
|||
<field name="internal_rules_approval_required"/> |
|||
<field name="internal_rules_approval_text"/> |
|||
</group> |
|||
</group> |
|||
</field> |
|||
</record> |
|||
</odoo> |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<record model="ir.ui.view" id="view_company_inherit_form2"> |
|||
<field name="name">res.company.form.easymy.coop</field> |
|||
<field name="inherit_id" ref="base.view_company_form"/> |
|||
<field name="model">res.company</field> |
|||
<field name="arch" type="xml"> |
|||
<group name="social_media" position="before"> |
|||
<group name="coop_grp" string="EasyMy Coop" |
|||
groups="easy_my_coop.group_easy_my_coop_user"> |
|||
<field name="unmix_share_type"/> |
|||
<field name="allow_id_card_upload"/> |
|||
<field name="create_user"/> |
|||
<field name="display_logo1"/> |
|||
<field name="bottom_logo1"/> |
|||
<field name="display_logo2"/> |
|||
<field name="bottom_logo2"/> |
|||
<field name="coop_email_contact"/> |
|||
<field name="subscription_maximum_amount"/> |
|||
<field name="property_cooperator_account"/> |
|||
<field name="default_country_id"/> |
|||
<field name="default_lang_id"/> |
|||
<field name="board_representative"/> |
|||
<field name="signature_scan"/> |
|||
<field name="display_data_policy_approval"/> |
|||
<field name="data_policy_approval_required"/> |
|||
<field name="data_policy_approval_text"/> |
|||
<field name="display_internal_rules_approval"/> |
|||
<field name="internal_rules_approval_required"/> |
|||
<field name="internal_rules_approval_text"/> |
|||
</group> |
|||
</group> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -1,171 +1,225 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
Copyright 2019 Coop IT Easy |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
--> |
|||
<odoo> |
|||
<data> |
|||
<record id="view_partner_form_easy_my_coop" model="ir.ui.view"> |
|||
<field name="name">res.partner.form.easy_my_coop</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form"/> |
|||
<field name="arch" type="xml"> |
|||
<sheet position="before"> |
|||
<header> |
|||
<button string="Create Subscription" name="%(action_view_create_subscription)d" |
|||
type="action" context="{'default_active_id': active_id}" groups="easy_my_coop.group_easy_my_coop_user"/> |
|||
<button id="action_view_update_partner_info" string="Update info" name="%(action_view_update_partner_info)d" |
|||
type="action" context="{'default_active_id': active_id}" groups="easy_my_coop.group_easy_my_coop_user"/> |
|||
</header> |
|||
</sheet> |
|||
|
|||
<xpath expr="/form/sheet/group" position='before'> |
|||
<group> |
|||
<group> |
|||
<field name="representative" attrs="{'invisible':['|',('parent_id','=',False),('is_company','=',True)]}"/> |
|||
<field name="cooperator_register_number" readonly="True" attrs="{'invisible':[('member','=',False)]}"/> |
|||
<field name="company_register_number" readonly="True" attrs="{'invisible':[('is_company','=',False)]}"/> |
|||
<field name="coop_candidate" groups="easy_my_coop.group_easy_my_coop_user"/> |
|||
<field name="cooperator" invisible="True" groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
<field name="member" groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
<field name="cooperator_type" attrs="{'invisible':[('member','=',False)]}"/> |
|||
<field name="effective_date" attrs="{'invisible':[('member','=',False)]}"/> |
|||
</group> |
|||
<group> |
|||
<field name="gender" attrs="{'invisible':[('is_company','=',True)]}"/> |
|||
</group> |
|||
<group name="approvals"> |
|||
<field name="internal_rules_approved" /> |
|||
<field name="data_policy_approved" /> |
|||
</group> |
|||
</group> |
|||
</xpath> |
|||
|
|||
<page name='sales_purchases' position="after"> |
|||
<page string="Shares" name="share" attrs="{'invisible':[('member','=',False)]}" groups="easy_my_coop.group_easy_my_coop_user"> |
|||
<group> |
|||
<field name="number_of_share"/> |
|||
<field name="total_value"/> |
|||
</group> |
|||
<field name="share_ids"> |
|||
<tree create="false"> |
|||
<field name="effective_date"/> |
|||
<field name="share_short_name"/> |
|||
<field name="share_number" sum="Total of shares"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="total_amount_line" sum="Total subscribed amount"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
<page string="Share subscriptions" name="share_subscription" attrs="{'invisible':[('cooperator','=',False)]}" groups="easy_my_coop.group_easy_my_coop_user"> |
|||
<field name="subscription_request_ids"> |
|||
<tree create="false" delete="false" edit="false"> |
|||
<field name="share_short_name"/> |
|||
<field name="ordered_parts" sum="Total of shares"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="subscription_amount" sum="Total subscribed amount"/> |
|||
<field name="type"/> |
|||
<field name="state"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
</page> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_partner_tree_easy_my_coop" model="ir.ui.view"> |
|||
<field name="name">res.partner.tree.easy_my_coop</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_tree"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="/tree/field[@name='display_name']" position='after'> |
|||
<field name="cooperator_register_number" /> |
|||
<field name="cooperator_type"/> |
|||
<field name="effective_date"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_res_partner_filter_coop" model="ir.ui.view"> |
|||
<field name="name">res.partner.select</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_res_partner_filter"/> |
|||
<field name="arch" type="xml"> |
|||
<filter name="supplier" position='after'> |
|||
<filter string="Cooperators" name="cooperators" domain="[('member','=',1)]" help="Cooperator Partners"/> |
|||
<filter string="Old Cooperators" name="old_cooperators" domain="[('old_member','=',1)]" help="Cooperator Partners"/> |
|||
<filter string="Cooperator Candidates" name="cooperator_candidates" domain="[('coop_candidate','=',1)]" help="Cooperator Partners"/> |
|||
</filter> |
|||
<filter name="salesperson" position="before"> |
|||
<filter string="Cooperator Type" name="group_by_cooperator_type" context="{'group_by': 'cooperator_type'}"/> |
|||
</filter> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_partner_cooperator_form" model="ir.actions.act_window"> |
|||
<field name="name">Cooperators</field> |
|||
<field name="res_model">res.partner</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">kanban,tree,form</field> |
|||
<field name="domain">['|', ('cooperator','=',True), '|', ('member','=',True),('old_member','=', True)]</field> |
|||
<field name="context">{'default_cooperator':1, 'search_default_cooperators':1}</field> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to add a contact in your address book. |
|||
</p><p> |
|||
OpenERP helps you easily track all activities related to |
|||
a cooperator: discussions, history of business opportunities, |
|||
documents, etc. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_partner_cooperator_candidate_form" model="ir.actions.act_window"> |
|||
<field name="name">Cooperator candidates</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">res.partner</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">kanban,tree,form</field> |
|||
<field name="domain">[('cooperator','=',True)]</field> |
|||
<field name="context">{'default_cooperator':1, 'search_default_cooperator_candidates':1}</field> |
|||
<field name="filter" eval="True"/> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to add a contact in your address book. |
|||
</p><p> |
|||
OpenERP helps you easily track all activities related to |
|||
a cooperator: discussions, history of business opportunities, |
|||
documents, etc. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_company_representative_form" model="ir.actions.act_window"> |
|||
<field name="name">Company representative</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">res.partner</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">kanban,tree,form</field> |
|||
<field name="domain">[('cooperator','=',True),('representative','=',True)]</field> |
|||
<field name="filter" eval="True"/> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to add a contact in your address book. |
|||
</p><p> |
|||
OpenERP helps you easily track all activities related to |
|||
a cooperator: discussions, history of business opportunities, |
|||
documents, etc. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="remove_partner_follower" model="ir.ui.view"> |
|||
<field name="name">res.partner.remove.follower.inherit</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="mail.res_partner_view_form_inherit_mail"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="message_follower_ids" position="replace"/> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
Copyright 2019 Coop IT Easy |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
--> |
|||
<odoo> |
|||
<data> |
|||
<record id="view_partner_form_easy_my_coop" model="ir.ui.view"> |
|||
<field name="name">res.partner.form.easy_my_coop</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form"/> |
|||
<field name="arch" type="xml"> |
|||
<sheet position="before"> |
|||
<header> |
|||
<button string="Create Subscription" |
|||
name="%(action_view_create_subscription)d" |
|||
type="action" |
|||
context="{'default_active_id': active_id}" |
|||
groups="easy_my_coop.group_easy_my_coop_user"/> |
|||
<button id="action_view_update_partner_info" |
|||
string="Update info" |
|||
name="%(action_view_update_partner_info)d" |
|||
type="action" |
|||
context="{'default_active_id': active_id}" |
|||
groups="easy_my_coop.group_easy_my_coop_user"/> |
|||
</header> |
|||
</sheet> |
|||
|
|||
<xpath expr="/form/sheet/group" position='before'> |
|||
<group> |
|||
<group> |
|||
<field name="representative" |
|||
attrs="{'invisible':['|',('parent_id','=',False),('is_company','=',True)]}"/> |
|||
<field name="cooperator_register_number" |
|||
readonly="True" |
|||
attrs="{'invisible':[('member','=',False)]}"/> |
|||
<field name="company_register_number" |
|||
readonly="True" |
|||
attrs="{'invisible':[('is_company','=',False)]}"/> |
|||
<field name="coop_candidate" |
|||
groups="easy_my_coop.group_easy_my_coop_user"/> |
|||
<field name="cooperator" invisible="True" |
|||
groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
<field name="member" |
|||
groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
<field name="cooperator_type" |
|||
attrs="{'invisible':[('member','=',False)]}"/> |
|||
<field name="effective_date" |
|||
attrs="{'invisible':[('member','=',False)]}"/> |
|||
</group> |
|||
<group> |
|||
<field name="gender" |
|||
attrs="{'invisible':[('is_company','=',True)]}"/> |
|||
</group> |
|||
<group name="approvals"> |
|||
<field name="internal_rules_approved"/> |
|||
<field name="data_policy_approved"/> |
|||
</group> |
|||
</group> |
|||
</xpath> |
|||
|
|||
<page name='sales_purchases' position="after"> |
|||
<page string="Shares" name="share" |
|||
attrs="{'invisible':[('member','=',False)]}" |
|||
groups="easy_my_coop.group_easy_my_coop_user"> |
|||
<group> |
|||
<field name="number_of_share"/> |
|||
<field name="total_value"/> |
|||
</group> |
|||
<field name="share_ids"> |
|||
<tree create="false"> |
|||
<field name="effective_date"/> |
|||
<field name="share_short_name"/> |
|||
<field name="share_number" |
|||
sum="Total of shares"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="total_amount_line" |
|||
sum="Total subscribed amount"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
<page string="Share subscriptions" name="share_subscription" |
|||
attrs="{'invisible':[('cooperator','=',False)]}" |
|||
groups="easy_my_coop.group_easy_my_coop_user"> |
|||
<field name="subscription_request_ids"> |
|||
<tree create="false" delete="false" edit="false"> |
|||
<field name="share_short_name"/> |
|||
<field name="ordered_parts" |
|||
sum="Total of shares"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="subscription_amount" |
|||
sum="Total subscribed amount"/> |
|||
<field name="type"/> |
|||
<field name="state"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
</page> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_partner_tree_easy_my_coop" model="ir.ui.view"> |
|||
<field name="name">res.partner.tree.easy_my_coop</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_tree"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="/tree/field[@name='display_name']" |
|||
position='after'> |
|||
<field name="cooperator_register_number"/> |
|||
<field name="cooperator_type"/> |
|||
<field name="effective_date"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_res_partner_filter_coop" model="ir.ui.view"> |
|||
<field name="name">res.partner.select</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_res_partner_filter"/> |
|||
<field name="arch" type="xml"> |
|||
<filter name="supplier" position='after'> |
|||
<filter string="Cooperators" name="cooperators" |
|||
domain="[('member','=',1)]" |
|||
help="Cooperator Partners"/> |
|||
<filter string="Old Cooperators" name="old_cooperators" |
|||
domain="[('old_member','=',1)]" |
|||
help="Cooperator Partners"/> |
|||
<filter string="Cooperator Candidates" |
|||
name="cooperator_candidates" |
|||
domain="[('coop_candidate','=',1)]" |
|||
help="Cooperator Partners"/> |
|||
</filter> |
|||
<filter name="salesperson" position="before"> |
|||
<filter string="Cooperator Type" |
|||
name="group_by_cooperator_type" |
|||
context="{'group_by': 'cooperator_type'}"/> |
|||
</filter> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_partner_cooperator_form" |
|||
model="ir.actions.act_window"> |
|||
<field name="name">Cooperators</field> |
|||
<field name="res_model">res.partner</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">kanban,tree,form</field> |
|||
<field name="domain">['|', ('cooperator','=',True), '|', |
|||
('member','=',True),('old_member','=', True)] |
|||
</field> |
|||
<field name="context">{'default_cooperator':1, |
|||
'search_default_cooperators':1} |
|||
</field> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to add a contact in your address book. |
|||
</p> |
|||
<p> |
|||
OpenERP helps you easily track all activities related to |
|||
a cooperator: discussions, history of business |
|||
opportunities, |
|||
documents, etc. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_partner_cooperator_candidate_form" |
|||
model="ir.actions.act_window"> |
|||
<field name="name">Cooperator candidates</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">res.partner</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">kanban,tree,form</field> |
|||
<field name="domain">[('cooperator','=',True)]</field> |
|||
<field name="context">{'default_cooperator':1, |
|||
'search_default_cooperator_candidates':1} |
|||
</field> |
|||
<field name="filter" eval="True"/> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to add a contact in your address book. |
|||
</p> |
|||
<p> |
|||
OpenERP helps you easily track all activities related to |
|||
a cooperator: discussions, history of business |
|||
opportunities, |
|||
documents, etc. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_company_representative_form" |
|||
model="ir.actions.act_window"> |
|||
<field name="name">Company representative</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">res.partner</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">kanban,tree,form</field> |
|||
<field name="domain"> |
|||
[('cooperator','=',True),('representative','=',True)] |
|||
</field> |
|||
<field name="filter" eval="True"/> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to add a contact in your address book. |
|||
</p> |
|||
<p> |
|||
OpenERP helps you easily track all activities related to |
|||
a cooperator: discussions, history of business |
|||
opportunities, |
|||
documents, etc. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="remove_partner_follower" model="ir.ui.view"> |
|||
<field name="name">res.partner.remove.follower.inherit</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" |
|||
ref="mail.res_partner_view_form_inherit_mail"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="message_follower_ids" position="replace"/> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -1,201 +1,238 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
|
|||
<record id="subscription_request_tree" model="ir.ui.view"> |
|||
<field name="name">subscription.request.tree</field> |
|||
<field name="model">subscription.request</field> |
|||
<field name="arch" type="xml"> |
|||
<!-- fixme no colors in v12 ? --> |
|||
<tree string="Subscription Requests" colors="red:validated == False; blue:state in ('draft'); grey: state in ('done')"> |
|||
<field name="name"/> |
|||
<field name="company_name"/> |
|||
<field name="date" string="Request Date"/> |
|||
<field name="type"/> |
|||
<field name="share_short_name" string="Share Type"/> |
|||
<field name="ordered_parts" string="Quantity" sum="Total ordered parts"/> |
|||
<field name="subscription_amount" sum="Total amount"/> |
|||
<field name="email"/> |
|||
<field name="iban"/> |
|||
<field name="partner_id"/> |
|||
<field name="source"/> |
|||
<field name="state"/> |
|||
<field name="validated" invisible="True"/> |
|||
<button type="object" string="Validate" aria-label="Validate" name="validate_subscription_request" attrs="{'invisible':['|',('state','not in',['draft','waiting']),('validated','=',False)]}"/> |
|||
<button type="object" string="Block" aria-label="Block" name="block_subscription_request" states="draft" groups="easy_my_coop.group_easy_my_coop_user"/> |
|||
<button type="object" string="Unblock" aria-label="Unblock" name="unblock_subscription_request" states="block" groups="easy_my_coop.group_easy_my_coop_user"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="subscription_request_form" model="ir.ui.view"> |
|||
<field name="name">subscription.request.form</field> |
|||
<field name="model">subscription.request</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Subscription Requests"> |
|||
<header> |
|||
<button string="Validate" type="object" name="validate_subscription_request" attrs="{'invisible':['|',('state','not in',['draft','waiting']),('validated','=',False)]}"/> |
|||
<button string="Waiting list" type="object" name="put_on_waiting_list" states="draft"/> |
|||
<button string="Cancel" type="object" name="cancel_subscription_request" states="draft,waiting,done,block" groups="easy_my_coop.group_easy_my_coop_user"/> |
|||
<field name="state" widget="statusbar" statusbar_visible="draft,cancelled,done,failed"/> |
|||
</header> |
|||
<sheet> |
|||
<group> |
|||
<group> |
|||
<field name="validated" invisible="True"/> |
|||
<field name="already_cooperator"/> |
|||
<field name="is_company" groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
<field name="is_operation" invisible="True"/> |
|||
<field name="company_name" attrs="{'invisible':[('is_company','=',False)]}"/> |
|||
<field name="company_email" attrs="{'invisible':[('is_company','=',False)]}"/> |
|||
<field name="company_type" attrs="{'invisible':[('is_company','=',False)]}"/> |
|||
<field name="company_register_number" attrs="{'invisible':[('is_company','=',False)]}"/> |
|||
<field name="name"/> |
|||
<field name="firstname"/> |
|||
<field name="lastname"/> |
|||
<field name="birthdate"/> |
|||
<field name="gender"/> |
|||
<field name="email"/> |
|||
<field name="phone"/> |
|||
<field name="contact_person_function" attrs="{'invisible':[('is_company','=',False)]}"/> |
|||
<!-- todo highlight iban if not valid --> |
|||
<field name="iban"/> |
|||
<field name="address"/> |
|||
<field name="zip_code"/> |
|||
<field name="city"/> |
|||
<field name="country_id" options="{'no_create':True}"/> |
|||
</group> |
|||
<group> |
|||
<field name="capital_release_request_date" groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
<field name="date"/> |
|||
<field name="source"/> |
|||
<field name="ordered_parts"/> |
|||
<field name="share_product_id" widget="selection"/> |
|||
<field name="share_short_name"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="subscription_amount"/> |
|||
<field name="partner_id" options="{'no_create':True}"/> |
|||
<field name="type"/> |
|||
<field name="lang"/> |
|||
<field name="skip_control_ng"/> |
|||
<field name="data_policy_approved"/> |
|||
</group> |
|||
</group> |
|||
<notebook> |
|||
<page name="capital_release_request" string="Capital release request"> |
|||
<field name="capital_release_request"> |
|||
<tree options="{'no_create':True}"> |
|||
<field string="Cooperator" name="partner_id"/> |
|||
<field name="date_invoice"/> |
|||
<field name="number"/> |
|||
<field string="Reference" name="reference"/> |
|||
<field name="date_due"/> |
|||
<field name="amount_total_signed"/> |
|||
<field name="residual_signed"/> |
|||
<field name="state"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
</notebook> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_subscription_request_filter" model="ir.ui.view"> |
|||
<field name="name">Cooperator Subscription Search</field> |
|||
<field name="model">subscription.request</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search Subscription Request"> |
|||
<field name="name"/> |
|||
<field name="partner_id"/> |
|||
<separator/> |
|||
<filter string="Draft" name="state_draft" domain="[('state','=','draft')]"/> |
|||
<filter string="Paid" name="state_paid" domain="[('state','=','paid')]"/> |
|||
<filter string="Done" name="state_done" domain="[('state','=','done')]"/> |
|||
<separator/> |
|||
<filter string="Not Validated" name="Not Validated" domain="[('validated', '=', False)]"/> |
|||
<group expand="0" name="group_by" string="Group By"> |
|||
<filter name="request_type" string="Request type" context="{'group_by' : 'type'}" /> |
|||
<filter name="date" string="Request Date" context="{'group_by': 'date'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="subscription_request_action" model="ir.actions.act_window"> |
|||
<field name="name">Subscriptions</field> |
|||
<field name="res_model">subscription.request</field> |
|||
<field name="view_type">form</field> |
|||
<field name="domain">[('is_operation','=',False)]</field> |
|||
<field name="context">{'default_source':'manual'}</field> |
|||
<field name="view_id" ref="subscription_request_tree"/> |
|||
<field name="search_view_id" ref="view_subscription_request_filter"/> |
|||
</record> |
|||
|
|||
<record id="share_line_form" model="ir.ui.view"> |
|||
<field name="name">share.line.form</field> |
|||
<field name="model">share.line</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Share line"> |
|||
<header> |
|||
<button string="Update info" name="%(action_view_update_share_line_info)d" |
|||
type="action" context="{'default_active_id': active_id}" groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
</header> |
|||
<sheet> |
|||
<group> |
|||
<group> |
|||
<field name="partner_id"/> |
|||
<field name="share_product_id"/> |
|||
<field name="share_number"/> |
|||
</group> |
|||
<group> |
|||
<field name="share_short_name"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="effective_date"/> |
|||
<field name="total_amount_line"/> |
|||
</group> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="share_line_tree" model="ir.ui.view"> |
|||
<field name="name">share.line.tree</field> |
|||
<field name="model">share.line</field> |
|||
<field name="arch" type="xml"> |
|||
<tree> |
|||
<field name="partner_id"/> |
|||
<field name="share_product_id"/> |
|||
<field name="share_number"/> |
|||
<field name="share_short_name"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="effective_date"/> |
|||
<field name="total_amount_line"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_share_line_filter" model="ir.ui.view"> |
|||
<field name="name">Share Line Search</field> |
|||
<field name="model">share.line</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search Share Line"> |
|||
<field name="partner_id"/> |
|||
<field name="effective_date"/> |
|||
<separator/> |
|||
<group name="group_by" string="Group By"> |
|||
<filter name="cooperator" string="Cooperator" context="{'group_by' : 'partner_id'}" /> |
|||
<filter name="effective_date" string="Effective date" context="{'group_by': 'effective_date'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="share_line_action" model="ir.actions.act_window"> |
|||
<field name="name">Share Lines</field> |
|||
<field name="res_model">share.line</field> |
|||
<field name="view_type">form</field> |
|||
</record> |
|||
|
|||
</odoo> |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
|
|||
<record id="subscription_request_tree" model="ir.ui.view"> |
|||
<field name="name">subscription.request.tree</field> |
|||
<field name="model">subscription.request</field> |
|||
<field name="arch" type="xml"> |
|||
<!-- fixme no colors in v12 ? --> |
|||
<tree string="Subscription Requests" |
|||
colors="red:validated == False; blue:state in ('draft'); grey: state in ('done')"> |
|||
<field name="name"/> |
|||
<field name="company_name"/> |
|||
<field name="date" string="Request Date"/> |
|||
<field name="type"/> |
|||
<field name="share_short_name" string="Share Type"/> |
|||
<field name="ordered_parts" string="Quantity" |
|||
sum="Total ordered parts"/> |
|||
<field name="subscription_amount" sum="Total amount"/> |
|||
<field name="email"/> |
|||
<field name="iban"/> |
|||
<field name="partner_id"/> |
|||
<field name="source"/> |
|||
<field name="state"/> |
|||
<field name="validated" invisible="True"/> |
|||
<button type="object" string="Validate" aria-label="Validate" |
|||
name="validate_subscription_request" |
|||
attrs="{'invisible':['|',('state','not in',['draft','waiting']),('validated','=',False)]}"/> |
|||
<button type="object" string="Block" aria-label="Block" |
|||
name="block_subscription_request" states="draft" |
|||
groups="easy_my_coop.group_easy_my_coop_user"/> |
|||
<button type="object" string="Unblock" aria-label="Unblock" |
|||
name="unblock_subscription_request" states="block" |
|||
groups="easy_my_coop.group_easy_my_coop_user"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="subscription_request_form" model="ir.ui.view"> |
|||
<field name="name">subscription.request.form</field> |
|||
<field name="model">subscription.request</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Subscription Requests"> |
|||
<header> |
|||
<button string="Validate" type="object" |
|||
name="validate_subscription_request" |
|||
attrs="{'invisible':['|',('state','not in',['draft','waiting']),('validated','=',False)]}"/> |
|||
<button string="Waiting list" type="object" |
|||
name="put_on_waiting_list" states="draft"/> |
|||
<button string="Cancel" type="object" |
|||
name="cancel_subscription_request" |
|||
states="draft,waiting,done,block" |
|||
groups="easy_my_coop.group_easy_my_coop_user"/> |
|||
<field name="state" widget="statusbar" |
|||
statusbar_visible="draft,cancelled,done,failed"/> |
|||
</header> |
|||
<sheet> |
|||
<group> |
|||
<group> |
|||
<field name="validated" invisible="True"/> |
|||
<field name="already_cooperator"/> |
|||
<field name="is_company" |
|||
groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
<field name="is_operation" invisible="True"/> |
|||
<field name="company_name" |
|||
attrs="{'invisible':[('is_company','=',False)]}"/> |
|||
<field name="company_email" |
|||
attrs="{'invisible':[('is_company','=',False)]}"/> |
|||
<field name="company_type" |
|||
attrs="{'invisible':[('is_company','=',False)]}"/> |
|||
<field name="company_register_number" |
|||
attrs="{'invisible':[('is_company','=',False)]}"/> |
|||
<field name="name"/> |
|||
<field name="firstname"/> |
|||
<field name="lastname"/> |
|||
<field name="birthdate"/> |
|||
<field name="gender"/> |
|||
<field name="email"/> |
|||
<field name="phone"/> |
|||
<field name="contact_person_function" |
|||
attrs="{'invisible':[('is_company','=',False)]}"/> |
|||
<!-- todo highlight iban if not valid --> |
|||
<field name="iban"/> |
|||
<field name="address"/> |
|||
<field name="zip_code"/> |
|||
<field name="city"/> |
|||
<field name="country_id" |
|||
options="{'no_create':True}"/> |
|||
</group> |
|||
<group> |
|||
<field name="capital_release_request_date" |
|||
groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
<field name="date"/> |
|||
<field name="source"/> |
|||
<field name="ordered_parts"/> |
|||
<field name="share_product_id" widget="selection"/> |
|||
<field name="share_short_name"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="subscription_amount"/> |
|||
<field name="partner_id" |
|||
options="{'no_create':True}"/> |
|||
<field name="type"/> |
|||
<field name="lang"/> |
|||
<field name="skip_control_ng"/> |
|||
<field name="data_policy_approved"/> |
|||
</group> |
|||
</group> |
|||
<notebook> |
|||
<page name="capital_release_request" |
|||
string="Capital release request"> |
|||
<field name="capital_release_request"> |
|||
<tree options="{'no_create':True}"> |
|||
<field string="Cooperator" |
|||
name="partner_id"/> |
|||
<field name="date_invoice"/> |
|||
<field name="number"/> |
|||
<field string="Reference" name="reference"/> |
|||
<field name="date_due"/> |
|||
<field name="amount_total_signed"/> |
|||
<field name="residual_signed"/> |
|||
<field name="state"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
</notebook> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_subscription_request_filter" model="ir.ui.view"> |
|||
<field name="name">Cooperator Subscription Search</field> |
|||
<field name="model">subscription.request</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search Subscription Request"> |
|||
<field name="name"/> |
|||
<field name="partner_id"/> |
|||
<separator/> |
|||
<filter string="Draft" name="state_draft" |
|||
domain="[('state','=','draft')]"/> |
|||
<filter string="Paid" name="state_paid" |
|||
domain="[('state','=','paid')]"/> |
|||
<filter string="Done" name="state_done" |
|||
domain="[('state','=','done')]"/> |
|||
<separator/> |
|||
<filter string="Not Validated" name="Not Validated" |
|||
domain="[('validated', '=', False)]"/> |
|||
<group expand="0" name="group_by" string="Group By"> |
|||
<filter name="request_type" string="Request type" |
|||
context="{'group_by' : 'type'}"/> |
|||
<filter name="date" string="Request Date" |
|||
context="{'group_by': 'date'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="subscription_request_action" model="ir.actions.act_window"> |
|||
<field name="name">Subscriptions</field> |
|||
<field name="res_model">subscription.request</field> |
|||
<field name="view_type">form</field> |
|||
<field name="domain">[('is_operation','=',False)]</field> |
|||
<field name="context">{'default_source':'manual'}</field> |
|||
<field name="view_id" ref="subscription_request_tree"/> |
|||
<field name="search_view_id" ref="view_subscription_request_filter"/> |
|||
</record> |
|||
|
|||
<record id="share_line_form" model="ir.ui.view"> |
|||
<field name="name">share.line.form</field> |
|||
<field name="model">share.line</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Share line"> |
|||
<header> |
|||
<button string="Update info" |
|||
name="%(action_view_update_share_line_info)d" |
|||
type="action" |
|||
context="{'default_active_id': active_id}" |
|||
groups="easy_my_coop.group_easy_my_coop_manager"/> |
|||
</header> |
|||
<sheet> |
|||
<group> |
|||
<group> |
|||
<field name="partner_id"/> |
|||
<field name="share_product_id"/> |
|||
<field name="share_number"/> |
|||
</group> |
|||
<group> |
|||
<field name="share_short_name"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="effective_date"/> |
|||
<field name="total_amount_line"/> |
|||
</group> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="share_line_tree" model="ir.ui.view"> |
|||
<field name="name">share.line.tree</field> |
|||
<field name="model">share.line</field> |
|||
<field name="arch" type="xml"> |
|||
<tree> |
|||
<field name="partner_id"/> |
|||
<field name="share_product_id"/> |
|||
<field name="share_number"/> |
|||
<field name="share_short_name"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="effective_date"/> |
|||
<field name="total_amount_line"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_share_line_filter" model="ir.ui.view"> |
|||
<field name="name">Share Line Search</field> |
|||
<field name="model">share.line</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search Share Line"> |
|||
<field name="partner_id"/> |
|||
<field name="effective_date"/> |
|||
<separator/> |
|||
<group name="group_by" string="Group By"> |
|||
<filter name="cooperator" string="Cooperator" |
|||
context="{'group_by' : 'partner_id'}"/> |
|||
<filter name="effective_date" string="Effective date" |
|||
context="{'group_by': 'effective_date'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="share_line_action" model="ir.actions.act_window"> |
|||
<field name="name">Share Lines</field> |
|||
<field name="res_model">share.line</field> |
|||
<field name="view_type">form</field> |
|||
</record> |
|||
|
|||
</odoo> |
@ -1,41 +1,48 @@ |
|||
<?xml version="1.0" ?> |
|||
<openerp> |
|||
<data> |
|||
<record id="view_cooperative_history_wizard" model="ir.ui.view"> |
|||
<field name="name">cooperative.history.wizard.form</field> |
|||
<field name="model">cooperative.history.report</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Reporting" version="7.0"> |
|||
<separator string="Cooperative History"/> |
|||
<group> |
|||
<field name="report"/> |
|||
</group> |
|||
<label string="This report allows you to print a pdf of history and number of share for each cooperator"/> |
|||
<group> |
|||
<field name="display_cooperator"/> |
|||
</group> |
|||
|
|||
<footer> |
|||
<button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight"/> |
|||
or |
|||
<button string="Cancel" class="oe_link" special="cancel" /> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
<odoo> |
|||
<!-- <data>--> |
|||
<!-- <record id="view_cooperative_history_wizard" model="ir.ui.view">--> |
|||
<!-- <field name="name">cooperative.history.wizard.form</field>--> |
|||
<!-- <field name="model">cooperative.history.report</field>--> |
|||
<!-- <field name="arch" type="xml">--> |
|||
<!-- <form string="Reporting" version="7.0">--> |
|||
<!-- <separator string="Cooperative History"/>--> |
|||
<!-- <group>--> |
|||
<!-- <field name="report"/>--> |
|||
<!-- </group>--> |
|||
<!-- <label string="This report allows you to print a pdf of history and number of share for each cooperator"/>--> |
|||
<!-- <group>--> |
|||
<!-- <field name="display_cooperator"/>--> |
|||
<!-- </group>--> |
|||
|
|||
<record id="action_cooperative_history_wizard" model="ir.actions.act_window"> |
|||
<field name="name">Cooperative history</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">cooperative.history.report</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">form</field> |
|||
<field name="view_id" ref="view_cooperative_history_wizard"/> |
|||
<field name="target">new</field> |
|||
<field name="multi">True</field> |
|||
</record> |
|||
<!-- <footer>--> |
|||
<!-- <button name="check_report" string="Print" type="object"--> |
|||
<!-- default_focus="1" class="oe_highlight"/>--> |
|||
<!-- or--> |
|||
<!-- <button string="Cancel" class="oe_link"--> |
|||
<!-- special="cancel"/>--> |
|||
<!-- </footer>--> |
|||
<!-- </form>--> |
|||
<!-- </field>--> |
|||
<!-- </record>--> |
|||
|
|||
<menuitem id="menu_easy_my_coop_reporting" name="Reporting" parent="menu_main_easy_my_coop" sequence="20"/> |
|||
<menuitem id="menu_coop_history_wizard_report" name="Cooperative history report" parent="menu_easy_my_coop_reporting" action="action_cooperative_history_wizard" sequence="10"/> |
|||
</data> |
|||
</openerp> |
|||
<!-- <record id="action_cooperative_history_wizard"--> |
|||
<!-- model="ir.actions.act_window">--> |
|||
<!-- <field name="name">Cooperative history</field>--> |
|||
<!-- <field name="type">ir.actions.act_window</field>--> |
|||
<!-- <field name="res_model">cooperative.history.report</field>--> |
|||
<!-- <field name="view_type">form</field>--> |
|||
<!-- <field name="view_mode">form</field>--> |
|||
<!-- <field name="view_id" ref="view_cooperative_history_wizard"/>--> |
|||
<!-- <field name="target">new</field>--> |
|||
<!-- <field name="multi">True</field>--> |
|||
<!-- </record>--> |
|||
|
|||
<!-- <menuitem id="menu_easy_my_coop_reporting" name="Reporting"--> |
|||
<!-- parent="menu_main_easy_my_coop" sequence="20"/>--> |
|||
<!-- <menuitem id="menu_coop_history_wizard_report"--> |
|||
<!-- name="Cooperative history report"--> |
|||
<!-- parent="menu_easy_my_coop_reporting"--> |
|||
<!-- action="action_cooperative_history_wizard" sequence="10"/>--> |
|||
<!-- </data>--> |
|||
</odoo> |
@ -1,36 +1,40 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<record id="view_update_share_line_info" model="ir.ui.view"> |
|||
<field name="name">Update Share line Info</field> |
|||
<field name="model">share.line.update.info</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Update Share Line Info"> |
|||
<p class="oe_grey"> |
|||
Update Share Line Info. |
|||
</p> |
|||
<group> |
|||
<field name="cooperator" readonly="True"/> |
|||
<field name="share_line" readonly="True"/> |
|||
<field name="effective_date"/> |
|||
</group> |
|||
<footer> |
|||
<button name="update" string="Update Info" type="object" class="btn-primary"/> |
|||
<button string="Cancel" class="btn-default" special="cancel"/> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_view_update_share_line_info" model="ir.actions.act_window"> |
|||
<field name="name">Update Share Line Info</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">share.line.update.info</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">form</field> |
|||
<field name="target">new</field> |
|||
<field name="groups_id" eval="[(4,ref('easy_my_coop.group_easy_my_coop_manager'))]"/> |
|||
</record> |
|||
|
|||
</data> |
|||
</odoo> |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<record id="view_update_share_line_info" model="ir.ui.view"> |
|||
<field name="name">Update Share line Info</field> |
|||
<field name="model">share.line.update.info</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Update Share Line Info"> |
|||
<p class="oe_grey"> |
|||
Update Share Line Info. |
|||
</p> |
|||
<group> |
|||
<field name="cooperator" readonly="True"/> |
|||
<field name="share_line" readonly="True"/> |
|||
<field name="effective_date"/> |
|||
</group> |
|||
<footer> |
|||
<button name="update" string="Update Info" type="object" |
|||
class="btn-primary"/> |
|||
<button string="Cancel" class="btn-default" |
|||
special="cancel"/> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_view_update_share_line_info" |
|||
model="ir.actions.act_window"> |
|||
<field name="name">Update Share Line Info</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">share.line.update.info</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">form</field> |
|||
<field name="target">new</field> |
|||
<field name="groups_id" |
|||
eval="[(4,ref('easy_my_coop.group_easy_my_coop_manager'))]"/> |
|||
</record> |
|||
|
|||
</data> |
|||
</odoo> |
@ -0,0 +1,58 @@ |
|||
==================== |
|||
Easy My Coop Belgium |
|||
==================== |
|||
|
|||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
!! This file is generated by oca-gen-addon-readme !! |
|||
!! changes will be overwritten. !! |
|||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
|
|||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
|||
:target: https://odoo-community.org/page/development-status |
|||
:alt: Beta |
|||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png |
|||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
.. |badge3| image:: https://img.shields.io/badge/github-coopiteasy%2Fvertical--cooperative-lightgray.png?logo=github |
|||
:target: https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_be |
|||
:alt: coopiteasy/vertical-cooperative |
|||
|
|||
|badge1| |badge2| |badge3| |
|||
|
|||
This is the belgian localization for the easy my coop module. |
|||
|
|||
**Table of contents** |
|||
|
|||
.. contents:: |
|||
:local: |
|||
|
|||
Bug Tracker |
|||
=========== |
|||
|
|||
Bugs are tracked on `GitHub Issues <https://github.com/coopiteasy/vertical-cooperative/issues>`_. |
|||
In case of trouble, please check there if your issue has already been reported. |
|||
If you spotted it first, help us smashing it by providing a detailed and welcomed |
|||
`feedback <https://github.com/coopiteasy/vertical-cooperative/issues/new?body=module:%20easy_my_coop_be%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
|||
|
|||
Do not contact contributors directly about support or help with technical issues. |
|||
|
|||
Credits |
|||
======= |
|||
|
|||
Authors |
|||
~~~~~~~ |
|||
|
|||
* Coop IT Easy SCRLfs |
|||
|
|||
Contributors |
|||
~~~~~~~~~~~~ |
|||
|
|||
* Coop IT Easy SCRLfs |
|||
|
|||
|
|||
Maintainers |
|||
~~~~~~~~~~~ |
|||
|
|||
This module is part of the `coopiteasy/vertical-cooperative <https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_be>`_ project on GitHub. |
|||
|
|||
You are welcome to contribute. |
@ -1 +1 @@ |
|||
from . import models |
|||
from . import models |
@ -1,2 +1,2 @@ |
|||
from . import coop |
|||
from . import partner |
|||
from . import coop |
|||
from . import partner |
@ -1,27 +1,26 @@ |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class SubscriptionRequest(models.Model): |
|||
_inherit = 'subscription.request' |
|||
|
|||
company_type = fields.Selection([('scrl', 'SCRL'), |
|||
('asbl', 'ASBL'), |
|||
('sprl', 'SPRL'), |
|||
('sa', 'SA')]) |
|||
|
|||
def get_partner_company_vals(self): |
|||
vals = super(SubscriptionRequest, self).get_partner_company_vals() |
|||
vals['out_inv_comm_algorithm'] = 'random' |
|||
return vals |
|||
|
|||
def get_partner_vals(self): |
|||
vals = super(SubscriptionRequest, self).get_partner_vals() |
|||
vals['out_inv_comm_type'] = 'bba' |
|||
vals['out_inv_comm_algorithm'] = 'random' |
|||
return vals |
|||
|
|||
def get_representative_valst(self): |
|||
vals = super(SubscriptionRequest, self).get_representative_vals() |
|||
vals['out_inv_comm_type'] = 'bba' |
|||
vals['out_inv_comm_algorithm'] = 'random' |
|||
return vals |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class SubscriptionRequest(models.Model): |
|||
_inherit = "subscription.request" |
|||
|
|||
company_type = fields.Selection( |
|||
[("scrl", "SCRL"), ("asbl", "ASBL"), ("sprl", "SPRL"), ("sa", "SA")] |
|||
) |
|||
|
|||
def get_partner_company_vals(self): |
|||
vals = super(SubscriptionRequest, self).get_partner_company_vals() |
|||
vals["out_inv_comm_algorithm"] = "random" |
|||
return vals |
|||
|
|||
def get_partner_vals(self): |
|||
vals = super(SubscriptionRequest, self).get_partner_vals() |
|||
vals["out_inv_comm_type"] = "bba" |
|||
vals["out_inv_comm_algorithm"] = "random" |
|||
return vals |
|||
|
|||
def get_representative_valst(self): |
|||
vals = super(SubscriptionRequest, self).get_representative_vals() |
|||
vals["out_inv_comm_type"] = "bba" |
|||
vals["out_inv_comm_algorithm"] = "random" |
|||
return vals |
@ -1,10 +1,14 @@ |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ResPartner(models.Model): |
|||
_inherit = 'res.partner' |
|||
|
|||
legal_form = fields.Selection(selection_add=[('scrl', 'SCRL'), |
|||
('asbl', 'ASBL'), |
|||
('sprl', 'SPRL'), |
|||
('sa', 'SA')]) |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ResPartner(models.Model): |
|||
_inherit = "res.partner" |
|||
|
|||
legal_form = fields.Selection( |
|||
selection_add=[ |
|||
("scrl", "SCRL"), |
|||
("asbl", "ASBL"), |
|||
("sprl", "SPRL"), |
|||
("sa", "SA"), |
|||
] |
|||
) |
@ -0,0 +1 @@ |
|||
* Coop IT Easy SCRLfs |
@ -0,0 +1 @@ |
|||
This is the belgian localization for the easy my coop module. |
@ -0,0 +1,414 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" /> |
|||
<title>Easy My Coop Belgium</title> |
|||
<style type="text/css"> |
|||
|
|||
/* |
|||
:Author: David Goodger (goodger@python.org) |
|||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $ |
|||
:Copyright: This stylesheet has been placed in the public domain. |
|||
|
|||
Default cascading style sheet for the HTML output of Docutils. |
|||
|
|||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to |
|||
customize this style sheet. |
|||
*/ |
|||
|
|||
/* used to remove borders from tables and images */ |
|||
.borderless, table.borderless td, table.borderless th { |
|||
border: 0 } |
|||
|
|||
table.borderless td, table.borderless th { |
|||
/* Override padding for "table.docutils td" with "! important". |
|||
The right padding separates the table cells. */ |
|||
padding: 0 0.5em 0 0 ! important } |
|||
|
|||
.first { |
|||
/* Override more specific margin styles with "! important". */ |
|||
margin-top: 0 ! important } |
|||
|
|||
.last, .with-subtitle { |
|||
margin-bottom: 0 ! important } |
|||
|
|||
.hidden { |
|||
display: none } |
|||
|
|||
.subscript { |
|||
vertical-align: sub; |
|||
font-size: smaller } |
|||
|
|||
.superscript { |
|||
vertical-align: super; |
|||
font-size: smaller } |
|||
|
|||
a.toc-backref { |
|||
text-decoration: none ; |
|||
color: black } |
|||
|
|||
blockquote.epigraph { |
|||
margin: 2em 5em ; } |
|||
|
|||
dl.docutils dd { |
|||
margin-bottom: 0.5em } |
|||
|
|||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { |
|||
overflow: hidden; |
|||
} |
|||
|
|||
/* Uncomment (and remove this text!) to get bold-faced definition list terms |
|||
dl.docutils dt { |
|||
font-weight: bold } |
|||
*/ |
|||
|
|||
div.abstract { |
|||
margin: 2em 5em } |
|||
|
|||
div.abstract p.topic-title { |
|||
font-weight: bold ; |
|||
text-align: center } |
|||
|
|||
div.admonition, div.attention, div.caution, div.danger, div.error, |
|||
div.hint, div.important, div.note, div.tip, div.warning { |
|||
margin: 2em ; |
|||
border: medium outset ; |
|||
padding: 1em } |
|||
|
|||
div.admonition p.admonition-title, div.hint p.admonition-title, |
|||
div.important p.admonition-title, div.note p.admonition-title, |
|||
div.tip p.admonition-title { |
|||
font-weight: bold ; |
|||
font-family: sans-serif } |
|||
|
|||
div.attention p.admonition-title, div.caution p.admonition-title, |
|||
div.danger p.admonition-title, div.error p.admonition-title, |
|||
div.warning p.admonition-title, .code .error { |
|||
color: red ; |
|||
font-weight: bold ; |
|||
font-family: sans-serif } |
|||
|
|||
/* Uncomment (and remove this text!) to get reduced vertical space in |
|||
compound paragraphs. |
|||
div.compound .compound-first, div.compound .compound-middle { |
|||
margin-bottom: 0.5em } |
|||
|
|||
div.compound .compound-last, div.compound .compound-middle { |
|||
margin-top: 0.5em } |
|||
*/ |
|||
|
|||
div.dedication { |
|||
margin: 2em 5em ; |
|||
text-align: center ; |
|||
font-style: italic } |
|||
|
|||
div.dedication p.topic-title { |
|||
font-weight: bold ; |
|||
font-style: normal } |
|||
|
|||
div.figure { |
|||
margin-left: 2em ; |
|||
margin-right: 2em } |
|||
|
|||
div.footer, div.header { |
|||
clear: both; |
|||
font-size: smaller } |
|||
|
|||
div.line-block { |
|||
display: block ; |
|||
margin-top: 1em ; |
|||
margin-bottom: 1em } |
|||
|
|||
div.line-block div.line-block { |
|||
margin-top: 0 ; |
|||
margin-bottom: 0 ; |
|||
margin-left: 1.5em } |
|||
|
|||
div.sidebar { |
|||
margin: 0 0 0.5em 1em ; |
|||
border: medium outset ; |
|||
padding: 1em ; |
|||
background-color: #ffffee ; |
|||
width: 40% ; |
|||
float: right ; |
|||
clear: right } |
|||
|
|||
div.sidebar p.rubric { |
|||
font-family: sans-serif ; |
|||
font-size: medium } |
|||
|
|||
div.system-messages { |
|||
margin: 5em } |
|||
|
|||
div.system-messages h1 { |
|||
color: red } |
|||
|
|||
div.system-message { |
|||
border: medium outset ; |
|||
padding: 1em } |
|||
|
|||
div.system-message p.system-message-title { |
|||
color: red ; |
|||
font-weight: bold } |
|||
|
|||
div.topic { |
|||
margin: 2em } |
|||
|
|||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, |
|||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { |
|||
margin-top: 0.4em } |
|||
|
|||
h1.title { |
|||
text-align: center } |
|||
|
|||
h2.subtitle { |
|||
text-align: center } |
|||
|
|||
hr.docutils { |
|||
width: 75% } |
|||
|
|||
img.align-left, .figure.align-left, object.align-left, table.align-left { |
|||
clear: left ; |
|||
float: left ; |
|||
margin-right: 1em } |
|||
|
|||
img.align-right, .figure.align-right, object.align-right, table.align-right { |
|||
clear: right ; |
|||
float: right ; |
|||
margin-left: 1em } |
|||
|
|||
img.align-center, .figure.align-center, object.align-center { |
|||
display: block; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
table.align-center { |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
.align-left { |
|||
text-align: left } |
|||
|
|||
.align-center { |
|||
clear: both ; |
|||
text-align: center } |
|||
|
|||
.align-right { |
|||
text-align: right } |
|||
|
|||
/* reset inner alignment in figures */ |
|||
div.align-right { |
|||
text-align: inherit } |
|||
|
|||
/* div.align-center * { */ |
|||
/* text-align: left } */ |
|||
|
|||
.align-top { |
|||
vertical-align: top } |
|||
|
|||
.align-middle { |
|||
vertical-align: middle } |
|||
|
|||
.align-bottom { |
|||
vertical-align: bottom } |
|||
|
|||
ol.simple, ul.simple { |
|||
margin-bottom: 1em } |
|||
|
|||
ol.arabic { |
|||
list-style: decimal } |
|||
|
|||
ol.loweralpha { |
|||
list-style: lower-alpha } |
|||
|
|||
ol.upperalpha { |
|||
list-style: upper-alpha } |
|||
|
|||
ol.lowerroman { |
|||
list-style: lower-roman } |
|||
|
|||
ol.upperroman { |
|||
list-style: upper-roman } |
|||
|
|||
p.attribution { |
|||
text-align: right ; |
|||
margin-left: 50% } |
|||
|
|||
p.caption { |
|||
font-style: italic } |
|||
|
|||
p.credits { |
|||
font-style: italic ; |
|||
font-size: smaller } |
|||
|
|||
p.label { |
|||
white-space: nowrap } |
|||
|
|||
p.rubric { |
|||
font-weight: bold ; |
|||
font-size: larger ; |
|||
color: maroon ; |
|||
text-align: center } |
|||
|
|||
p.sidebar-title { |
|||
font-family: sans-serif ; |
|||
font-weight: bold ; |
|||
font-size: larger } |
|||
|
|||
p.sidebar-subtitle { |
|||
font-family: sans-serif ; |
|||
font-weight: bold } |
|||
|
|||
p.topic-title { |
|||
font-weight: bold } |
|||
|
|||
pre.address { |
|||
margin-bottom: 0 ; |
|||
margin-top: 0 ; |
|||
font: inherit } |
|||
|
|||
pre.literal-block, pre.doctest-block, pre.math, pre.code { |
|||
margin-left: 2em ; |
|||
margin-right: 2em } |
|||
|
|||
pre.code .ln { color: grey; } /* line numbers */ |
|||
pre.code, code { background-color: #eeeeee } |
|||
pre.code .comment, code .comment { color: #5C6576 } |
|||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } |
|||
pre.code .literal.string, code .literal.string { color: #0C5404 } |
|||
pre.code .name.builtin, code .name.builtin { color: #352B84 } |
|||
pre.code .deleted, code .deleted { background-color: #DEB0A1} |
|||
pre.code .inserted, code .inserted { background-color: #A3D289} |
|||
|
|||
span.classifier { |
|||
font-family: sans-serif ; |
|||
font-style: oblique } |
|||
|
|||
span.classifier-delimiter { |
|||
font-family: sans-serif ; |
|||
font-weight: bold } |
|||
|
|||
span.interpreted { |
|||
font-family: sans-serif } |
|||
|
|||
span.option { |
|||
white-space: nowrap } |
|||
|
|||
span.pre { |
|||
white-space: pre } |
|||
|
|||
span.problematic { |
|||
color: red } |
|||
|
|||
span.section-subtitle { |
|||
/* font-size relative to parent (h1..h6 element) */ |
|||
font-size: 80% } |
|||
|
|||
table.citation { |
|||
border-left: solid 1px gray; |
|||
margin-left: 1px } |
|||
|
|||
table.docinfo { |
|||
margin: 2em 4em } |
|||
|
|||
table.docutils { |
|||
margin-top: 0.5em ; |
|||
margin-bottom: 0.5em } |
|||
|
|||
table.footnote { |
|||
border-left: solid 1px black; |
|||
margin-left: 1px } |
|||
|
|||
table.docutils td, table.docutils th, |
|||
table.docinfo td, table.docinfo th { |
|||
padding-left: 0.5em ; |
|||
padding-right: 0.5em ; |
|||
vertical-align: top } |
|||
|
|||
table.docutils th.field-name, table.docinfo th.docinfo-name { |
|||
font-weight: bold ; |
|||
text-align: left ; |
|||
white-space: nowrap ; |
|||
padding-left: 0 } |
|||
|
|||
/* "booktabs" style (no vertical lines) */ |
|||
table.docutils.booktabs { |
|||
border: 0px; |
|||
border-top: 2px solid; |
|||
border-bottom: 2px solid; |
|||
border-collapse: collapse; |
|||
} |
|||
table.docutils.booktabs * { |
|||
border: 0px; |
|||
} |
|||
table.docutils.booktabs th { |
|||
border-bottom: thin solid; |
|||
text-align: left; |
|||
} |
|||
|
|||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, |
|||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { |
|||
font-size: 100% } |
|||
|
|||
ul.auto-toc { |
|||
list-style-type: none } |
|||
|
|||
</style> |
|||
</head> |
|||
<body> |
|||
<div class="document" id="easy-my-coop-belgium"> |
|||
<h1 class="title">Easy My Coop Belgium</h1> |
|||
|
|||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
!! This file is generated by oca-gen-addon-readme !! |
|||
!! changes will be overwritten. !! |
|||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> |
|||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_be"><img alt="coopiteasy/vertical-cooperative" src="https://img.shields.io/badge/github-coopiteasy%2Fvertical--cooperative-lightgray.png?logo=github" /></a></p> |
|||
<p>This is the belgian localization for the easy my coop module.</p> |
|||
<p><strong>Table of contents</strong></p> |
|||
<div class="contents local topic" id="contents"> |
|||
<ul class="simple"> |
|||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li> |
|||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul> |
|||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li> |
|||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li> |
|||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li> |
|||
</ul> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="bug-tracker"> |
|||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1> |
|||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/issues">GitHub Issues</a>. |
|||
In case of trouble, please check there if your issue has already been reported. |
|||
If you spotted it first, help us smashing it by providing a detailed and welcomed |
|||
<a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/issues/new?body=module:%20easy_my_coop_be%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> |
|||
<p>Do not contact contributors directly about support or help with technical issues.</p> |
|||
</div> |
|||
<div class="section" id="credits"> |
|||
<h1><a class="toc-backref" href="#id2">Credits</a></h1> |
|||
<div class="section" id="authors"> |
|||
<h2><a class="toc-backref" href="#id3">Authors</a></h2> |
|||
<ul class="simple"> |
|||
<li>Coop IT Easy SCRLfs</li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="contributors"> |
|||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2> |
|||
<ul class="simple"> |
|||
<li>Coop IT Easy SCRLfs</li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="maintainers"> |
|||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2> |
|||
<p>This module is part of the <a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_be">coopiteasy/vertical-cooperative</a> project on GitHub.</p> |
|||
<p>You are welcome to contribute.</p> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</body> |
|||
</html> |
@ -0,0 +1,55 @@ |
|||
======================== |
|||
Easy My Coop Switzerland |
|||
======================== |
|||
|
|||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
!! This file is generated by oca-gen-addon-readme !! |
|||
!! changes will be overwritten. !! |
|||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
|
|||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
|||
:target: https://odoo-community.org/page/development-status |
|||
:alt: Beta |
|||
.. |badge2| image:: https://img.shields.io/badge/github-coopiteasy%2Fvertical--cooperative-lightgray.png?logo=github |
|||
:target: https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_ch |
|||
:alt: coopiteasy/vertical-cooperative |
|||
|
|||
|badge1| |badge2| |
|||
|
|||
This is the swiss localization for the easy my coop module |
|||
|
|||
**Table of contents** |
|||
|
|||
.. contents:: |
|||
:local: |
|||
|
|||
Bug Tracker |
|||
=========== |
|||
|
|||
Bugs are tracked on `GitHub Issues <https://github.com/coopiteasy/vertical-cooperative/issues>`_. |
|||
In case of trouble, please check there if your issue has already been reported. |
|||
If you spotted it first, help us smashing it by providing a detailed and welcomed |
|||
`feedback <https://github.com/coopiteasy/vertical-cooperative/issues/new?body=module:%20easy_my_coop_ch%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
|||
|
|||
Do not contact contributors directly about support or help with technical issues. |
|||
|
|||
Credits |
|||
======= |
|||
|
|||
Authors |
|||
~~~~~~~ |
|||
|
|||
* Houssine BAKKALI <houssine@coopiteasy.be> |
|||
|
|||
Contributors |
|||
~~~~~~~~~~~~ |
|||
|
|||
* Coop IT Easy SCRLfs |
|||
|
|||
|
|||
Maintainers |
|||
~~~~~~~~~~~ |
|||
|
|||
This module is part of the `coopiteasy/vertical-cooperative <https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_ch>`_ project on GitHub. |
|||
|
|||
You are welcome to contribute. |
@ -1 +1 @@ |
|||
from . import models |
|||
from . import models |
@ -1,37 +1,19 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Copyright (C) 2013-2017 Open Architects Consulting SPRL. |
|||
# Copyright (C) 2018- Coop IT Easy SCRLfs. |
|||
# |
|||
# This program is free software: you can redistribute it and/or modify |
|||
# it under the terms of the GNU Affero General Public License as |
|||
# published by the Free Software Foundation, either version 3 of the |
|||
# License, or (at your option) any later version. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU Affero General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU Affero General Public License |
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
# Copyright 2013-2018 Open Architects Consulting SPRL. |
|||
# Copyright 2018 Coop IT Easy SCRLfs (<http://www.coopiteasy.be>) |
|||
# - Houssine BAKKALI - <houssine@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
{ |
|||
"name": "Easy My Coop CH", |
|||
"name": "Easy My Coop Switzerland", |
|||
"summary": "Easy My Coop Switzerland localization", |
|||
"version": "12.0.1.0.2", |
|||
"depends": ["easy_my_coop", |
|||
"l10n_ch"], |
|||
"author": "Houssine BAKKALI <houssine@coopiteasy.be>", |
|||
"license": "AGPL-3", |
|||
"depends": ["easy_my_coop", "easy_my_coop_website", "l10n_ch"], |
|||
"author": "Coop IT Easy SCRLfs", |
|||
"category": "Cooperative management", |
|||
'webstite': "www.coopiteasy.be", |
|||
"description": """ |
|||
This is the swiss localization for the easy my coop module |
|||
""", |
|||
'data': [ |
|||
'views/subscription_template.xml', |
|||
'views/subscription_request_view.xml' |
|||
"webstite": "www.coopiteasy.be", |
|||
"data": [ |
|||
"views/subscription_template.xml", |
|||
# "views/subscription_request_view.xml", |
|||
], |
|||
'installable': True, |
|||
"installable": True, |
|||
} |
@ -1,2 +1,2 @@ |
|||
from . import coop |
|||
from . import partner |
|||
from . import coop |
|||
from . import partner |
@ -1,22 +1,25 @@ |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class SubscriptionRequest(models.Model): |
|||
_inherit = 'subscription.request' |
|||
|
|||
company_type = fields.Selection(selection_add=[ |
|||
('ei', 'Individual company'), |
|||
('snc', 'Partnership'), |
|||
('sa', 'Limited company (SA)'), |
|||
('sarl', 'Limited liability company (Ltd)'), #noqa |
|||
('sc', 'Cooperative'), |
|||
('asso', 'Association'), |
|||
('fond', 'Foundation'), |
|||
('edp', 'Company under public law')]) |
|||
|
|||
def get_required_field(self): |
|||
req_fields = super(SubscriptionRequest, self).get_required_field() |
|||
if 'iban' in req_fields: |
|||
req_fields.remove('iban') |
|||
|
|||
return req_fields |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class SubscriptionRequest(models.Model): |
|||
_inherit = "subscription.request" |
|||
|
|||
company_type = fields.Selection( |
|||
selection_add=[ |
|||
("ei", "Individual company"), |
|||
("snc", "Partnership"), |
|||
("sa", "Limited company (SA)"), |
|||
("sarl", "Limited liability company (Ltd)"), # noqa |
|||
("sc", "Cooperative"), |
|||
("asso", "Association"), |
|||
("fond", "Foundation"), |
|||
("edp", "Company under public law"), |
|||
] |
|||
) |
|||
|
|||
def get_required_field(self): |
|||
req_fields = super(SubscriptionRequest, self).get_required_field() |
|||
if "iban" in req_fields: |
|||
req_fields.remove("iban") |
|||
|
|||
return req_fields |
@ -1,16 +1,18 @@ |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ResPartner(models.Model): |
|||
_inherit = 'res.partner' |
|||
|
|||
legal_form = fields.Selection(selection_add=[ |
|||
('ei', 'Individual company'), |
|||
('snc', 'Partnership'), |
|||
('sa', 'Limited company (SA)'), |
|||
('sarl', 'Limited liability company (Ltd)'), |
|||
('sc', 'Cooperative'), |
|||
('asso', 'Association'), |
|||
('fond', 'Foundation'), |
|||
('edp', 'Company under public law') |
|||
]) |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ResPartner(models.Model): |
|||
_inherit = "res.partner" |
|||
|
|||
legal_form = fields.Selection( |
|||
selection_add=[ |
|||
("ei", "Individual company"), |
|||
("snc", "Partnership"), |
|||
("sa", "Limited company (SA)"), |
|||
("sarl", "Limited liability company (Ltd)"), |
|||
("sc", "Cooperative"), |
|||
("asso", "Association"), |
|||
("fond", "Foundation"), |
|||
("edp", "Company under public law"), |
|||
] |
|||
) |
@ -0,0 +1,2 @@ |
|||
* Coop IT Easy SCRLfs |
|||
* Houssine BAKKALI <houssine@coopiteasy.be> |
@ -0,0 +1 @@ |
|||
This is the swiss localization for the easy my coop module |
@ -0,0 +1,414 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" /> |
|||
<title>Easy My Coop Switzerland</title> |
|||
<style type="text/css"> |
|||
|
|||
/* |
|||
:Author: David Goodger (goodger@python.org) |
|||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $ |
|||
:Copyright: This stylesheet has been placed in the public domain. |
|||
|
|||
Default cascading style sheet for the HTML output of Docutils. |
|||
|
|||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to |
|||
customize this style sheet. |
|||
*/ |
|||
|
|||
/* used to remove borders from tables and images */ |
|||
.borderless, table.borderless td, table.borderless th { |
|||
border: 0 } |
|||
|
|||
table.borderless td, table.borderless th { |
|||
/* Override padding for "table.docutils td" with "! important". |
|||
The right padding separates the table cells. */ |
|||
padding: 0 0.5em 0 0 ! important } |
|||
|
|||
.first { |
|||
/* Override more specific margin styles with "! important". */ |
|||
margin-top: 0 ! important } |
|||
|
|||
.last, .with-subtitle { |
|||
margin-bottom: 0 ! important } |
|||
|
|||
.hidden { |
|||
display: none } |
|||
|
|||
.subscript { |
|||
vertical-align: sub; |
|||
font-size: smaller } |
|||
|
|||
.superscript { |
|||
vertical-align: super; |
|||
font-size: smaller } |
|||
|
|||
a.toc-backref { |
|||
text-decoration: none ; |
|||
color: black } |
|||
|
|||
blockquote.epigraph { |
|||
margin: 2em 5em ; } |
|||
|
|||
dl.docutils dd { |
|||
margin-bottom: 0.5em } |
|||
|
|||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { |
|||
overflow: hidden; |
|||
} |
|||
|
|||
/* Uncomment (and remove this text!) to get bold-faced definition list terms |
|||
dl.docutils dt { |
|||
font-weight: bold } |
|||
*/ |
|||
|
|||
div.abstract { |
|||
margin: 2em 5em } |
|||
|
|||
div.abstract p.topic-title { |
|||
font-weight: bold ; |
|||
text-align: center } |
|||
|
|||
div.admonition, div.attention, div.caution, div.danger, div.error, |
|||
div.hint, div.important, div.note, div.tip, div.warning { |
|||
margin: 2em ; |
|||
border: medium outset ; |
|||
padding: 1em } |
|||
|
|||
div.admonition p.admonition-title, div.hint p.admonition-title, |
|||
div.important p.admonition-title, div.note p.admonition-title, |
|||
div.tip p.admonition-title { |
|||
font-weight: bold ; |
|||
font-family: sans-serif } |
|||
|
|||
div.attention p.admonition-title, div.caution p.admonition-title, |
|||
div.danger p.admonition-title, div.error p.admonition-title, |
|||
div.warning p.admonition-title, .code .error { |
|||
color: red ; |
|||
font-weight: bold ; |
|||
font-family: sans-serif } |
|||
|
|||
/* Uncomment (and remove this text!) to get reduced vertical space in |
|||
compound paragraphs. |
|||
div.compound .compound-first, div.compound .compound-middle { |
|||
margin-bottom: 0.5em } |
|||
|
|||
div.compound .compound-last, div.compound .compound-middle { |
|||
margin-top: 0.5em } |
|||
*/ |
|||
|
|||
div.dedication { |
|||
margin: 2em 5em ; |
|||
text-align: center ; |
|||
font-style: italic } |
|||
|
|||
div.dedication p.topic-title { |
|||
font-weight: bold ; |
|||
font-style: normal } |
|||
|
|||
div.figure { |
|||
margin-left: 2em ; |
|||
margin-right: 2em } |
|||
|
|||
div.footer, div.header { |
|||
clear: both; |
|||
font-size: smaller } |
|||
|
|||
div.line-block { |
|||
display: block ; |
|||
margin-top: 1em ; |
|||
margin-bottom: 1em } |
|||
|
|||
div.line-block div.line-block { |
|||
margin-top: 0 ; |
|||
margin-bottom: 0 ; |
|||
margin-left: 1.5em } |
|||
|
|||
div.sidebar { |
|||
margin: 0 0 0.5em 1em ; |
|||
border: medium outset ; |
|||
padding: 1em ; |
|||
background-color: #ffffee ; |
|||
width: 40% ; |
|||
float: right ; |
|||
clear: right } |
|||
|
|||
div.sidebar p.rubric { |
|||
font-family: sans-serif ; |
|||
font-size: medium } |
|||
|
|||
div.system-messages { |
|||
margin: 5em } |
|||
|
|||
div.system-messages h1 { |
|||
color: red } |
|||
|
|||
div.system-message { |
|||
border: medium outset ; |
|||
padding: 1em } |
|||
|
|||
div.system-message p.system-message-title { |
|||
color: red ; |
|||
font-weight: bold } |
|||
|
|||
div.topic { |
|||
margin: 2em } |
|||
|
|||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, |
|||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { |
|||
margin-top: 0.4em } |
|||
|
|||
h1.title { |
|||
text-align: center } |
|||
|
|||
h2.subtitle { |
|||
text-align: center } |
|||
|
|||
hr.docutils { |
|||
width: 75% } |
|||
|
|||
img.align-left, .figure.align-left, object.align-left, table.align-left { |
|||
clear: left ; |
|||
float: left ; |
|||
margin-right: 1em } |
|||
|
|||
img.align-right, .figure.align-right, object.align-right, table.align-right { |
|||
clear: right ; |
|||
float: right ; |
|||
margin-left: 1em } |
|||
|
|||
img.align-center, .figure.align-center, object.align-center { |
|||
display: block; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
table.align-center { |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
.align-left { |
|||
text-align: left } |
|||
|
|||
.align-center { |
|||
clear: both ; |
|||
text-align: center } |
|||
|
|||
.align-right { |
|||
text-align: right } |
|||
|
|||
/* reset inner alignment in figures */ |
|||
div.align-right { |
|||
text-align: inherit } |
|||
|
|||
/* div.align-center * { */ |
|||
/* text-align: left } */ |
|||
|
|||
.align-top { |
|||
vertical-align: top } |
|||
|
|||
.align-middle { |
|||
vertical-align: middle } |
|||
|
|||
.align-bottom { |
|||
vertical-align: bottom } |
|||
|
|||
ol.simple, ul.simple { |
|||
margin-bottom: 1em } |
|||
|
|||
ol.arabic { |
|||
list-style: decimal } |
|||
|
|||
ol.loweralpha { |
|||
list-style: lower-alpha } |
|||
|
|||
ol.upperalpha { |
|||
list-style: upper-alpha } |
|||
|
|||
ol.lowerroman { |
|||
list-style: lower-roman } |
|||
|
|||
ol.upperroman { |
|||
list-style: upper-roman } |
|||
|
|||
p.attribution { |
|||
text-align: right ; |
|||
margin-left: 50% } |
|||
|
|||
p.caption { |
|||
font-style: italic } |
|||
|
|||
p.credits { |
|||
font-style: italic ; |
|||
font-size: smaller } |
|||
|
|||
p.label { |
|||
white-space: nowrap } |
|||
|
|||
p.rubric { |
|||
font-weight: bold ; |
|||
font-size: larger ; |
|||
color: maroon ; |
|||
text-align: center } |
|||
|
|||
p.sidebar-title { |
|||
font-family: sans-serif ; |
|||
font-weight: bold ; |
|||
font-size: larger } |
|||
|
|||
p.sidebar-subtitle { |
|||
font-family: sans-serif ; |
|||
font-weight: bold } |
|||
|
|||
p.topic-title { |
|||
font-weight: bold } |
|||
|
|||
pre.address { |
|||
margin-bottom: 0 ; |
|||
margin-top: 0 ; |
|||
font: inherit } |
|||
|
|||
pre.literal-block, pre.doctest-block, pre.math, pre.code { |
|||
margin-left: 2em ; |
|||
margin-right: 2em } |
|||
|
|||
pre.code .ln { color: grey; } /* line numbers */ |
|||
pre.code, code { background-color: #eeeeee } |
|||
pre.code .comment, code .comment { color: #5C6576 } |
|||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } |
|||
pre.code .literal.string, code .literal.string { color: #0C5404 } |
|||
pre.code .name.builtin, code .name.builtin { color: #352B84 } |
|||
pre.code .deleted, code .deleted { background-color: #DEB0A1} |
|||
pre.code .inserted, code .inserted { background-color: #A3D289} |
|||
|
|||
span.classifier { |
|||
font-family: sans-serif ; |
|||
font-style: oblique } |
|||
|
|||
span.classifier-delimiter { |
|||
font-family: sans-serif ; |
|||
font-weight: bold } |
|||
|
|||
span.interpreted { |
|||
font-family: sans-serif } |
|||
|
|||
span.option { |
|||
white-space: nowrap } |
|||
|
|||
span.pre { |
|||
white-space: pre } |
|||
|
|||
span.problematic { |
|||
color: red } |
|||
|
|||
span.section-subtitle { |
|||
/* font-size relative to parent (h1..h6 element) */ |
|||
font-size: 80% } |
|||
|
|||
table.citation { |
|||
border-left: solid 1px gray; |
|||
margin-left: 1px } |
|||
|
|||
table.docinfo { |
|||
margin: 2em 4em } |
|||
|
|||
table.docutils { |
|||
margin-top: 0.5em ; |
|||
margin-bottom: 0.5em } |
|||
|
|||
table.footnote { |
|||
border-left: solid 1px black; |
|||
margin-left: 1px } |
|||
|
|||
table.docutils td, table.docutils th, |
|||
table.docinfo td, table.docinfo th { |
|||
padding-left: 0.5em ; |
|||
padding-right: 0.5em ; |
|||
vertical-align: top } |
|||
|
|||
table.docutils th.field-name, table.docinfo th.docinfo-name { |
|||
font-weight: bold ; |
|||
text-align: left ; |
|||
white-space: nowrap ; |
|||
padding-left: 0 } |
|||
|
|||
/* "booktabs" style (no vertical lines) */ |
|||
table.docutils.booktabs { |
|||
border: 0px; |
|||
border-top: 2px solid; |
|||
border-bottom: 2px solid; |
|||
border-collapse: collapse; |
|||
} |
|||
table.docutils.booktabs * { |
|||
border: 0px; |
|||
} |
|||
table.docutils.booktabs th { |
|||
border-bottom: thin solid; |
|||
text-align: left; |
|||
} |
|||
|
|||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, |
|||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { |
|||
font-size: 100% } |
|||
|
|||
ul.auto-toc { |
|||
list-style-type: none } |
|||
|
|||
</style> |
|||
</head> |
|||
<body> |
|||
<div class="document" id="easy-my-coop-switzerland"> |
|||
<h1 class="title">Easy My Coop Switzerland</h1> |
|||
|
|||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
!! This file is generated by oca-gen-addon-readme !! |
|||
!! changes will be overwritten. !! |
|||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> |
|||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_ch"><img alt="coopiteasy/vertical-cooperative" src="https://img.shields.io/badge/github-coopiteasy%2Fvertical--cooperative-lightgray.png?logo=github" /></a></p> |
|||
<p>This is the swiss localization for the easy my coop module</p> |
|||
<p><strong>Table of contents</strong></p> |
|||
<div class="contents local topic" id="contents"> |
|||
<ul class="simple"> |
|||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li> |
|||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul> |
|||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li> |
|||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li> |
|||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li> |
|||
</ul> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="bug-tracker"> |
|||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1> |
|||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/issues">GitHub Issues</a>. |
|||
In case of trouble, please check there if your issue has already been reported. |
|||
If you spotted it first, help us smashing it by providing a detailed and welcomed |
|||
<a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/issues/new?body=module:%20easy_my_coop_ch%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> |
|||
<p>Do not contact contributors directly about support or help with technical issues.</p> |
|||
</div> |
|||
<div class="section" id="credits"> |
|||
<h1><a class="toc-backref" href="#id2">Credits</a></h1> |
|||
<div class="section" id="authors"> |
|||
<h2><a class="toc-backref" href="#id3">Authors</a></h2> |
|||
<ul class="simple"> |
|||
<li>Houssine BAKKALI <<a class="reference external" href="mailto:houssine@coopiteasy.be">houssine@coopiteasy.be</a>></li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="contributors"> |
|||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2> |
|||
<ul class="simple"> |
|||
<li>Coop IT Easy SCRLfs</li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="maintainers"> |
|||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2> |
|||
<p>This module is part of the <a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_ch">coopiteasy/vertical-cooperative</a> project on GitHub.</p> |
|||
<p>You are welcome to contribute.</p> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</body> |
|||
</html> |
@ -1,63 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<template id="certificate_i18n_fr" inherit_id="easy_my_coop.cooperator_certificat_G001_document" name="French Layout Certificate"> |
|||
<xpath expr="//div[@name='label_coop_number']" position="replace"> |
|||
<div name="label_coop_number" style="position:relative;top:35px;font-size:16;"> |
|||
<span>Ce document atteste de la souscription de parts sociales au capital de la SAS Coopérative à Capital Variable SuperQuinquin par </span> |
|||
<b><span t-field="o.name"></span></b> |
|||
<span>, enregistré(e) sous le <b>numéro de coopérateur </b></span> |
|||
<span t-field="o.cooperator_register_number"></span> |
|||
</div> |
|||
</xpath> |
|||
|
|||
<xpath expr="//div[@name='total_table']" position="after"> |
|||
<div name="legal_text" style="position:relative;top:145px;font-size:12;"> |
|||
<div>Ce document atteste d’une souscription en numéraire au capital d’une société, répondant à la définition communautaire de la Petite et Moyenne Entreprise, dont les titres ne sont pas admis aux négociations sur un marché d’instruments financiers français ou étranger en application de l’article 199 terdecies 0A du CGI.<br/> |
|||
Conformément aux statuts, les souscriptions de parts sociales de type A et B n’ouvre pas droit à rémunération.<br/> |
|||
La société remplit les conditions mentionnées aux c, d et e du 2° du I de l’article 199 terdecies-0 A du code général des impôts : <br/> |
|||
c) La société est soumise à l’impôt sur les sociétés dans les conditions de droit commun ;<br/> |
|||
<br/> |
|||
c bis) La société compte au moins deux salariés à la clôture de son premier exercice ou un salarié si elle est soumise à l’obligation de s’inscrire à la chambre de métiers et de l’artisanat ;<br/> |
|||
<br/> |
|||
d) La société exerce une activité commerciale, industrielle, artisanale, libérale ou agricole, à l’exclusion des activités procurant des revenus garantis en raison de l’existence d’un tarif réglementé de rachat de la production, des activités financières, des activités de gestion de patrimoine mobilier définie à l’article 885 O quater et des activités immobilières. Toutefois, les exclusions relatives à l’exercice d’une activité financière ou immobilière ne sont pas applicables aux entreprises solidaires mentionnées à l’article L. 3332-17-1 du code du travail.<br/> |
|||
La société n’exerce pas une activité de production d’électricité utilisant l’énergie radiative du soleil ;<br/> |
|||
<br/> |
|||
d bis) Les actifs de la société ne sont pas constitués de façon prépondérante de métaux précieux, d’œuvres d’art, d’objets de collection, d’antiquités, de chevaux de course ou de concours ou, sauf si l’objet même de son activité consiste en leur consommation ou en leur vente au détail, de vins ou d’alcools ;<br/> |
|||
<br/> |
|||
d ter) Les souscriptions au capital de la société confèrent aux souscripteurs les seuls droits résultant de la qualité d’actionnaire ou d’associé, à l’exclusion de toute autre contrepartie notamment sous la forme de tarifs préférentiels ou d’accès prioritaire aux biens produits ou aux services rendus par la société ;<br/> |
|||
<br/> |
|||
e) La société doit être une petite et moyenne entreprise qui satisfait à la définition des petites et moyennes entreprises qui figure à l’annexe I au règlement (CE) n° 800/2008 de la Commission du 6 août 2008 déclarant certaines catégories d’aide compatibles avec le marché commun en application des articles 87 et 88 du traité (Règlement général d’exemption par catégorie) ;<br/> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
<xpath expr="//div[@name='board_commitee']" position="replace"> |
|||
<div name="" class="col-xs-6 pull-left" style="position:relative;top:105px;font-size:20;color:black;font-family:Roboto-Regular;"> |
|||
<div style="position:relative;top:105px;"> |
|||
Pour le Conseil d'administration de <span t-field="o.company_id.name"/>. |
|||
</div> |
|||
<div style="position:relative;top:110px;"> |
|||
<strong><span t-field="o.company_id.board_representative"/></strong> |
|||
</div> |
|||
<div style="position:relative;top:115px;"> |
|||
<img t-if="o.company_id.signature_scan" t-att-src="'data:image/png;base64,%s' % o.company_id.signature_scan" style="width:240px;height:180px;padding-bottom:5px;"/> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</template> |
|||
|
|||
<template id="capital_release_request_i18n_fr" inherit_id="easy_my_coop.theme_invoice_G002_document" name="French Layout Certificate"> |
|||
<xpath expr="//p[@t-if='o.comment']" position="before"> |
|||
<div class="row"> |
|||
<div style="position:relative;top:225px;font-size:16;"> |
|||
Votre demande de souscription de parts sociales, détaillé dans le tableau ci-dessus, a bien été prise en compte.<br/> |
|||
<br/> |
|||
Afin de valider votre enregistrement en tant que coopérateur, vous devez tout d’abord procéder au paiement de celles-ci.<br/> |
|||
<br/> |
|||
Un email contenant les instructions de paiement vous a également été envoyé.<br/> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</template> |
|||
</data> |
|||
</odoo> |
@ -1,26 +1,39 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<template id="subscription_i18n_ch" inherit_id="easy_my_coop_website.becomecooperator" name="Removing fields"> |
|||
<xpath expr="//label[@for='iban']/.." position="replace"> |
|||
<div t-attf-class="form-group #{error and 'iban' in error and 'has-error' or ''}"> |
|||
<label class="col-md-3 col-sm-4 control-label" for="iban">Bank Account Number</label> |
|||
<div class="col-md-7 col-sm-8"> |
|||
<input type="text" class="form-control mandatory-field" name="iban" t-attf-value="#{iban or ''}" placeholder="BE48523080767127"/> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</template> |
|||
|
|||
<template id="company_subscription_i18n_ch" inherit_id="easy_my_coop_website.becomecompanycooperator" name="Company Removing fields"> |
|||
<xpath expr="//label[@for='iban']/.." position="replace"> |
|||
<div t-attf-class="form-group #{error and 'iban' in error and 'has-error' or ''}"> |
|||
<label class="col-md-3 col-sm-4 control-label" for="iban">Bank Account Number</label> |
|||
<div class="col-md-7 col-sm-8"> |
|||
<input type="text" class="form-control mandatory-field" name="iban" t-attf-value="#{iban or ''}" placeholder="BE48523080767127"/> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</template> |
|||
</data> |
|||
</odoo> |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<template id="subscription_i18n_ch" |
|||
inherit_id="easy_my_coop_website.becomecooperator" |
|||
name="Removing fields"> |
|||
<!-- fixme instead of removing here, it should be added in easy_my_coop_be --> |
|||
<xpath expr="//label[@for='iban']/.." position="replace"> |
|||
<div t-attf-class="form-group #{error and 'iban' in error and 'has-error' or ''}"> |
|||
<label class="col-md-3 col-sm-4 control-label" for="iban"> |
|||
Bank Account Number |
|||
</label> |
|||
<div class="col-md-7 col-sm-8"> |
|||
<input type="text" class="form-control mandatory-field" |
|||
name="iban" t-attf-value="#{iban or ''}" |
|||
placeholder="BE48523080767127"/> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</template> |
|||
|
|||
<template id="company_subscription_i18n_ch" |
|||
inherit_id="easy_my_coop_website.becomecompanycooperator" |
|||
name="Company Removing fields"> |
|||
<xpath expr="//label[@for='iban']/.." position="replace"> |
|||
<div t-attf-class="form-group #{error and 'iban' in error and 'has-error' or ''}"> |
|||
<label class="col-md-3 col-sm-4 control-label" for="iban"> |
|||
Bank Account Number |
|||
</label> |
|||
<div class="col-md-7 col-sm-8"> |
|||
<input type="text" class="form-control mandatory-field" |
|||
name="iban" t-attf-value="#{iban or ''}" |
|||
placeholder="BE48523080767127"/> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</template> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,62 @@ |
|||
============================ |
|||
Easy My Coop Dividend Engine |
|||
============================ |
|||
|
|||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
!! This file is generated by oca-gen-addon-readme !! |
|||
!! changes will be overwritten. !! |
|||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
|
|||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
|||
:target: https://odoo-community.org/page/development-status |
|||
:alt: Beta |
|||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png |
|||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
.. |badge3| image:: https://img.shields.io/badge/github-coopiteasy%2Fvertical--cooperative-lightgray.png?logo=github |
|||
:target: https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_dividend |
|||
:alt: coopiteasy/vertical-cooperative |
|||
|
|||
|badge1| |badge2| |badge3| |
|||
|
|||
This module allows to calculate the dividend to give to a cooperator base |
|||
on the amount of his shares, the percentage allocated and for how long the |
|||
shares have been owned on prorata temporis calculation. |
|||
|
|||
**Table of contents** |
|||
|
|||
.. contents:: |
|||
:local: |
|||
|
|||
Bug Tracker |
|||
=========== |
|||
|
|||
Bugs are tracked on `GitHub Issues <https://github.com/coopiteasy/vertical-cooperative/issues>`_. |
|||
In case of trouble, please check there if your issue has already been reported. |
|||
If you spotted it first, help us smashing it by providing a detailed and welcomed |
|||
`feedback <https://github.com/coopiteasy/vertical-cooperative/issues/new?body=module:%20easy_my_coop_dividend%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
|||
|
|||
Do not contact contributors directly about support or help with technical issues. |
|||
|
|||
Credits |
|||
======= |
|||
|
|||
Authors |
|||
~~~~~~~ |
|||
|
|||
* Houssine BAKKALI |
|||
* <houssine@coopiteasy.be> |
|||
|
|||
Contributors |
|||
~~~~~~~~~~~~ |
|||
|
|||
* Coop IT Easy SCRLfs |
|||
* Houssine BAKKALI, <houssine@coopiteasy.be> |
|||
|
|||
|
|||
Maintainers |
|||
~~~~~~~~~~~ |
|||
|
|||
This module is part of the `coopiteasy/vertical-cooperative <https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_dividend>`_ project on GitHub. |
|||
|
|||
You are welcome to contribute. |
@ -1,2 +1 @@ |
|||
# -*- coding: utf8 -*- |
|||
from . import models |
@ -1,2 +1 @@ |
|||
# -*- coding: utf8 -*- |
|||
from . import dividend |
@ -1,190 +1,213 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from __future__ import division |
|||
from datetime import datetime |
|||
import openerp.addons.decimal_precision as dp |
|||
|
|||
from openerp import fields, models, api |
|||
|
|||
|
|||
class dividend_year(models.Model): |
|||
_name = 'dividend.year' |
|||
|
|||
@api.multi |
|||
def _compute_dividend_info(self): |
|||
res = {} |
|||
for dividend in self: |
|||
res[dividend.id] = {'grand_total_dividend': 0.0, |
|||
'grand_total_taxes': 0.0} |
|||
for line in dividend.dividend_ids: |
|||
res[dividend.id]['grand_total_dividend'] += line.dividend_amount |
|||
res[dividend.id]['grand_total_taxes'] += line.dividend_taxes |
|||
return res |
|||
|
|||
name = fields.Char(string='Code') |
|||
date_from = fields.Date(string='Date from') |
|||
date_to = fields.Date(string='Date to') |
|||
# fiscal_year_id = fields.Many2one('account.fiscalyear', |
|||
# string='Fiscal year') |
|||
percentage = fields.Float(string='Percentage') |
|||
withholding_tax = fields.Float(string='Withholding tax') |
|||
detailed_dividend_ids = fields.One2many('detailed.dividend.line', |
|||
'dividend_year_id', |
|||
string='Dividend lines') |
|||
dividend_ids = fields.One2many('dividend.line', |
|||
'dividend_year_id', |
|||
string='Dividend lines') |
|||
grand_total_dividend = fields.Float( |
|||
compute=_compute_dividend_info, |
|||
string='Grand total dividend', |
|||
digits_compute=dp.get_precision('Account')) |
|||
grand_total_taxes = fields.Float( |
|||
compute=_compute_dividend_info, |
|||
string='Grand total taxes', |
|||
digits_compute=dp.get_precision('Account')) |
|||
|
|||
@api.multi |
|||
def compute_dividend(self): |
|||
self.ensure_one() |
|||
det_div_line_obj = self.env['detailed.dividend.line'] |
|||
div_line_obj = self.env['dividend.line'] |
|||
res_partner_obj = self.env['res.partner'] |
|||
|
|||
# delete lines if any |
|||
detailed_dividend_ids = det_div_line_obj.search([('dividend_year_id', '=', self.id)]) |
|||
detailed_dividend_ids.unlink() |
|||
dividend_ids = div_line_obj.search([('dividend_year_id', '=', self.id)]) |
|||
dividend_ids.unlink() |
|||
|
|||
partner_ids = res_partner_obj.search([ |
|||
('cooperator', '=', True), |
|||
('member', '=', True)], |
|||
order='cooperator_register_number') |
|||
number_of_days = (datetime.strptime(self.date_to, '%Y-%m-%d') |
|||
- datetime.strptime(self.date_from, '%Y-%m-%d') |
|||
).days + 1 |
|||
|
|||
for partner in partner_ids: |
|||
total_amount_dividend = 0.0 |
|||
for line in partner.share_ids: |
|||
vals = {} |
|||
vals2 = {} |
|||
line_id = False |
|||
if line.effective_date >= self.date_from \ |
|||
and line.effective_date <= self.date_to: |
|||
date_res = (datetime.strptime(self.date_to, '%Y-%m-%d') |
|||
- datetime.strptime(line.effective_date, '%Y-%m-%d')).days |
|||
coeff = (date_res / number_of_days) * self.percentage |
|||
dividend_amount = line.total_amount_line * coeff |
|||
|
|||
vals['days'] = date_res |
|||
vals['dividend_year_id'] = self.id |
|||
vals['coop_number'] = line.partner_id.cooperator_register_number |
|||
vals['partner_id'] = partner.id |
|||
vals['share_line_id'] = line.id |
|||
vals['coeff'] = coeff |
|||
vals['dividend_amount'] = dividend_amount |
|||
total_amount_dividend += dividend_amount |
|||
|
|||
line_id = det_div_line_obj.create(vals) |
|||
elif line.effective_date < self.date_from: |
|||
dividend_amount = line.total_amount_line * self.percentage |
|||
vals['days'] = number_of_days |
|||
vals['dividend_year_id'] = self.id |
|||
vals['coop_number'] = line.partner_id.cooperator_register_number |
|||
vals['partner_id'] = partner.id |
|||
vals['share_line_id'] = line.id |
|||
vals['coeff'] = self.percentage |
|||
vals['dividend_amount'] = dividend_amount |
|||
total_amount_dividend += dividend_amount |
|||
|
|||
line_id = det_div_line_obj.create(vals) |
|||
if line_id: |
|||
vals2['coop_number'] = line.partner_id.cooperator_register_number |
|||
vals2['dividend_year_id'] = self.id |
|||
vals2['partner_id'] = line.partner_id.id |
|||
|
|||
vals2['dividend_amount_net'] = total_amount_dividend |
|||
vals2['dividend_amount'] = total_amount_dividend |
|||
|
|||
# TODO set as a parameter on dividend year object |
|||
if total_amount_dividend <= 190.00: |
|||
vals2['dividend_taxes'] = 0.0 |
|||
else: |
|||
div_tax = (total_amount_dividend - 190) * self.withholding_tax |
|||
vals2['dividend_taxes'] = div_tax |
|||
vals2['dividend_amount_net'] = total_amount_dividend - div_tax |
|||
|
|||
div_line_obj.create(vals2) |
|||
return True |
|||
|
|||
|
|||
class DetailedDividendLine(models.Model): |
|||
_name = 'detailed.dividend.line' |
|||
|
|||
@api.multi |
|||
def _compute_total_line(self): |
|||
res = {} |
|||
for line in self: |
|||
res[line.id] = line.share_unit_price * line.share_number |
|||
return res |
|||
|
|||
dividend_year_id = fields.Many2one('dividend.year', |
|||
string='Dividend year') |
|||
coop_number = fields.Integer(string='Cooperator Number') |
|||
days = fields.Integer(string='Days') |
|||
partner_id = fields.Many2one('res.partner', |
|||
string='Cooperator', |
|||
readonly=True) |
|||
share_line_id = fields.Many2one('share.line', |
|||
string='Share line', |
|||
readonly=True) |
|||
share_number = fields.Integer(related='share_line_id.share_number', |
|||
string='Number of Share') |
|||
share_unit_price = fields.Monetary( |
|||
string='Share unit price', |
|||
related='share_line_id.share_unit_price', |
|||
) |
|||
effective_date = fields.Date(related='share_line_id.effective_date', |
|||
string='Effective date') |
|||
total_amount_line = fields.Monetary( |
|||
string="Total value of share", |
|||
currency_field="company_currency_id", |
|||
compute=_compute_total_line, |
|||
readonly=True, |
|||
) |
|||
coeff = fields.Float(string='Coefficient to apply', |
|||
digits=(2, 4)) |
|||
dividend_amount = fields.Float(string='Gross Dividend') |
|||
dividend_amount_net = fields.Float(string='Dividend net') |
|||
dividend_taxes = fields.Float(string='Taxes') |
|||
company_currency_id = fields.Many2one( |
|||
related="share_line_id.company_currency_id", |
|||
readonly=True, |
|||
) |
|||
|
|||
|
|||
class dividend_line(models.Model): |
|||
_name = 'dividend.line' |
|||
|
|||
@api.multi |
|||
def _get_account_number(self): |
|||
res = {} |
|||
for line in self: |
|||
bank_accounts = self.env['res.partner.bank'].search( |
|||
[('partner_id', '=', line.partner_id.id)]) |
|||
res[line.id] = bank_accounts[0].acc_number |
|||
|
|||
return res |
|||
|
|||
coop_number = fields.Integer(string='Coop Number') |
|||
dividend_year_id = fields.Many2one('dividend.year', |
|||
string='Dividend year') |
|||
partner_id = fields.Many2one('res.partner', |
|||
string='Cooperator', |
|||
readonly=True) |
|||
account_number = fields.Char(compute=_get_account_number, |
|||
string='Account Number') |
|||
dividend_amount = fields.Float(string='Gross Dividend') |
|||
dividend_amount_net = fields.Float(string='Dividend net') |
|||
dividend_taxes = fields.Float(string='Taxes') |
|||
from __future__ import division |
|||
|
|||
from datetime import datetime |
|||
|
|||
import openerp.addons.decimal_precision as dp |
|||
from openerp import api, fields, models |
|||
|
|||
|
|||
class DividendYear(models.Model): |
|||
_name = "dividend.year" |
|||
|
|||
@api.multi |
|||
def _compute_dividend_info(self): |
|||
res = {} |
|||
for dividend in self: |
|||
res[dividend.id] = { |
|||
"grand_total_dividend": 0.0, |
|||
"grand_total_taxes": 0.0, |
|||
} |
|||
for line in dividend.dividend_ids: |
|||
res[dividend.id][ |
|||
"grand_total_dividend" |
|||
] += line.dividend_amount |
|||
res[dividend.id]["grand_total_taxes"] += line.dividend_taxes |
|||
return res |
|||
|
|||
name = fields.Char(string="Code") |
|||
date_from = fields.Date(string="Date from") |
|||
date_to = fields.Date(string="Date to") |
|||
# fiscal_year_id = fields.Many2one('account.fiscalyear', |
|||
# string='Fiscal year') |
|||
percentage = fields.Float(string="Percentage") |
|||
withholding_tax = fields.Float(string="Withholding tax") |
|||
detailed_dividend_ids = fields.One2many( |
|||
"detailed.dividend.line", "dividend_year_id", string="Dividend lines" |
|||
) |
|||
dividend_ids = fields.One2many( |
|||
"dividend.line", "dividend_year_id", string="Dividend lines" |
|||
) |
|||
grand_total_dividend = fields.Float( |
|||
compute=_compute_dividend_info, |
|||
string="Grand total dividend", |
|||
digits_compute=dp.get_precision("Account"), |
|||
) |
|||
grand_total_taxes = fields.Float( |
|||
compute=_compute_dividend_info, |
|||
string="Grand total taxes", |
|||
digits_compute=dp.get_precision("Account"), |
|||
) |
|||
|
|||
@api.multi |
|||
def compute_dividend(self): |
|||
self.ensure_one() |
|||
det_div_line_obj = self.env["detailed.dividend.line"] |
|||
div_line_obj = self.env["dividend.line"] |
|||
res_partner_obj = self.env["res.partner"] |
|||
|
|||
# delete lines if any |
|||
detailed_dividend_ids = det_div_line_obj.search( |
|||
[("dividend_year_id", "=", self.id)] |
|||
) |
|||
detailed_dividend_ids.unlink() |
|||
dividend_ids = div_line_obj.search( |
|||
[("dividend_year_id", "=", self.id)] |
|||
) |
|||
dividend_ids.unlink() |
|||
|
|||
partner_ids = res_partner_obj.search( |
|||
[("cooperator", "=", True), ("member", "=", True)], |
|||
order="cooperator_register_number", |
|||
) |
|||
number_of_days = ( |
|||
datetime.strptime(self.date_to, "%Y-%m-%d") |
|||
- datetime.strptime(self.date_from, "%Y-%m-%d") |
|||
).days + 1 |
|||
|
|||
for partner in partner_ids: |
|||
total_amount_dividend = 0.0 |
|||
for line in partner.share_ids: |
|||
vals = {} |
|||
vals2 = {} |
|||
line_id = False |
|||
if ( |
|||
line.effective_date >= self.date_from |
|||
and line.effective_date <= self.date_to |
|||
): |
|||
date_res = ( |
|||
datetime.strptime(self.date_to, "%Y-%m-%d") |
|||
- datetime.strptime(line.effective_date, "%Y-%m-%d") |
|||
).days |
|||
coeff = (date_res / number_of_days) * self.percentage |
|||
dividend_amount = line.total_amount_line * coeff |
|||
|
|||
vals["days"] = date_res |
|||
vals["dividend_year_id"] = self.id |
|||
vals[ |
|||
"coop_number" |
|||
] = line.partner_id.cooperator_register_number |
|||
vals["partner_id"] = partner.id |
|||
vals["share_line_id"] = line.id |
|||
vals["coeff"] = coeff |
|||
vals["dividend_amount"] = dividend_amount |
|||
total_amount_dividend += dividend_amount |
|||
|
|||
line_id = det_div_line_obj.create(vals) |
|||
elif line.effective_date < self.date_from: |
|||
dividend_amount = line.total_amount_line * self.percentage |
|||
vals["days"] = number_of_days |
|||
vals["dividend_year_id"] = self.id |
|||
vals[ |
|||
"coop_number" |
|||
] = line.partner_id.cooperator_register_number |
|||
vals["partner_id"] = partner.id |
|||
vals["share_line_id"] = line.id |
|||
vals["coeff"] = self.percentage |
|||
vals["dividend_amount"] = dividend_amount |
|||
total_amount_dividend += dividend_amount |
|||
|
|||
line_id = det_div_line_obj.create(vals) |
|||
if line_id: |
|||
vals2[ |
|||
"coop_number" |
|||
] = line.partner_id.cooperator_register_number |
|||
vals2["dividend_year_id"] = self.id |
|||
vals2["partner_id"] = line.partner_id.id |
|||
|
|||
vals2["dividend_amount_net"] = total_amount_dividend |
|||
vals2["dividend_amount"] = total_amount_dividend |
|||
|
|||
# TODO set as a parameter on dividend year object |
|||
if total_amount_dividend <= 190.00: |
|||
vals2["dividend_taxes"] = 0.0 |
|||
else: |
|||
div_tax = ( |
|||
total_amount_dividend - 190 |
|||
) * self.withholding_tax |
|||
vals2["dividend_taxes"] = div_tax |
|||
vals2["dividend_amount_net"] = ( |
|||
total_amount_dividend - div_tax |
|||
) |
|||
|
|||
div_line_obj.create(vals2) |
|||
return True |
|||
|
|||
|
|||
class DetailedDividendLine(models.Model): |
|||
_name = "detailed.dividend.line" |
|||
|
|||
@api.multi |
|||
def _compute_total_line(self): |
|||
res = {} |
|||
for line in self: |
|||
res[line.id] = line.share_unit_price * line.share_number |
|||
return res |
|||
|
|||
dividend_year_id = fields.Many2one("dividend.year", string="Dividend year") |
|||
coop_number = fields.Integer(string="Cooperator Number") |
|||
days = fields.Integer(string="Days") |
|||
partner_id = fields.Many2one( |
|||
"res.partner", string="Cooperator", readonly=True |
|||
) |
|||
share_line_id = fields.Many2one( |
|||
"share.line", string="Share line", readonly=True |
|||
) |
|||
share_number = fields.Integer( |
|||
related="share_line_id.share_number", string="Number of Share" |
|||
) |
|||
share_unit_price = fields.Monetary( |
|||
string="Share unit price", related="share_line_id.share_unit_price" |
|||
) |
|||
effective_date = fields.Date( |
|||
related="share_line_id.effective_date", string="Effective date" |
|||
) |
|||
total_amount_line = fields.Monetary( |
|||
string="Total value of share", |
|||
currency_field="company_currency_id", |
|||
compute=_compute_total_line, |
|||
readonly=True, |
|||
) |
|||
coeff = fields.Float(string="Coefficient to apply", digits=(2, 4)) |
|||
dividend_amount = fields.Float(string="Gross Dividend") |
|||
dividend_amount_net = fields.Float(string="Dividend net") |
|||
dividend_taxes = fields.Float(string="Taxes") |
|||
company_currency_id = fields.Many2one( |
|||
related="share_line_id.company_currency_id", readonly=True |
|||
) |
|||
|
|||
|
|||
class DividendLine(models.Model): |
|||
_name = "dividend.line" |
|||
|
|||
@api.multi |
|||
def _get_account_number(self): |
|||
res = {} |
|||
for line in self: |
|||
bank_accounts = self.env["res.partner.bank"].search( |
|||
[("partner_id", "=", line.partner_id.id)] |
|||
) |
|||
res[line.id] = bank_accounts[0].acc_number |
|||
|
|||
return res |
|||
|
|||
coop_number = fields.Integer(string="Coop Number") |
|||
dividend_year_id = fields.Many2one("dividend.year", string="Dividend year") |
|||
partner_id = fields.Many2one( |
|||
"res.partner", string="Cooperator", readonly=True |
|||
) |
|||
account_number = fields.Char( |
|||
compute=_get_account_number, string="Account Number" |
|||
) |
|||
dividend_amount = fields.Float(string="Gross Dividend") |
|||
dividend_amount_net = fields.Float(string="Dividend net") |
|||
dividend_taxes = fields.Float(string="Taxes") |
@ -0,0 +1,2 @@ |
|||
* Coop IT Easy SCRLfs |
|||
* Houssine BAKKALI, <houssine@coopiteasy.be> |
@ -0,0 +1,3 @@ |
|||
This module allows to calculate the dividend to give to a cooperator base |
|||
on the amount of his shares, the percentage allocated and for how long the |
|||
shares have been owned on prorata temporis calculation. |
@ -1 +1 @@ |
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
@ -0,0 +1,419 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" /> |
|||
<title>Easy My Coop Dividend Engine</title> |
|||
<style type="text/css"> |
|||
|
|||
/* |
|||
:Author: David Goodger (goodger@python.org) |
|||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $ |
|||
:Copyright: This stylesheet has been placed in the public domain. |
|||
|
|||
Default cascading style sheet for the HTML output of Docutils. |
|||
|
|||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to |
|||
customize this style sheet. |
|||
*/ |
|||
|
|||
/* used to remove borders from tables and images */ |
|||
.borderless, table.borderless td, table.borderless th { |
|||
border: 0 } |
|||
|
|||
table.borderless td, table.borderless th { |
|||
/* Override padding for "table.docutils td" with "! important". |
|||
The right padding separates the table cells. */ |
|||
padding: 0 0.5em 0 0 ! important } |
|||
|
|||
.first { |
|||
/* Override more specific margin styles with "! important". */ |
|||
margin-top: 0 ! important } |
|||
|
|||
.last, .with-subtitle { |
|||
margin-bottom: 0 ! important } |
|||
|
|||
.hidden { |
|||
display: none } |
|||
|
|||
.subscript { |
|||
vertical-align: sub; |
|||
font-size: smaller } |
|||
|
|||
.superscript { |
|||
vertical-align: super; |
|||
font-size: smaller } |
|||
|
|||
a.toc-backref { |
|||
text-decoration: none ; |
|||
color: black } |
|||
|
|||
blockquote.epigraph { |
|||
margin: 2em 5em ; } |
|||
|
|||
dl.docutils dd { |
|||
margin-bottom: 0.5em } |
|||
|
|||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { |
|||
overflow: hidden; |
|||
} |
|||
|
|||
/* Uncomment (and remove this text!) to get bold-faced definition list terms |
|||
dl.docutils dt { |
|||
font-weight: bold } |
|||
*/ |
|||
|
|||
div.abstract { |
|||
margin: 2em 5em } |
|||
|
|||
div.abstract p.topic-title { |
|||
font-weight: bold ; |
|||
text-align: center } |
|||
|
|||
div.admonition, div.attention, div.caution, div.danger, div.error, |
|||
div.hint, div.important, div.note, div.tip, div.warning { |
|||
margin: 2em ; |
|||
border: medium outset ; |
|||
padding: 1em } |
|||
|
|||
div.admonition p.admonition-title, div.hint p.admonition-title, |
|||
div.important p.admonition-title, div.note p.admonition-title, |
|||
div.tip p.admonition-title { |
|||
font-weight: bold ; |
|||
font-family: sans-serif } |
|||
|
|||
div.attention p.admonition-title, div.caution p.admonition-title, |
|||
div.danger p.admonition-title, div.error p.admonition-title, |
|||
div.warning p.admonition-title, .code .error { |
|||
color: red ; |
|||
font-weight: bold ; |
|||
font-family: sans-serif } |
|||
|
|||
/* Uncomment (and remove this text!) to get reduced vertical space in |
|||
compound paragraphs. |
|||
div.compound .compound-first, div.compound .compound-middle { |
|||
margin-bottom: 0.5em } |
|||
|
|||
div.compound .compound-last, div.compound .compound-middle { |
|||
margin-top: 0.5em } |
|||
*/ |
|||
|
|||
div.dedication { |
|||
margin: 2em 5em ; |
|||
text-align: center ; |
|||
font-style: italic } |
|||
|
|||
div.dedication p.topic-title { |
|||
font-weight: bold ; |
|||
font-style: normal } |
|||
|
|||
div.figure { |
|||
margin-left: 2em ; |
|||
margin-right: 2em } |
|||
|
|||
div.footer, div.header { |
|||
clear: both; |
|||
font-size: smaller } |
|||
|
|||
div.line-block { |
|||
display: block ; |
|||
margin-top: 1em ; |
|||
margin-bottom: 1em } |
|||
|
|||
div.line-block div.line-block { |
|||
margin-top: 0 ; |
|||
margin-bottom: 0 ; |
|||
margin-left: 1.5em } |
|||
|
|||
div.sidebar { |
|||
margin: 0 0 0.5em 1em ; |
|||
border: medium outset ; |
|||
padding: 1em ; |
|||
background-color: #ffffee ; |
|||
width: 40% ; |
|||
float: right ; |
|||
clear: right } |
|||
|
|||
div.sidebar p.rubric { |
|||
font-family: sans-serif ; |
|||
font-size: medium } |
|||
|
|||
div.system-messages { |
|||
margin: 5em } |
|||
|
|||
div.system-messages h1 { |
|||
color: red } |
|||
|
|||
div.system-message { |
|||
border: medium outset ; |
|||
padding: 1em } |
|||
|
|||
div.system-message p.system-message-title { |
|||
color: red ; |
|||
font-weight: bold } |
|||
|
|||
div.topic { |
|||
margin: 2em } |
|||
|
|||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, |
|||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { |
|||
margin-top: 0.4em } |
|||
|
|||
h1.title { |
|||
text-align: center } |
|||
|
|||
h2.subtitle { |
|||
text-align: center } |
|||
|
|||
hr.docutils { |
|||
width: 75% } |
|||
|
|||
img.align-left, .figure.align-left, object.align-left, table.align-left { |
|||
clear: left ; |
|||
float: left ; |
|||
margin-right: 1em } |
|||
|
|||
img.align-right, .figure.align-right, object.align-right, table.align-right { |
|||
clear: right ; |
|||
float: right ; |
|||
margin-left: 1em } |
|||
|
|||
img.align-center, .figure.align-center, object.align-center { |
|||
display: block; |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
table.align-center { |
|||
margin-left: auto; |
|||
margin-right: auto; |
|||
} |
|||
|
|||
.align-left { |
|||
text-align: left } |
|||
|
|||
.align-center { |
|||
clear: both ; |
|||
text-align: center } |
|||
|
|||
.align-right { |
|||
text-align: right } |
|||
|
|||
/* reset inner alignment in figures */ |
|||
div.align-right { |
|||
text-align: inherit } |
|||
|
|||
/* div.align-center * { */ |
|||
/* text-align: left } */ |
|||
|
|||
.align-top { |
|||
vertical-align: top } |
|||
|
|||
.align-middle { |
|||
vertical-align: middle } |
|||
|
|||
.align-bottom { |
|||
vertical-align: bottom } |
|||
|
|||
ol.simple, ul.simple { |
|||
margin-bottom: 1em } |
|||
|
|||
ol.arabic { |
|||
list-style: decimal } |
|||
|
|||
ol.loweralpha { |
|||
list-style: lower-alpha } |
|||
|
|||
ol.upperalpha { |
|||
list-style: upper-alpha } |
|||
|
|||
ol.lowerroman { |
|||
list-style: lower-roman } |
|||
|
|||
ol.upperroman { |
|||
list-style: upper-roman } |
|||
|
|||
p.attribution { |
|||
text-align: right ; |
|||
margin-left: 50% } |
|||
|
|||
p.caption { |
|||
font-style: italic } |
|||
|
|||
p.credits { |
|||
font-style: italic ; |
|||
font-size: smaller } |
|||
|
|||
p.label { |
|||
white-space: nowrap } |
|||
|
|||
p.rubric { |
|||
font-weight: bold ; |
|||
font-size: larger ; |
|||
color: maroon ; |
|||
text-align: center } |
|||
|
|||
p.sidebar-title { |
|||
font-family: sans-serif ; |
|||
font-weight: bold ; |
|||
font-size: larger } |
|||
|
|||
p.sidebar-subtitle { |
|||
font-family: sans-serif ; |
|||
font-weight: bold } |
|||
|
|||
p.topic-title { |
|||
font-weight: bold } |
|||
|
|||
pre.address { |
|||
margin-bottom: 0 ; |
|||
margin-top: 0 ; |
|||
font: inherit } |
|||
|
|||
pre.literal-block, pre.doctest-block, pre.math, pre.code { |
|||
margin-left: 2em ; |
|||
margin-right: 2em } |
|||
|
|||
pre.code .ln { color: grey; } /* line numbers */ |
|||
pre.code, code { background-color: #eeeeee } |
|||
pre.code .comment, code .comment { color: #5C6576 } |
|||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } |
|||
pre.code .literal.string, code .literal.string { color: #0C5404 } |
|||
pre.code .name.builtin, code .name.builtin { color: #352B84 } |
|||
pre.code .deleted, code .deleted { background-color: #DEB0A1} |
|||
pre.code .inserted, code .inserted { background-color: #A3D289} |
|||
|
|||
span.classifier { |
|||
font-family: sans-serif ; |
|||
font-style: oblique } |
|||
|
|||
span.classifier-delimiter { |
|||
font-family: sans-serif ; |
|||
font-weight: bold } |
|||
|
|||
span.interpreted { |
|||
font-family: sans-serif } |
|||
|
|||
span.option { |
|||
white-space: nowrap } |
|||
|
|||
span.pre { |
|||
white-space: pre } |
|||
|
|||
span.problematic { |
|||
color: red } |
|||
|
|||
span.section-subtitle { |
|||
/* font-size relative to parent (h1..h6 element) */ |
|||
font-size: 80% } |
|||
|
|||
table.citation { |
|||
border-left: solid 1px gray; |
|||
margin-left: 1px } |
|||
|
|||
table.docinfo { |
|||
margin: 2em 4em } |
|||
|
|||
table.docutils { |
|||
margin-top: 0.5em ; |
|||
margin-bottom: 0.5em } |
|||
|
|||
table.footnote { |
|||
border-left: solid 1px black; |
|||
margin-left: 1px } |
|||
|
|||
table.docutils td, table.docutils th, |
|||
table.docinfo td, table.docinfo th { |
|||
padding-left: 0.5em ; |
|||
padding-right: 0.5em ; |
|||
vertical-align: top } |
|||
|
|||
table.docutils th.field-name, table.docinfo th.docinfo-name { |
|||
font-weight: bold ; |
|||
text-align: left ; |
|||
white-space: nowrap ; |
|||
padding-left: 0 } |
|||
|
|||
/* "booktabs" style (no vertical lines) */ |
|||
table.docutils.booktabs { |
|||
border: 0px; |
|||
border-top: 2px solid; |
|||
border-bottom: 2px solid; |
|||
border-collapse: collapse; |
|||
} |
|||
table.docutils.booktabs * { |
|||
border: 0px; |
|||
} |
|||
table.docutils.booktabs th { |
|||
border-bottom: thin solid; |
|||
text-align: left; |
|||
} |
|||
|
|||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, |
|||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { |
|||
font-size: 100% } |
|||
|
|||
ul.auto-toc { |
|||
list-style-type: none } |
|||
|
|||
</style> |
|||
</head> |
|||
<body> |
|||
<div class="document" id="easy-my-coop-dividend-engine"> |
|||
<h1 class="title">Easy My Coop Dividend Engine</h1> |
|||
|
|||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
!! This file is generated by oca-gen-addon-readme !! |
|||
!! changes will be overwritten. !! |
|||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> |
|||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_dividend"><img alt="coopiteasy/vertical-cooperative" src="https://img.shields.io/badge/github-coopiteasy%2Fvertical--cooperative-lightgray.png?logo=github" /></a></p> |
|||
<blockquote> |
|||
This module allows to calculate the dividend to give to a cooperator base |
|||
on the amount of his shares, the percentage allocated and for how long the |
|||
shares have been owned on prorata temporis calculation.</blockquote> |
|||
<p><strong>Table of contents</strong></p> |
|||
<div class="contents local topic" id="contents"> |
|||
<ul class="simple"> |
|||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li> |
|||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul> |
|||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li> |
|||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li> |
|||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li> |
|||
</ul> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="bug-tracker"> |
|||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1> |
|||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/issues">GitHub Issues</a>. |
|||
In case of trouble, please check there if your issue has already been reported. |
|||
If you spotted it first, help us smashing it by providing a detailed and welcomed |
|||
<a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/issues/new?body=module:%20easy_my_coop_dividend%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> |
|||
<p>Do not contact contributors directly about support or help with technical issues.</p> |
|||
</div> |
|||
<div class="section" id="credits"> |
|||
<h1><a class="toc-backref" href="#id2">Credits</a></h1> |
|||
<div class="section" id="authors"> |
|||
<h2><a class="toc-backref" href="#id3">Authors</a></h2> |
|||
<ul class="simple"> |
|||
<li>Houssine BAKKALI</li> |
|||
<li><<a class="reference external" href="mailto:houssine@coopiteasy.be">houssine@coopiteasy.be</a>></li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="contributors"> |
|||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2> |
|||
<ul class="simple"> |
|||
<li>Coop IT Easy SCRLfs</li> |
|||
<li>Houssine BAKKALI, <<a class="reference external" href="mailto:houssine@coopiteasy.be">houssine@coopiteasy.be</a>></li> |
|||
</ul> |
|||
</div> |
|||
<div class="section" id="maintainers"> |
|||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2> |
|||
<p>This module is part of the <a class="reference external" href="https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_dividend">coopiteasy/vertical-cooperative</a> project on GitHub.</p> |
|||
<p>You are welcome to contribute.</p> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</body> |
|||
</html> |
@ -1,164 +1,185 @@ |
|||
<odoo> |
|||
<data> |
|||
<menuitem name="Dividend" id="menu_easy_my_coop_main_dividend" parent="easy_my_coop.menu_main_easy_my_coop" groups="easy_my_coop.group_easy_my_coop_user" sequence="30" /> |
|||
|
|||
<record id="dividend_year_form" model="ir.ui.view"> |
|||
<field name="name">dividend.year.form</field> |
|||
<field name="model">dividend.year</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Dividend year"> |
|||
<header> |
|||
<button name="compute_dividend" string="Compute dividend" type="object" class="oe_highlight" groups="base.group_user"/> |
|||
</header> |
|||
<sheet> |
|||
<group> |
|||
<group> |
|||
<field name="name"/> |
|||
<field name="percentage"/> |
|||
<field name="grand_total_dividend"/> |
|||
<field name="grand_total_taxes"/> |
|||
</group> |
|||
<group> |
|||
<field name="date_from"/> |
|||
<field name="date_to"/> |
|||
<field name="withholding_tax"/> |
|||
</group> |
|||
</group> |
|||
<notebook> |
|||
<page string="Dividend line"> |
|||
<field name="dividend_ids"> |
|||
<tree> |
|||
<field name="coop_number"/> |
|||
<field name="partner_id"/> |
|||
<field name="dividend_amount" sum="Total dividend"/> |
|||
<field name="dividend_amount_net" sum="Total dividend net"/> |
|||
<field name="dividend_taxes" sum="Total dividend taxes"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
<page string="Detailed dividend line"> |
|||
<field name="detailed_dividend_ids"> |
|||
<tree> |
|||
<field name="coop_number"/> |
|||
<field name="partner_id"/> |
|||
<field name="share_number"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="effective_date"/> |
|||
<field name="days"/> |
|||
<field name="total_amount_line"/> |
|||
<field name="coeff"/> |
|||
<field name="dividend_amount" string="Dividend" sum="Total dividend"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
</notebook> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="dividend_year_tree" model="ir.ui.view"> |
|||
<field name="name">dividend.year.tree</field> |
|||
<field name="model">dividend.year</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Dividend year"> |
|||
<field name="name"/> |
|||
<field name="percentage"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="dividend_year_action" model="ir.actions.act_window"> |
|||
<field name="name">Dividend year</field> |
|||
<field name="res_model">dividend.year</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" ref="dividend_year_tree"/> |
|||
</record> |
|||
|
|||
<menuitem action="dividend_year_action" name="Dividend" id="menu_dividend_year" parent="menu_easy_my_coop_main_dividend" sequence="10"/> |
|||
|
|||
<record id="view_detailed_dividend_line_filter" model="ir.ui.view"> |
|||
<field name="name">detailed.dividend.line.select</field> |
|||
<field name="model">detailed.dividend.line</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search detailed dividend line"> |
|||
<field name="partner_id"/> |
|||
<field name="coop_number"/> |
|||
<filter name="dividend_year_id" string="Dividend Year"/> |
|||
<separator/> |
|||
<filter string="Partner" domain="[]" context="{'group_by':'partner_id'}"/> |
|||
<filter string="Dividend Year" domain="[]" context="{'group_by':'dividend_year_id'}"/> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
<record id="detailed_dividend_line_tree" model="ir.ui.view"> |
|||
<field name="name">detailed.dividend.line.tree</field> |
|||
<field name="model">detailed.dividend.line</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Detailed dividend lines"> |
|||
<field name="dividend_year_id"/> |
|||
<field name="coop_number"/> |
|||
<field name="partner_id"/> |
|||
<field name="share_number"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="effective_date"/> |
|||
<field name="days"/> |
|||
<field name="total_amount_line"/> |
|||
<field name="coeff"/> |
|||
<field name="dividend_amount" string="Dividend" sum="Total dividend"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="detailed_dividend_line_action" model="ir.actions.act_window"> |
|||
<field name="name">Detailed dividend lines</field> |
|||
<field name="res_model">detailed.dividend.line</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" ref="detailed_dividend_line_tree"/> |
|||
</record> |
|||
|
|||
<menuitem action="detailed_dividend_line_action" name="Detailed dividend lines" id="menu_det_dividend_line" parent="menu_easy_my_coop_main_dividend" sequence="20"/> |
|||
|
|||
<record id="view_dividend_line_filter" model="ir.ui.view"> |
|||
<field name="name">dividend.line.select</field> |
|||
<field name="model">dividend.line</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search Subscription"> |
|||
<field name="partner_id"/> |
|||
<field name="coop_number"/> |
|||
<filter name="dividend_year_id" string="Dividend Year"/> |
|||
<separator/> |
|||
<group expand="0" string="Group By..."> |
|||
<filter string="Partner" domain="[]" context="{'group_by':'partner_id'}"/> |
|||
<filter string="Dividend Year" domain="[]" context="{'group_by':'dividend_year_id'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="dividend_line_tree" model="ir.ui.view"> |
|||
<field name="name">dividend.line.tree</field> |
|||
<field name="model">dividend.line</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="dividend lines"> |
|||
<field name="dividend_year_id"/> |
|||
<field name="coop_number"/> |
|||
<field name="partner_id"/> |
|||
<field name="account_number"/> |
|||
<field name="dividend_amount" sum="Total dividend"/> |
|||
<field name="dividend_amount_net" sum="Total dividend net"/> |
|||
<field name="dividend_taxes" sum="Total dividend taxes"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="dividend_line_action" model="ir.actions.act_window"> |
|||
<field name="name">Dividend lines</field> |
|||
<field name="res_model">dividend.line</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" ref="dividend_line_tree"/> |
|||
</record> |
|||
|
|||
<menuitem action="dividend_line_action" name="Dividend lines" id="menu_dividend_line" parent="menu_easy_my_coop_main_dividend" sequence="30"/> |
|||
</data> |
|||
</odoo> |
|||
<odoo> |
|||
<data> |
|||
<menuitem name="Dividend" id="menu_easy_my_coop_main_dividend" |
|||
parent="easy_my_coop.menu_main_easy_my_coop" |
|||
groups="easy_my_coop.group_easy_my_coop_user" sequence="30"/> |
|||
|
|||
<record id="dividend_year_form" model="ir.ui.view"> |
|||
<field name="name">dividend.year.form</field> |
|||
<field name="model">dividend.year</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Dividend year"> |
|||
<header> |
|||
<button name="compute_dividend" |
|||
string="Compute dividend" type="object" |
|||
class="oe_highlight" groups="base.group_user"/> |
|||
</header> |
|||
<sheet> |
|||
<group> |
|||
<group> |
|||
<field name="name"/> |
|||
<field name="percentage"/> |
|||
<field name="grand_total_dividend"/> |
|||
<field name="grand_total_taxes"/> |
|||
</group> |
|||
<group> |
|||
<field name="date_from"/> |
|||
<field name="date_to"/> |
|||
<field name="withholding_tax"/> |
|||
</group> |
|||
</group> |
|||
<notebook> |
|||
<page string="Dividend line"> |
|||
<field name="dividend_ids"> |
|||
<tree> |
|||
<field name="coop_number"/> |
|||
<field name="partner_id"/> |
|||
<field name="dividend_amount" |
|||
sum="Total dividend"/> |
|||
<field name="dividend_amount_net" |
|||
sum="Total dividend net"/> |
|||
<field name="dividend_taxes" |
|||
sum="Total dividend taxes"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
<page string="Detailed dividend line"> |
|||
<field name="detailed_dividend_ids"> |
|||
<tree> |
|||
<field name="coop_number"/> |
|||
<field name="partner_id"/> |
|||
<field name="share_number"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="effective_date"/> |
|||
<field name="days"/> |
|||
<field name="total_amount_line"/> |
|||
<field name="coeff"/> |
|||
<field name="dividend_amount" |
|||
string="Dividend" |
|||
sum="Total dividend"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
</notebook> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="dividend_year_tree" model="ir.ui.view"> |
|||
<field name="name">dividend.year.tree</field> |
|||
<field name="model">dividend.year</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Dividend year"> |
|||
<field name="name"/> |
|||
<field name="percentage"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="dividend_year_action" model="ir.actions.act_window"> |
|||
<field name="name">Dividend year</field> |
|||
<field name="res_model">dividend.year</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" ref="dividend_year_tree"/> |
|||
</record> |
|||
|
|||
<menuitem action="dividend_year_action" name="Dividend" |
|||
id="menu_dividend_year" |
|||
parent="menu_easy_my_coop_main_dividend" sequence="10"/> |
|||
|
|||
<record id="view_detailed_dividend_line_filter" model="ir.ui.view"> |
|||
<field name="name">detailed.dividend.line.select</field> |
|||
<field name="model">detailed.dividend.line</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search detailed dividend line"> |
|||
<field name="partner_id"/> |
|||
<field name="coop_number"/> |
|||
<filter name="dividend_year_id" string="Dividend Year"/> |
|||
<separator/> |
|||
<filter string="Partner" domain="[]" |
|||
context="{'group_by':'partner_id'}"/> |
|||
<filter string="Dividend Year" domain="[]" |
|||
context="{'group_by':'dividend_year_id'}"/> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
<record id="detailed_dividend_line_tree" model="ir.ui.view"> |
|||
<field name="name">detailed.dividend.line.tree</field> |
|||
<field name="model">detailed.dividend.line</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Detailed dividend lines"> |
|||
<field name="dividend_year_id"/> |
|||
<field name="coop_number"/> |
|||
<field name="partner_id"/> |
|||
<field name="share_number"/> |
|||
<field name="share_unit_price"/> |
|||
<field name="effective_date"/> |
|||
<field name="days"/> |
|||
<field name="total_amount_line"/> |
|||
<field name="coeff"/> |
|||
<field name="dividend_amount" string="Dividend" |
|||
sum="Total dividend"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="detailed_dividend_line_action" |
|||
model="ir.actions.act_window"> |
|||
<field name="name">Detailed dividend lines</field> |
|||
<field name="res_model">detailed.dividend.line</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" ref="detailed_dividend_line_tree"/> |
|||
</record> |
|||
|
|||
<menuitem action="detailed_dividend_line_action" |
|||
name="Detailed dividend lines" id="menu_det_dividend_line" |
|||
parent="menu_easy_my_coop_main_dividend" sequence="20"/> |
|||
|
|||
<record id="view_dividend_line_filter" model="ir.ui.view"> |
|||
<field name="name">dividend.line.select</field> |
|||
<field name="model">dividend.line</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search Subscription"> |
|||
<field name="partner_id"/> |
|||
<field name="coop_number"/> |
|||
<filter name="dividend_year_id" string="Dividend Year"/> |
|||
<separator/> |
|||
<group expand="0" string="Group By..."> |
|||
<filter string="Partner" domain="[]" |
|||
context="{'group_by':'partner_id'}"/> |
|||
<filter string="Dividend Year" domain="[]" |
|||
context="{'group_by':'dividend_year_id'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="dividend_line_tree" model="ir.ui.view"> |
|||
<field name="name">dividend.line.tree</field> |
|||
<field name="model">dividend.line</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="dividend lines"> |
|||
<field name="dividend_year_id"/> |
|||
<field name="coop_number"/> |
|||
<field name="partner_id"/> |
|||
<field name="account_number"/> |
|||
<field name="dividend_amount" sum="Total dividend"/> |
|||
<field name="dividend_amount_net" sum="Total dividend net"/> |
|||
<field name="dividend_taxes" sum="Total dividend taxes"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="dividend_line_action" model="ir.actions.act_window"> |
|||
<field name="name">Dividend lines</field> |
|||
<field name="res_model">dividend.line</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" ref="dividend_line_tree"/> |
|||
</record> |
|||
|
|||
<menuitem action="dividend_line_action" name="Dividend lines" |
|||
id="menu_dividend_line" |
|||
parent="menu_easy_my_coop_main_dividend" sequence="30"/> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,54 @@ |
|||
========================= |
|||
Easy My Coop Eater/worker |
|||
========================= |
|||
|
|||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
!! This file is generated by oca-gen-addon-readme !! |
|||
!! changes will be overwritten. !! |
|||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
|
|||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
|||
:target: https://odoo-community.org/page/development-status |
|||
:alt: Beta |
|||
.. |badge2| image:: https://img.shields.io/badge/github-coopiteasy%2Fvertical--cooperative-lightgray.png?logo=github |
|||
:target: https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_eater |
|||
:alt: coopiteasy/vertical-cooperative |
|||
|
|||
|badge1| |badge2| |
|||
|
|||
This module allows to manage the activity of the cooperator in the supermarket. |
|||
|
|||
**Table of contents** |
|||
|
|||
.. contents:: |
|||
:local: |
|||
|
|||
Bug Tracker |
|||
=========== |
|||
|
|||
Bugs are tracked on `GitHub Issues <https://github.com/coopiteasy/vertical-cooperative/issues>`_. |
|||
In case of trouble, please check there if your issue has already been reported. |
|||
If you spotted it first, help us smashing it by providing a detailed and welcomed |
|||
`feedback <https://github.com/coopiteasy/vertical-cooperative/issues/new?body=module:%20easy_my_coop_eater%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
|||
|
|||
Do not contact contributors directly about support or help with technical issues. |
|||
|
|||
Credits |
|||
======= |
|||
|
|||
Authors |
|||
~~~~~~~ |
|||
|
|||
* Coop IT Easy SCRLfs |
|||
|
|||
Contributors |
|||
~~~~~~~~~~~~ |
|||
|
|||
* Coop IT Easy SCRLfs |
|||
|
|||
Maintainers |
|||
~~~~~~~~~~~ |
|||
|
|||
This module is part of the `coopiteasy/vertical-cooperative <https://github.com/coopiteasy/vertical-cooperative/tree/12.0/easy_my_coop_eater>`_ project on GitHub. |
|||
|
|||
You are welcome to contribute. |
@ -1 +1 @@ |
|||
from . import models |
|||
from . import models |
@ -0,0 +1,17 @@ |
|||
# Copyright 2013-2017 Open Architects Consulting SPRL. |
|||
# Copyright 2018- Coop IT Easy SCRLfs |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
{ |
|||
"name": "Easy My Coop Eater/worker", |
|||
"version": "12.0.1.0.0", |
|||
"depends": ["easy_my_coop", "partner_age"], |
|||
"author": "Coop IT Easy SCRLfs", |
|||
"license": "AGPL-3", |
|||
"category": "Cooperative management", |
|||
"website": "https://coopiteasy.be", |
|||
"summary": """ |
|||
This module allows to manage the activity of the cooperator in the supermarket. |
|||
""", |
|||
"data": ["view/product_view.xml"], |
|||
"installable": True, |
|||
} |
@ -1,35 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Copyright (C) 2013-2017 Open Architects Consulting SPRL. |
|||
# Copyright (C) 2018- Coop IT Easy SCRLfs. |
|||
# |
|||
# This program is free software: you can redistribute it and/or modify |
|||
# it under the terms of the GNU Affero General Public License as |
|||
# published by the Free Software Foundation, either version 3 of the |
|||
# License, or (at your option) any later version. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU Affero General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU Affero General Public License |
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
{ |
|||
"name": "Easy My Coop Eater/worker", |
|||
"version": "1.0", |
|||
"depends": ["easy_my_coop", "partner_age"], |
|||
"author": "Houssine BAKKALI <houssine@coopiteasy.be>", |
|||
"category": "Cooperative management", |
|||
'website': "www.coopiteasy.be", |
|||
"description": """ |
|||
This module allows to manage the activity of the cooperator. |
|||
""", |
|||
'data': [ |
|||
'view/product_view.xml', |
|||
], |
|||
'installable': True, |
|||
} |
@ -1,2 +1,2 @@ |
|||
from . import coop |
|||
from . import product |
|||
from . import coop |
|||
from . import product |
@ -1,28 +1,29 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from openerp import api, models |
|||
|
|||
|
|||
class SubscriptionRequest(models.Model): |
|||
_inherit = 'subscription.request' |
|||
|
|||
def get_eater_vals(self, partner, share_product_id): |
|||
vals = {} |
|||
eater = share_product_id.eater |
|||
|
|||
if partner.is_company or partner.age < 18: |
|||
eater = 'eater' |
|||
|
|||
vals['eater'] = eater |
|||
|
|||
return vals |
|||
|
|||
@api.one |
|||
def validate_subscription_request(self): |
|||
|
|||
invoice = super(SubscriptionRequest, self).validate_subscription_request()[0] |
|||
partner = invoice.partner_id |
|||
|
|||
vals = self.get_eater_vals(partner, self.share_product_id) |
|||
partner.write(vals) |
|||
|
|||
return invoice |
|||
from odoo import api, models |
|||
|
|||
|
|||
class SubscriptionRequest(models.Model): |
|||
_inherit = "subscription.request" |
|||
|
|||
def get_eater_vals(self, partner, share_product_id): |
|||
vals = {} |
|||
eater = share_product_id.eater |
|||
|
|||
if partner.is_company or partner.age < 18: |
|||
eater = "eater" |
|||
|
|||
vals["eater"] = eater |
|||
|
|||
return vals |
|||
|
|||
@api.multi |
|||
def validate_subscription_request(self): |
|||
self.ensure_one() |
|||
invoice = super( |
|||
SubscriptionRequest, self |
|||
).validate_subscription_request()[0] |
|||
partner = invoice.partner_id |
|||
|
|||
vals = self.get_eater_vals(partner, self.share_product_id) |
|||
partner.write(vals) |
|||
|
|||
return invoice |
@ -1,10 +1,10 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from openerp import fields, models |
|||
|
|||
|
|||
class ProductTemplate(models.Model): |
|||
_inherit = 'product.template' |
|||
|
|||
eater = fields.Selection([('eater', 'Eater'), |
|||
('worker_eater', 'Worker and Eater')], |
|||
string="Eater/Worker") |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ProductTemplate(models.Model): |
|||
_inherit = "product.template" |
|||
|
|||
eater = fields.Selection( |
|||
[("eater", "Eater"), ("worker_eater", "Worker and Eater")], |
|||
string="Eater/Worker", |
|||
) |
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue